xiph / opus-tools

A set of tools to encode, inspect, and decode audio in the Opus format.
https://opus-codec.org/
Other
212 stars 78 forks source link

generates wavs with a 46-byte I think Sox stat fails #69

Closed StuartIanNaylor closed 2 years ago

StuartIanNaylor commented 2 years ago

Opusdec using the MLcommons word dataset english

Samples read:                 0
Length (seconds):      0.000000
Scaled by:         2147483647.0
Maximum amplitude:     0.000000
Minimum amplitude:     0.000000
Midline amplitude:     0.000000
Mean    norm:              -nan
Mean    amplitude:         -nan
RMS     amplitude:         -nan
Maximum delta:         0.000000
Minimum delta:         0.000000
Mean    delta:        -0.000000
RMS     delta:        -0.000000
Rough   frequency:  -2147483648

Probably text, not sound

Sox stat output but will open in audacity so presume its the header?

mark4o commented 2 years ago

What file were you decoding, what were the exact commands that you used, and what was the command output?

This worked for me:

$ opusdec zero/common_voice_en_12168.opus out.wav
Decoding to 48000 Hz (1 channel)
Encoded with libopus 1.3
ENCODER=opusenc from opus-tools 0.1.10
ENCODER_OPTIONS=--quiet
Decoding complete.        
$ sox out.wav -n stat
Samples read:             48000
Length (seconds):      1.000000
Scaled by:         2147483647.0
Maximum amplitude:     0.314453
Minimum amplitude:    -0.168823
Midline amplitude:     0.072815
Mean    norm:          0.029068
Mean    amplitude:     0.000198
RMS     amplitude:     0.053175
Maximum delta:         0.049927
Minimum delta:         0.000000
Mean    delta:         0.002270
RMS     delta:         0.004428
Rough   frequency:          636
Volume adjustment:        3.180
$ 

This decodes the 8611 byte opus file to a valid 96044 byte wav file.

StuartIanNaylor commented 2 years ago

opusdec --rate 16000 I will have to go through and capture the files but its quite a few but I am decoding several gb. leave me to it and will post I just did a quick script to delete the dross and pull more than needed then trim qty. I will get back to you with better details as yeah single files and many of them work perfectly but not all, which has confused the hell out of me :) There always seems just a few in in folder of the Mlcommons dataset or its opusdec but switched to Debian as something also a but strange with the filemanager of ubuntu as really doesn't like lots of files.

From the current en language sub section of mlcommons here are the ones from hey/ Suspicious silence: 0 hey/common_voice_en_21973802.wav Suspicious silence: 0 hey/common_voice_en_22028904.wav Suspicious silence: 0 hey/common_voice_en_1298494.wav Suspicious silence: 0 hey/common_voice_en_27602.wav Suspicious silence: 0 hey/common_voice_en_22157064.wav Suspicious silence: 0 hey/common_voice_en_17885387.wav Suspicious silence: 0 hey/common_voice_en_17762242.wav Suspicious silence: 0 hey/common_voice_en_17873527.wav Suspicious silence: 0 hey/common_voice_en_17906428.wav Suspicious silence: 0 hey/common_voice_en_22118045.wav

If I test singular files always seems to work but bulk decoding its either mlcommons or opusdec. I will close as no one shouted hey yeah happens to me :)