How to get the device sample rate at startup?

Hello,

Is there a way to know the sample rate of the device besides AudioSource.prepareToPlay(int samplesPerBlockExpected, double sampleRate) ?

I’d like to know it at app startup.

Thanks!

There‘s no way to know - prepareToPlay is where it‘s at.

1 Like

It’s not possible to know, really. Users expect to be able to connect/disconnect devices as the app is running (e.g. connecting bluetooth headphones, or a USB audio interface), and this might cause the sampling rate to change.

1 Like

OK, good to know.
Thanks!