awbcan / voiceid

Automatically exported from code.google.com/p/voiceid
0 stars 0 forks source link

input wave file sampling rate 8kHz #9

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run vid -i RIFF-little-endian-16bit-8kh-wave-file.wav

Error: Traceback (most recent call last):
  File "/usr/local/bin/vid", line 132, in <module>
    thrd_n=multiprocessing.cpu_count() * 5)
  File "/usr/local/lib/python2.7/dist-packages/voiceid/sr.py", line 899, in extract_speakers
    self._to_wav()
  File "/usr/local/lib/python2.7/dist-packages/voiceid/sr.py", line 605, in _to_wav
    fm.file2wav(self.get_filename())
  File "/usr/local/lib/python2.7/dist-packages/voiceid/fm.py", line 93, in file2wav
    + "wavenc ! filesink location=" + name + ".wav ")
  File "/usr/local/lib/python2.7/dist-packages/voiceid/utils.py", line 67, in start_subprocess
    raise err
OSError: Subprocess <subprocess.Popen object at 0xb7490c2c> closed unexpectedly 
[gst-launch filesrc location='/opt/resources/silence.wav' ! decodebin ! 
audioresample ! 'audio/x-raw-int,rate=16000' ! audioconvert ! 
'audio/x-raw-int,rate=16000,depth=16,signed=true,channels=1' !wavenc ! filesink 
location= RIFF-little-endian-16bit-8kh-wave-file.wav]

What is the expected output? What do you see instead?
Expected: It should work with 8kHz sampled wave files as well. Or atleast give 
an exception that the file doesn't match the sampling rate.. and exits.
Actual: it gives an exception, doesn't exit cleanly and truncates the input 
wave file!

What version of the product are you using? On what operating system?
Revision: 189. URL: http://voiceid.googlecode.com/svn/trunk
Ubuntu 12.04 32bit wheezy/sid

Original issue reported on code.google.com by Millenni...@gmail.com on 2 Aug 2012 at 7:41

GoogleCodeExporter commented 9 years ago
It's a bad thing :)
We knew this problem but never had the need to fix, until your request!
Now with the revision 192 it should be fixed.
Let me know if it's ok.

Original comment by maurome...@gmail.com on 2 Aug 2012 at 9:46

GoogleCodeExporter commented 9 years ago
It doesn't truncate the input wave file now. Rest is the same. When would 
voiceid be able to handle 8kHz files? Since LIUM_SpkDiarization framework uses 
8kHz as well as 16kHz, voiceid (built on top of LIUM_SpkDiarization), should be 
able to support 8kHz sampled files.

Original comment by Millenni...@gmail.com on 2 Aug 2012 at 9:55

GoogleCodeExporter commented 9 years ago
Can you attach a 8kHz file to try, with some 8kHz waves I tried it works.

Original comment by maurome...@gmail.com on 2 Aug 2012 at 10:00

GoogleCodeExporter commented 9 years ago
8kHz sample file attached.

Original comment by Millenni...@gmail.com on 2 Aug 2012 at 10:07

Attachments:

GoogleCodeExporter commented 9 years ago
Well I am at revision 192. And here is what I get:

converting_file
Traceback (most recent call last):
  File "/usr/local/bin/vid", line 132, in <module>
    thrd_n=multiprocessing.cpu_count() * 5)
  File "/usr/local/lib/python2.7/dist-packages/voiceid/sr.py", line 899, in extract_speakers
    self._to_wav()
  File "/usr/local/lib/python2.7/dist-packages/voiceid/sr.py", line 605, in _to_wav
    fm.file2wav(self.get_filename())
  File "/usr/local/lib/python2.7/dist-packages/voiceid/fm.py", line 93, in file2wav
    + "wavenc ! filesink location=" + name + ".wav ")
  File "/usr/local/lib/python2.7/dist-packages/voiceid/utils.py", line 67, in start_subprocess
    raise err
OSError: Subprocess <subprocess.Popen object at 0xb7404c2c> closed unexpectedly 
[gst-launch filesrc location='sample-8kHz.wav' ! decodebin ! audioresample ! 
'audio/x-raw-int,rate=16000' ! audioconvert ! 
'audio/x-raw-int,rate=16000,depth=16,signed=true,channels=1' !wavenc ! filesink 
location=sample-8kHz.wav ]

Original comment by Millenni...@gmail.com on 3 Aug 2012 at 5:20

GoogleCodeExporter commented 9 years ago
For what I see in the traceback, you are not using the revision 192 but still 
the revision 189, because the line numbers don't match the code in that 
revision.
For example in line 605 of sr.py (rev 192) there is not what traceback says but 
you can find that very line in the revision 189.
You have to install the new version after svn up and be sure to have the right 
revision by looking at the installed files in 
/usr/local/lib/python2.7/dist-packages/voiceid/

Original comment by maurome...@gmail.com on 3 Aug 2012 at 8:41

GoogleCodeExporter commented 9 years ago
For some reason it was giving an error on installing the new version. I 
recompiled my python installation and it worked fine :)

Original comment by Millenni...@gmail.com on 7 Aug 2012 at 7:47