Menu

.WAV file as raw audio

Help
tfpeach
2016-01-21
2016-01-23
  • tfpeach

    tfpeach - 2016-01-21

    Hi, I am checking the source code of pocketsphinx_batch.
    else if (cmd_ln_boolean_r(config, "-adcin")) {

        if (ef != -1) {
            ef = (int32)((ef - sf)
                         * (cmd_ln_float32_r(config, "-samprate")
                            / cmd_ln_int32_r(config, "-frate"))
                         + (cmd_ln_float32_r(config, "-samprate")
                            * cmd_ln_float32_r(config, "-wlen")));
        }
        sf = (int32)(sf
                     * (cmd_ln_float32_r(config, "-samprate")
                        / cmd_ln_int32_r(config, "-frate")));
        fseek(infh, cmd_ln_int32_r(config, "-adchdr") + sf * sizeof(int16), SEEK_SET);
        ps_decode_raw(ps, infh, ef);
    }
    

    If my input file is .wav file, can I set -adcin yes ?

    Thank you.

     
    • Nickolay V. Shmyrev

      Yes, if the wav file has proper format - 16khz 16bit mono signed. You need to properly specify header size with -adchdr 44. There might be exceptions with wav files with different size of the header, but they are not common.

       

Log in to post a comment.