Afaik, the WAV file format is just a container for multiple sound formats. Is it possible to have an MP3 embedded in a WAV file so that the file size is smaller that typical WAV files?
If so, how would one do that?
01 Answer
WAV files are a RIFF-based container, and it's indeed possible to use different sound codecs in them. The "Sound Recorder" app in older Windows versions (built around the Windows multimedia APIs) used to do exactly that – you could select PCM, µ-Law, ADPCM, CELP, MP3, etc. but it would always use the WAV format for the file itself.
Note that it is not guaranteed to work well. Newer codecs, such as Vorbis or AAC, don't seem to work with ffmpeg-generated WAV files – the players recognize the codec, but not the actual data. I do not know the theory behind this.
There is a list of sample files on Wikipedia. You can generate them using e.g. FFMPEG:
ffmpeg -i Test.mp3 -c:a copy Test.wav
ffmpeg -i TestPCM.wav -c:a libmp3lame TestMP3.wav...or by using some Windows multimedia API program (such as the same sndrec32, I don't know any others) if you need encoding support for the weird old codecs.
2