public function save($filename)
    {
        $fp = @fopen($filename, 'w+b');
        if (!is_resource($fp)) {
            throw new WavFileException('Failed to open "' . $filename . '" for writing.');
        }

        fwrite($fp, $this->makeHeader());
        fwrite($fp, $this->getDataSubchunk());
        fclose($fp);

        return $this;
    }
public function save($filename)
    {
        $fp = @fopen($filename, 'w+b');
        if (!is_resource($fp)) {
            throw new WavFileException('Failed to open "' . $filename . '" for writing.');
        }

        fwrite($fp, $this->makeHeader());
        fwrite($fp, $this->getDataSubchunk());
        fclose($fp);

        return $this;
    }
public function save ( $ filename ) { $ fp = @ fopen ( $ filename , 'w+b' ) ; if ( ! is_resource ( $ fp ) ) { throw new WavFileException ( 'Failed to open "' . $ filename . '" for writing.' ) ; } fwrite ( $ fp , $ this -> makeHeader ( ) ) ; fwrite ( $ fp , $ this -> getDataSubchunk ( ) ) ; fclose ( $ fp ) ; return $ this ; }
Save the wav data to a file.

@param string $filename  (Required) The file path to save the wav to.
@throws WavFileException
Save the wav data to a file .