Convert WAV to MP3 using LAME from PHP
问题 I have WAV data that I'd like to convert to MP3 on the fly with a PHP script. The WAV file originates with the script, so it does not start out as a file. I can run something like this: exec( "lame --cbr -b 32k in.wav out.mp3" ); But this will require that I first write in.wav to disk, read out.mp3 from disk, and then clean up when I'm finished. I'd prefer not to do that. Instead, I have the wav file stored in $wav, and I'd like to run this through LAME such that the outputted data is then