Understanding Recording Time equation

HARK FORUM Understanding Recording Time equation

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1097
    Noel
    Participant

      I am developing a silence detection application. I am in the middle of understanding the formula for AudiostreamFromMic as specified in the Cookbook:

      Recording time = (LENGTH + (number of frames - 1) * ADVANCE)/SAMPLING RATE

      Questions:
      1. Why is the LENGTH and ADVANCE set to 512 and 160, respectively? Can it be set arbitrarily or there is some basis for the defaults?
      2. Any source material for the equation? I am trying to find the equation in DSP books or online materials to understand the meaning of the numbers.
      3. I am also exploring PyAudio and other Python audio libraries to replicate audio recording. Normally, the CHUNK / FRAME size is set to 1024. How is it different with 512 / 160 values?

      My goal is to record audio only when there is a noise (i.e., if the power value / RMS value is more than certain threshold). Then, stop recording when the power value / RMS value is lower than the threshold. Any advice in doing this in HARK

      #1104
      nterakado
      Moderator

        Thank you for your inquiry.

        We will answer to the following.

        1.
        Yes, you can set arbitrarily.
        But sample network files and transfer functions are based on 512 / 160 settings.

        The value for LENGTH is derived by:
        32 ms = 0.032 seconds
        16000 Hz * 0.032 seconds = 512

        The value for ADVANCE is derived by:
        10 ms = 0.01 seconds
        16000 Hz * 0.01 seconds = 160

        Why use the values 32ms and 10ms?
        In, https://www.hark.jp/document/3.0.0/hark-document-en/subsec-AudioStreamFromWave.html – see “Rough indication of parameters”.

        2.
        A brief description is in the cookbook.
        https://www.hark.jp/document/hark-cookbook-en/subsec-Others-001.html

        It is another inquiry, but the explanation document about the frame is in the following.
        https://wp.hark.jp/wp-content/uploads/2019/04/frames_revised.png

        3.
        For the same reason as the second answer.

        Best regards,
        HARK Support Team

      Viewing 2 posts - 1 through 2 (of 2 total)
      • You must be logged in to reply to this topic.