Audio and Prompts Discussions

Nested
HTK ERROR [+6213]
User: colbec
Date: 12/3/2009 11:29 am
Views: 7179
Rating: 15

Just ran into this problem in step 5 (Coding the audio data):

ERROR [+6213] OpenWaveInput: Get[format]HeaderInfo failed

The wav file loaded correctly into Audacity and reported the right params but still Hcopy was not a happy camper.
Googling did not find a suggestion, so I worked at it and found that the file was OK except that it was not correctly terminated due to the method of creating the file. On Linux a fix is:

> sox sample1.wav -L -b 16 -c 1 -r 48000 -t wav ../wavnew/sample1.wav

from the wav/ directory which puts new correctly terminated file in wavnew directory.

Any Windows expert have a suggestion for a fix for Windows CLI which can be placed in a batch file to process many wavs?

--- (Edited on 12/3/2009 11:29 am [GMT-0600] by colbec) ---

Re: HTK ERROR [+6213]
User: kmaclean
Date: 12/13/2009 7:33 pm
Views: 127
Rating: 14

> it was not correctly terminated due to the method of creating the file.

Did you compile HTK under Cygwin?  Could this be due to HTK (compiled in Cygwin) getting confused with DOS line endings, and expecting Unix line endings... the Cygwin 'unix2dos' command might help.

>it was not correctly terminated due to the method of creating the file.

How was it created? using Audacity on Windows?

Ken

--- (Edited on 12/13/2009 8:33 pm [GMT-0500] by kmaclean) ---

Re: HTK ERROR [+6213]
User: colbec
Date: 12/14/2009 3:38 am
Views: 82
Rating: 12

In my experiments to use an efficient batch process to create a set of audio files, I was using 'arecord' in Linux. Audacity is fine but the process, while informative and reassuring in a novice context, does not have the speed to deal with say 300 prompts.

It is easy (on my system at least) to recreate this issue in Linux. Just record one of your prompts in a terminal window with

arecord (appropriate arguments) samplexx.wav

Then kill the process with ctrl+Z when you finish speaking. Yes, not a good idea, it certainly kills the process (important because you don't want a zombie process) but too dramatically. But we are running a demo here. You can load the resulting file in Audacity which will not complain, but in fact the file is incomplete because it was not properly terminated.

When you build your model and you get to stage 5 processing the audio data, HTK sees that the audio file is problematic. A number of messages are output indicating that the header is not right and a few other things. This may all be true, but it does not help to diagnose the issue. When I run sox to regularize the file, the only comment it has was that the original was not terminated correctly.

sox WARN wav: Premature EOF on .wav input file

If all your prompts are a consistent length, arecord has a parameter which will terminate recording at a predetermined length. In this case the files are properly terminated and HTK will have no problem with the file, all other things being equal.

--- (Edited on 12/14/2009 3:38 am [GMT-0600] by colbec) ---

Re: HTK ERROR [+6213]
User: kmaclean
Date: 12/14/2009 11:31 am
Views: 90
Rating: 14

>Then kill the process with ctrl+Z when you finish speaking.

Interesting...

I did not think there was an issue with using arecord and HTK...  AtnNn created a recording script, and I am assuming he had no troubles using arecord and HTK (I have not tried this myself) - he used 'ctrl-c' to stop the recording...

Ken

 

--- (Edited on 12/14/2009 12:31 pm [GMT-0500] by kmaclean) ---

Re: HTK ERROR [+6213]
User: colbec
Date: 12/14/2009 1:04 pm
Views: 3071
Rating: 13

Interesting script, I have not tried it.

While attempting to write my own I found that ctrl+C was a problem because, even though it is a clean way to terminate a process (much better than ctrl+Z), when used inside a script which is also sensitive to ctrl+C, unless you fork your script to run arecord in a new process and keep them separate, ctrl+C can terminate either arecord or the script, depending on the state of the machine. If it terminates the script you have a zombie arecord process running.

I'm not all that comfortable with bash scripting, so I went exploring on my own. One of the amazing things about programming is that there are always a thousand ways to do the same job.

--- (Edited on 12/14/2009 1:04 pm [GMT-0600] by colbec) ---

PreviousNext