psiphi75/sonogram

Better handling of multiple audio channels

Closed this issue · 1 comments

In some sense, this is just making the TODO into a github issue.

// TODO: We want to be able to handle multiple channels
assert_eq!(reader.spec().channels, 1);

I ran into this. I was able to workaround with ffmpeg's -ac flag:

IN_FILE='some_audio_file.extension'
ffmpeg -i $IN_FILE -ac 1 "${IN_FILE}.wav"

sonogram --wav "${IN_FILE}.wav" -p out.png

but would be nice to have a better solution. Probably, in order of effort and value:

  1. More clear error, with the suggestion to use ffmepg as above
  2. Warning, and select a channel at random
  3. Use both channels and display both.

Hi, I have fixed this. The audio channel will default to 1. But you can change this using the shiny new --channel <NUM> option.