SamuelScheit / puppeteer-stream

A Library for puppeteer to retrieve audio and/or video streams
MIT License
333 stars 105 forks source link

How do I set or determine the sample rate for an audio stream? #71

Closed darloski closed 1 year ago

darloski commented 1 year ago

I am trying to set or determine the sample rate for the audio stream being captured but have no idea. Where or how can I determine that value?

thanks

SamuelScheit commented 1 year ago

You can specify all MediaRecorder and tabCapture options. Install the latest version:

npm i puppeteer-stream@latest

To set the audio sample rate:

getStream(page, {
    audioConstraints: {
        mandatory: {
            sampleRate: { exact: 48000 }
        }
    }
})