-
Notifications
You must be signed in to change notification settings - Fork 527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Dynamic Sample Rate Detection for Audio Compatibility #7
base: main
Are you sure you want to change the base?
Conversation
… dynamic sample rate detection. Detect the system's default sample rate dynamically instead of hardcoding it to 24000 Hz, especially since Firefox is more sensitive to sample rate discrepancies.
Use the system's default sample rate when creating the audio context. This ensures that if no specific sample rate is provided, it will default to the system's preferred sample rate.
Use the system's sample rate as the default if none is provided.
For the Realtime API we need a 24,000 Hz sample rate. Do you think there's another solution to this problem? This is Firefox only, correct? |
@khorwood-openai From my brief testing this happens on Firefox and not Safari. |
Ah, I see. I think there might be a way around this but I'm not sure. I'll report back in a few minutes. |
Working on a resample audio to 24,000 Hz solution to this pull request, should be updating this shortly |
Ok, I think resampling should be working, just improving a bit on the resampling efficiency. Once I get the resampling efficient I'll update the PR. |
@khorwood-openai I've added resampling to this pull request, it should be good to review now. |
@khorwood-openai any updates on this? This fixes issue #5 |
On Firefox, we get the issue:
Here is the explanation to this fix:
Connecting AudioNodes from AudioContexts with different sample-rate is currently not supported.
These are the changes needed to ensure your application works seamlessly with the system's default audio configuration without causing issues, particularly in Firefox.