Menu

Location of SpeechStartSignal in wav file

Help
2008-02-17
2012-09-22
  • Chris Deering

    Chris Deering - 2008-02-17

    Hi guys,

    Im having a spot of bother trying to get the time location, in an input wav file, of a SpeechStartSignal in my frontend. I thought I had it figured out but the following gives me (what I assume is) the milliseconds after 1970, or the system up time or something:

    frontend = (FrontEnd)cm.lookup("epFrontEnd");

    frontend.addSignalListener(new SignalListener(){

                 public void signalOccurred(Signal inSig){
    
                     if(inSig instanceof SpeechStartSignal){
    
                         speechStart = inSig.getTime();
                     }
    
                 }
    
             });
    

    speechStart is assigned a value like 1203268250578, which gets larger every time I run it... hence my previous assumption.

    Thats useful if you are doing a live decoding using a mic etc, but as Im doing a batch decode from wav, I cant see how I can use this.
    So, basically what Im trying to get is the offset in time in the wav file where the preprocessor decided that the speech signal begins. Any pointers? Thanks! :D

     
    • Nickolay V. Shmyrev

      Well, it's the system time in milliseconds when buffer is created. I agree it's not very useful, probably we must replace it with the some kind of offset from stream start.

      I also think it's better to use firstSampleNumber property of DataBuffer

       
    • Chris Deering

      Chris Deering - 2008-02-18

      >Well, it's the system time in milliseconds when buffer is created. I agree it's not very useful, probably we must replace it with the some kind of offset from >stream start.
      >
      >I also think it's better to use firstSampleNumber property of DataBuffer

      Hi Nickolay ,

      Thanks for the response and the clarification. Works like a charm! :D

      For reference if anyone else ever meets this problem this is what I did...

      frontend.addSignalListener(new SignalListener(){

                       public void signalOccurred(Signal inSig){
      
                           if(inSig instanceof SpeechStartSignal){
      
                               try{
      
                                   FloatData current =  (FloatData)frontend.getData();
      
      
                                   speechStart = current.getFirstSampleNumber() / sampleRate;
      
      
                               }catch(DataProcessingException e){
      
                                   e.printStackTrace();
                               }
                           }
      
      
                       }
      
                   });
      
       

Log in to post a comment.