Deepspeech: vad transcriber issue in python 3.5

Created on 16 Dec 2018  Â·  9Comments  Â·  Source: mozilla/DeepSpeech

I have been using deepspeech in python3 and have also managed to use audioTranscript_cmd.py to transcribe from wav to string however suddenly keep getting this error,

$ python3 audioTranscript_cmd.py --aggressive 1 --audio /var/www/out.wav --model  /var/deepspeech/models
DEBUG:root:Transcribing audio file @ /var/www/objects/5/converted/out.wav
DEBUG:root:Found Model: /var/deepspeech/models/output_graph.rounded.pb
DEBUG:root:Found Alphabet: /var/deepspeech/models/alphabet.txt
DEBUG:root:Found Language Model: /var/deepspeech/models/lm.binary
DEBUG:root:Found Trie: /var/deepspeech/models/trie
TensorFlow: v1.11.0-9-g97d851f
DeepSpeech: v0.3.0-0-gef6b5bd
Warning: reading entire model file into memory. Transform model file into an mmapped graph to reduce heap usage.
2018-12-16 17:37:48.650243: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
DEBUG:root:Loaded model in 0.375s.
DEBUG:root:Loaded language model in 2.962s.

Filename                       Duration(s)          Inference Time(s)    Model Load Time(s)   LM Load Time(s)
DEBUG:root:Caught the wav file @: /var/www/out.wav
Traceback (most recent call last):
  File "audioTranscript_cmd.py", line 92, in <module>
    main(sys.argv[1:])
  File "audioTranscript_cmd.py", line 50, in main
    segments, sample_rate, audio_length = wavTranscriber.vad_segment_generator(waveFile, args.aggressive)
  File "/var/www/wavTranscriber.py", line 96, in vad_segment_generator
    audio, sample_rate, audio_length = wavSplit.read_wave(wavFile)
  File "/var/www/transcriberwavSplit.py", line 11, in read_wave
    with contextlib.closing(wave.open(path, 'rb')) as wf:
  File "/usr/lib/python3.5/wave.py", line 499, in open
    return Wave_read(f)
  File "/usr/lib/python3.5/wave.py", line 163, in __init__
    self.initfp(f)
  File "/usr/lib/python3.5/wave.py", line 128, in initfp
    self._file = Chunk(file, bigendian = 0)
  File "/usr/lib/python3.5/chunk.py", line 63, in __init__
    raise EOFError
EOFError

I have re-installed all requirements, done a fresh install but still getting this error. I haven't made any changes to examples folder or any other part of codebase. Im using wav files, 16khz, mono. Have you experienced this before?

Br

All 9 comments

@maddigibiter can you try the same on the standard audio samples.

@b-ak it actually worked, my audio file is definitley 16khz mono and this is the command I use
ffmpeg -hide_banner -loglevel panic -i file.flac -acodec, pcm_s16le -ac 1 -ar 16000 out.wav
Any issue with this version?

Thanks

Can I get a copy of the your wav file ?

@b-ak issue was -acodec pcm_s16le - issue is resolved, thanks

@b-ak issue was -acodec pcm_s16le - issue is resolved, thanks

Thanks for updating us, but can you be more explicit? It's likely others will run into that as well, so your answer might be very useful.

Of course @lissyx - I used one of flac files from an audio library, initially I was using -acodec pcm_s16le in my ffmpeg transcoding. I changed it to as recommended in vad examples and didn't face errors any more. Works just fine when transcoding audio using this command

ffmpeg -hide_banner -loglevel panic -i input.mp3 -ac 1 -ar 16000 output.wav
Having in mind these options are not required in ffmpeg command

-hide_banner -loglevel panic

@maddigibiter Does the same command work for flac and mp3 files ?

Yes sir. Of course i did this. Flac to wav

On Thu 20 Dec, 2018, 1:05 AM b-ak <[email protected] wrote:

@maddigibiter https://github.com/maddigibiter Does the same command
work for flac files also ?

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/mozilla/DeepSpeech/issues/1795#issuecomment-448717531,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AiT-IPFWBMx6fb7sTxLwoaGTgQG9dhZmks5u6pTmgaJpZM4ZVWwj
.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

abuvaneswari picture abuvaneswari  Â·  30Comments

shyamalschandra picture shyamalschandra  Â·  25Comments

verloka picture verloka  Â·  23Comments

erksch picture erksch  Â·  38Comments

MuruganR96 picture MuruganR96  Â·  28Comments