Menu

Maximum Length for Wav File?

Help
2011-06-02
2012-09-22
  • Amin Yazdani

    Amin Yazdani - 2011-06-02

    Hi,

    I was wondering if there is any kind of maximum length for the wave file when
    I'm using pocketsphinx_batch.
    I tried a file which is 5 minutes long and it returned me an error:
    ERROR: "acmod.c", line 862: Circular feature buffer cannot be rewound (output
    frame 0, alloc -30921)

    Then I copy and paste a smaller amount of that wave file into another file, it
    worked OK.

     
  • Nickolay V. Shmyrev

    Yes, there is a limit and in trunk it's configurable

    /**
     * Type for frame index in batch processing. Used in HMM pointers and affects memory.
     * Make it uint16 to save memory.
     */
    typedef int16 frame_idx_t;
    
    /**
     * Maximum number of frames in index, should be in sync with above.
     */
    #define MAX_N_FRAMES MAX_INT16
    
     
  • Amin Yazdani

    Amin Yazdani - 2011-06-08

    So I should make change to that and compile it. Is there anything that might
    goes wrong? I want to make it int32 (double the size)

    Another question, how can I calculate the maximum length in seconds based on
    max int16 (32767) and frequency (16kHz) etc?

     
  • Nickolay V. Shmyrev

    It's not related to frequency but to a frame rate (100Hz). So 32767 frames are
    about 327 seconds or 5 minutes. If you consider MAX_INT32 its 6000 hours.

     
  • Amin Yazdani

    Amin Yazdani - 2011-06-08

    great. I was looking around, but I couldn't find that part.
    Could you please let me know what file contains that configuration code part?

     
  • Nickolay V. Shmyrev

    Sorry, not sure what are you talking about. Frame rate is configured with
    -frate option.

     
  • Amin Yazdani

    Amin Yazdani - 2011-06-08

    :) I want to change int16 to int32 for max_n_frame. How can I do that?

     
  • Nickolay V. Shmyrev

    Find this chunk in a file and change. You can search in a files, don't you?

     
  • Amin Yazdani

    Amin Yazdani - 2011-06-08

    sure I can search in files. The problem is that I can't find it!!

     
  • mehmet

    mehmet - 2011-09-21

    the feature isn't included in the latest build yet. but, you can still set it
    by editing the line:
    int16 frame; /*< Frame in which this HMM was last active; <0 if inactive /

     
  • Fernando Callejón

    Hi there!
    I've changed MAX_N_FRAMES to MAX_INT32 but now i'm getting an assert error at:
    sphinxbase/feat.c --> feat_array_alloc()

    assert(nfr > 0);
    

    Should I need to change something else?

    Thanks!
    Fernando.-
    I also noticed that in pocketsphinx/acmod.c --> acmod_grow_feat_buf nfr it's
    int not int16/32 whould this affect this in any way?

     
  • Nickolay V. Shmyrev

    Hello Fernando

    Should I need to change something else?

    You should also change a typedef for frame_idx_t.

     
  • Fernando Callejón

    never mind
    I've forgot to change frame_idx_t to int32

    cheers!

     
  • Anonymous

    Anonymous - 2011-11-23

    Hi all,

    I am digging into this with Fernando, we got it compiling and working with
    type changed from int16 to int32.
    However, if the file is same as shorter for int16 type it work with the change
    with no problem, but if we use a longer version of the sound file, it start
    getting INFINITE log scale probabilities and make the result usefulness.

    We would appreciate any help on this.
    Thanks in advance.

    Nestor

     
  • Nickolay V. Shmyrev

    Hello Nestor

    First of all please make sure that you are aware of cont_ad API for splitting
    the long audio with VAD

    Second, if you have some issues please provide the test example. I can not
    reproduce your problem right now.

     

Log in to post a comment.