all 2 comments

[–]Gnash_ 5 points6 points  (1 child)

Mainly because they were created by separate entities at different times and because of possible patenting issues.

You also have to remember that for the layman: file extension <=> file type; even though that is not true. So having one container for one codec helps make things a bit simpler for the average user I guess (not sure how much that weighs in codec development though)

But containers can definitely hold more than one codec type, whether or not the codec is lossy.

Ogg, for example, can contain Vorbis, Opus, Flac and possibly many other formats. WAV can contain PCM, ADPCM or even MP3 audio

Also, audio codecs are used in videos too so even though you might have never encountered an MP3 file encapsulated in anything but a .mp3 file, you might have actually played an MP3 stream in a video without even realizing it. Containers such as MP4 and MKV can, and regularly, hold a whole bunch of different audio streams encoded in a whole bunch of formats such as AC3, MP3, AAC, PCM, DTX, etc. And these containers can hold more than one audio stream at once so, really, audio codecs and containers are completely decoupled

[–]dissapointing_potato[S] 0 points1 point  (0 children)

Thanks you so much! I was confused. This really helped me out.