Wednesday, December 3, 2014

Can't locate Audio/Wav.pm

Error: Can't locate Audio/Wav.pm

Solution: install the missing Audio::Wav dependency module by following command:
sudo cpan Audio::Wav



Wednesday, November 26, 2014

Resampling audio data

Method1:
Using ch_wav  command


Example: Converting 16 Khz wave file into 8 Khz

ch_wave   -f    16000   -F    8000 -o   wav_8KHz/text001.wav     ../wav_16KHz/text001.wav

Method2:
Using sox command
sox input.wav -r 44000 output.wav resample

Here 44000 is the sampling rate of output file


Example: Converting 16 Khz wave file into 8 Khz

sox   text0001.wav   -r    8000   wav_8KHz/text001.wav   resample


Resampling all files of a directory

write following code in a file suppose down_sample.pl
chomp(@ARGV = <STDIN>) unless @ARGV;
for ( @ARGV )
{
  $was = $_;
  print "was=$was";
  #print "op =$op";

   
 
 $now="./output/".$was;
print "now1=$now\n";
   # @args= ( "ch_wave", "-f", "48000", "-F", "16000", "-o", "$now", "$was");
 @args= ( "sox", "$was", "-r", "16000", "$now", "resample" );
  
                            system(@args);


}


Suppose you are having 48 Khz wav files i directory wav_48khz:
1. Copy the down_sample.pl file having above code into wav_48khz directory
2. Create directory output inside wav_48khz directory
3. Open terminal and go to the wav_48khz directory
4. run following command
    perl down_sample.pl *.wav
5. 16 Khz wav files will be inside output directory
7. You may use either sox or ch_wav command. Some times ch_wav command does not recognise wave files then we should use sox.

Wednesday, November 19, 2014

make[3]: *** [edec.o] Error 1

Error:  During complilation of festvox


make[3]: *** [edec.o] Error 1

Solution:
Add #include <string.h>    in both hmmword.h and edec.cc in the includes section. Location of these files: festvox/src/ehmm/src

Monday, March 24, 2014

Unable to run a 32-bit program on 64-bit machine

Qs. I compiled a small "hello world" C program on Ubuntu 10.04 32 bit machine. Then I put the executable(a.out) on Ubuntu 12.10(64 bit) VMWare virtual machine and tried to execute it(./a.out). The OS does not identify the file and says 'No such file or directory'. But when I put the same executable on a Ubuntu 12.10(64 bit) running on a 64 bit laptop, it runs fine and I get the desired output. The VM is running on IBM Blade Servers. I wanted to know why the results for a VM?

Ans:
The message No such file or directory does not refer to your executable file: a.out. Instead it refers to a helper program that's needed to run the 32 bit dynamically linked executable a.out.

Source: http://askubuntu.com/questions/351827/unable-to-run-a-32-bit-program-on-64-bit-vm

Thursday, March 20, 2014

Error Wavesurfer: "Unable to open mixer /dev/mixer" or or “Could not gain access to /dev/sound/dsp "


If you get an error in terminal saying "Unable to open mixer /dev/mixer" or "Could not gain access to /dev/sound/dsp for writing.". You can resolve this problem by installing "libsnack2-alsa" package. If you are trying to install "libsnack2-alsa" package "wavesurfer" is going to uninstall, if wavesurfer is already installed.


source: http://www.lessons4you.info/solved-unable-to-open-mixer-devmixer/

Monday, March 3, 2014

Error while building flite : find_sts: usage: find_sts OPTIONS Find sts from lpc and waveform

$ ./bin/build_flite sts
Error:
/home/boss/tts_install/flite_odia/flite-1.5-beta/bin/find_sts: 
usage: find_sts OPTIONS
Find sts from lpc and waveform
-codec <string>    ulaw (default), g721, g721vuv, vuv
-vuv <string>      v/uv track (for some codecs)
-lpcmin <float>    minimum LPC value
-lpcrange <float>  range of LPC values
-lpc <string>      LPC track file
-wave <string>     WAVE file
-o <string>        STS output file

Solution: This error comes when we customize the the cst_tokenstream.c file (inside $FLITEDIR/src/utils directory) to suit our need. To resolve this issue put original  cst_tokenstream.c run the make command inside $FLITEDIR/src/utils  directory. GO to $FLITEDIR directory, run make command here also.  now run sts command.

After runninng idx and voxdata command, replace cst_tokenstream.c with customized one, run the make command inside directory. GO to $FLITEDIR directory, run make command here also.  Now, proceed further