Coder Social home page Coder Social logo

Comments (2)

wiseman avatar wiseman commented on August 21, 2024

webrtc's VAD only works with frames that are 10 ms, 20 ms or 30 ms long. The sample rate must be 8000, 16000, 32000 or 48000 Hz. The sample width must be 16 bits. Data that does not fit these restrictions will cause an error.

The line of code you reference is calculating the number of bytes in a frame. E.g. 10 ms of audio recorded at 16000 samples/second, where each sample is 2 bytes (that's there the * 2 comes from) would be 16000 * (10 / 1000.0) * 2 = 320 bytes.

So the only way you can change the frame_length is by changing the frame duration (10, 20 or 30 ms) or sample rate (8000, 16000, 32000, or 48000).

I'm not sure what you mean by frame_shift. duration in that function is really just the frame width in seconds instead of milliseconds.

from py-webrtcvad.

sxqqslf avatar sxqqslf commented on August 21, 2024

@wiseman frame_shift means the shift between two adjacent frames, e.g. the length of frame is 20ms, and the first frame is from 15ms to 35ms, if the frame_shift is 8ms, then the next frame is from 23ms to 43ms, why do this? Because the wave signal is consecutive, we want to keep the continuity of the original signal and be smooth. So I also wonder why webrtc does's not consider this parameter, thanks!

from py-webrtcvad.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.