bbc / audiowaveform

C++ program to generate waveform data and render waveform images from audio files
https://waveform.prototyping.bbc.co.uk
GNU General Public License v3.0
1.94k stars 242 forks source link

Splitting channels not working on .ogg file #151

Closed noopc closed 2 years ago

noopc commented 3 years ago

Version: 1.5.0 Platform: Windows

When generating waveform for an 8-track .ogg file, the output contains only one track/array of data.

Command: audiowaveform --split-channels --input-format ogg -i my_file.ogg -o my_file.json --pixels-per-second 20 --bits 8. Intrestingly, with the --split-channels option, the data field of the output json has more data than without the --split-channels option. Is it possible that the data for different channels is there, but just pushed into a single array?

Extra: When using audiowaveform version 1.5.1, I get the output Failed to read file: {my_filename}.ogg File contains data in an unimplemented format.

chrisn commented 3 years ago

Thanks for reporting this.

When generating waveform for an 8-track .ogg file, the output contains only one track/array of data.

Command: audiowaveform --split-channels --input-format ogg -i my_file.ogg -o my_file.json --pixels-per-second 20 --bits 8. Intrestingly, with the --split-channels option, the data field of the output json has more data than without the --split-channels option. Is it possible that the data for different channels is there, but just pushed into a single array?

Yes, it's a single array with data from each channel interleaved. There's documentation for the data format here.

Extra: When using audiowaveform version 1.5.1, I get the output `Failed to read file: {my_filename}.ogg File contains data in an unimplemented format.

That seems to be a regression in 1.5.1. It works OK on Linux, but the Windows build produces that error.

noopc commented 3 years ago

Thanks for the reply, @chrisn!

It seems a though I misunderstood something or missed it from the docs. When splitting channels with an .mp3 file, I get the two channels in a seperated array -> data: [channelArray1, channelArray2].

Is this not supposed to happen? Is it possible to have the same outcome (all channels seperated) with an .ogg file with more than 2 channels?

chrisn commented 3 years ago

The data is intended always to be interleaved, so I'm surprised you get that output from MP3. Can you share an example?