beep icon indicating copy to clipboard operation
beep copied to clipboard

Can I change the SampleRate at runtime?

Open hankeyyh opened this issue 1 year ago • 2 comments

hankeyyh avatar Jul 27 '24 07:07 hankeyyh

This project is maintained at https://github.com/gopxl/beep, please direct all future inquiries there.

If you're asking about changing the speaker sample rate after it's been started; no.

For other streamers (decoded from a file or others) it doesn't really make sense to change the sample rate mid stream as they're encoded with a specific sample rate.

If you need to play a piece of audio at a certain different sample rate, then you'll need to resample the audio while playing (or offline for better performance). Beep provides a resampler

dusk125 avatar Jul 30 '24 02:07 dusk125

This project is maintained at https://github.com/gopxl/beep, please direct all future inquiries there.

If you're asking about changing the speaker sample rate after it's been started; no.

For other streamers (decoded from a file or others) it doesn't really make sense to change the sample rate mid stream as they're encoded with a specific sample rate.

If you need to play a piece of audio at a certain different sample rate, then you'll need to resample the audio while playing (or offline for better performance). Beep provides a resampler

dusk125 avatar Jul 30 '24 02:07 dusk125