Menu

Conversion from .wav to .sph file

Help
2016-11-06
2016-11-06
  • Pradeep S V

    Pradeep S V - 2016-11-06

    I have downloaded the database from timit they are .wav files.
    when I opened it shows following header
    NIST_1A 1024 database_id -s5 TIMIT database_version -s3 1.0 utterance_id -s11 kah0_si2158 channel_count -i 1 sample_count -i 41575 sample_rate -i 16000 sample_min -i -4941 sample_max -i 4924 sample_n_bytes -i 2 sample_byte_format -s2 01 sample_sig_bits -i 16 end_head
    How can i convert to .sph file. Is there any code available to convert this.

     
    • Arseniy Gorin

      Arseniy Gorin - 2016-11-06

      You can convert wav to sph with sox:
      sox -t wav file.wav -t sph ofile.sph

      Sphinx supports both .sph and .wav files, so I think you do not need to convert actually

       
    • Evandro B. Gouvea

      Pradeep,

      If your file starts with "NIST_1A" then it's already in NIST Sphere (i.e.
      .sph) format, not MS WAV. No need to convert to MS WAV.

      Older databases containing audio files in sph format uses extensions like
      wav, wv1, etc. Keep in mind these were recorded before Microsoft's ".wav"
      files became popular. Only after MS WAV became popular is it that the .sph
      extension was adopted.

      MS Wav files start with "RIFF", as you already noticed, and the format is
      supported by sphinx_fe, as Arseniy already pointed out.

      --Evandro

      On 6 November 2016 at 06:46, Pradeep S V pradeepsv@users.sf.net wrote:

      I have downloaded the database from timit they are .wav files.
      when I opened it shows following header
      NIST_1A 1024 database_id -s5 TIMIT database_version -s3 1.0 utterance_id
      -s11 kah0_si2158 channel_count -i 1 sample_count -i 41575 sample_rate -i
      16000 sample_min -i -4941 sample_max -i 4924 sample_n_bytes -i 2
      sample_byte_format -s2 01 sample_sig_bits -i 16 end_head
      How can i convert to .sph file. Is there any code available to convert
      this.


      Conversion from .wav to .sph file
      https://sourceforge.net/p/cmusphinx/discussion/help/thread/0061c305/?limit=25#9028


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/cmusphinx/discussion/help/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       
  • Pradeep S V

    Pradeep S V - 2016-11-06

    Thank you sir for quick reply.
    I have an another wav file which is of RIFF not NIST header. It is not supported by sphinx.
    I have attached that wav file below. For that also i need to use the same.
    sox -t wav file.wav -t sph ofile.sph

     
    • Arseniy Gorin

      Arseniy Gorin - 2016-11-06

      Your file looks OK at first glance:
      file 0001.wav

      0001.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 16000 Hz

      You do not need to convert it. Decoder should work with this file directly. For training, you need to specify in the config file the following options:

      $CFG_WAVFILE_EXTENSION = 'wav';
      $CFG_WAVFILE_TYPE = 'mswav';

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.