TeamPyOgg / PyOgg

Simple OGG Vorbis, Opus and FLAC bindings for Python
The Unlicense
63 stars 27 forks source link

Vorbis: Multiple logical bitstreams #70

Open mattgwwalker opened 3 years ago

mattgwwalker commented 3 years ago

PyOgg doesn't currently support Vorbis files with multiple logical bitstreams.

A logical bitstream may have a different number of channels or even a different sampling rate (see https://xiph.org/vorbis/doc/vorbisfile/ov_read.html).

Vorbis files with multiple logical bitstreams could be supported by chaining VorbisFile instances (with say a 'next' attribute that points to the next VorbisFile that would contain the PCM for the next logical bitstream).

A considerable constraint to implementing this was that examples files that demonstrated multiple logical bitstreams couldn't be found or created. Thus, if anyone is impacted by this issue, it would be extremely useful if you could share example Vorbis files that have multiple logical bitstreams.

Note that even Audacity doesn't handle multiple logical bitstreams (see https://wiki.audacityteam.org/wiki/OGG#Importing_multiple_stream_files).