question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The format of the wav file is unknown.

See original GitHub issue

I get a RuntimeError when I run the fourth Try out random prediction codebase present in test.py. in Setup. I found that the format of the wav file in data/test was unknown. I opened this wav file in audacity, but it showed up as a file of unknown format. Is this wav file the correct one? Sorry if this is my mistake. The full text of the error is below.

> python3 test.py
Mixture file is present at following location: /home/shun/aicrowd/music-demixing-challenge-starter-kit/data/test/Mu - Too Bright/mixture.wav
Traceback (most recent call last):
  File "/home/shun/aicrowd/music-demixing-challenge-starter-kit/evaluator/music_demixing.py", line 142, in run
    self.evaluation()
  File "/home/shun/aicrowd/music-demixing-challenge-starter-kit/evaluator/music_demixing.py", line 129, in evaluation
    self.prediction(mixture_file_path=self.get_music_file_location(music_name),
  File "test.py", line 52, in prediction
    x, rate = sf.read(mixture_file_path)  # mixture is stereo with sample rate of 44.1kHz
  File "/home/shun/.local/share/virtualenvs/music-demixing-challenge-starter-kit-dMCFg2FA/lib/python3.8/site-packages/soundfile.py", line 256, in read
    with SoundFile(file, 'r', samplerate, channels,
  File "/home/shun/.local/share/virtualenvs/music-demixing-challenge-starter-kit-dMCFg2FA/lib/python3.8/site-packages/soundfile.py", line 629, in __init__
    self._file = self._open(file, mode_int, closefd)
  File "/home/shun/.local/share/virtualenvs/music-demixing-challenge-starter-kit-dMCFg2FA/lib/python3.8/site-packages/soundfile.py", line 1183, in _open
    _error_check(_snd.sf_error(file_ptr),
  File "/home/shun/.local/share/virtualenvs/music-demixing-challenge-starter-kit-dMCFg2FA/lib/python3.8/site-packages/soundfile.py", line 1357, in _error_check
    raise RuntimeError(prefix + _ffi.string(err_str).decode('utf-8', 'replace'))
RuntimeError: Error opening '/home/shun/aicrowd/music-demixing-challenge-starter-kit/data/test/Mu - Too Bright/mixture.wav': File contains data in an unknown format.

Traceback (most recent call last):
  File "test.py", line 64, in <module>
    submission.run()
  File "/home/shun/aicrowd/music-demixing-challenge-starter-kit/evaluator/music_demixing.py", line 148, in run
    raise e
  File "/home/shun/aicrowd/music-demixing-challenge-starter-kit/evaluator/music_demixing.py", line 142, in run
    self.evaluation()
  File "/home/shun/aicrowd/music-demixing-challenge-starter-kit/evaluator/music_demixing.py", line 129, in evaluation
    self.prediction(mixture_file_path=self.get_music_file_location(music_name),
  File "test.py", line 52, in prediction
    x, rate = sf.read(mixture_file_path)  # mixture is stereo with sample rate of 44.1kHz
  File "/home/shun/.local/share/virtualenvs/music-demixing-challenge-starter-kit-dMCFg2FA/lib/python3.8/site-packages/soundfile.py", line 256, in read
    with SoundFile(file, 'r', samplerate, channels,
  File "/home/shun/.local/share/virtualenvs/music-demixing-challenge-starter-kit-dMCFg2FA/lib/python3.8/site-packages/soundfile.py", line 629, in __init__
    self._file = self._open(file, mode_int, closefd)
  File "/home/shun/.local/share/virtualenvs/music-demixing-challenge-starter-kit-dMCFg2FA/lib/python3.8/site-packages/soundfile.py", line 1183, in _open
    _error_check(_snd.sf_error(file_ptr),
  File "/home/shun/.local/share/virtualenvs/music-demixing-challenge-starter-kit-dMCFg2FA/lib/python3.8/site-packages/soundfile.py", line 1357, in _error_check
    raise RuntimeError(prefix + _ffi.string(err_str).decode('utf-8', 'replace'))
RuntimeError: Error opening '/home/shun/aicrowd/music-demixing-challenge-starter-kit/data/test/Mu - Too Bright/mixture.wav': File contains data in an unknown format.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
faroitcommented, May 8, 2021

@skbly7 should we add more docs on git lfs installation requirement?

1reaction
tkeshuncommented, May 5, 2021

@skbly7 I got the git-lfs error as you suggested. Here is what I did. I checked the file size.

> ls -l * | awk '{print $5}'
132
132
132
132
132

The file size was 132 bytes, which is very small. I installed git lfs and ran git lfs pull on data/test/Mu - Too Bright.

> ls -l * | awk '{print $5}'
1234844
1234844
1234844
1234844
1234844

> python3 test.py May 06, 2021 02:45:35 PM
Mixture file is present at the following location: /home/shun/aicrowd/music-demixing-challenge-starter-kit/data/test/Mu - Too Bright/mixture.wav
/home/shun/aicrowd/music-demixing-challenge-starter-kit/data/test/Mu - Too Bright/mixture.wav: prediction completed.
Successfully generated predictions!

The file was successfully executed. Thank you for your help!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: unknown format: 3 (When trying to read audio wavfile)
Looks like the fmt chunk of your wav has unexpected data (per soundfile.sapp.org/doc/WaveFormat). The .wav files you're reading may be invalid; ...
Read more >
wav file contains data in an unknown format #3647 - GitHub
Wav audio files should be monochannel and 16khz sample rate only. Preprocess you dataset using either Sox or FFMPEG to be in a...
Read more >
File contains data in an unknown format" when trying to play ...
The first thing to do is to identify the file format. Try this page: File Identifier - Identify unknown files instantly. You should...
Read more >
Albums containing wav files are seen as "Unkown artist ...
Albums containing wav files are seen as "Unkown artist"/"Unknown album", ... In my library, I have some albums with tracks in wav format....
Read more >
Error opening 'female_present.wav': File contains data in an ...
As indicated in the title, the sound module doesn't play my file and says it's of an unknown format, despite being a .wav....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found