Skip to content
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

Add mediaRecorderTimeslice option to RecordPluginOptions #3760

Merged
merged 2 commits into from
Jun 21, 2024

Conversation

nizar
Copy link
Contributor

@nizar nizar commented Jun 21, 2024

Short description

On Safari on both Mac and iOs, the audio generated by the record plugin cannot be properly processed by the OpenAI whisper model. This is a known issue that is addressed by passing a timeslice param of 1000 to the mediaRecorder.start() call.

Implementation details

If the optional mediaRecorderTimeslice value is provided to the RecordPlugin initializer, the value is passed to the mediaRecorder.start() call.

How to test it

Pass a value of 1000 when running on any browser on iOS or in Safari on MacOS, recorded audio will be processed by OpenAI whisper. Without this value, only the first second or so of audio is correctly processed.

Screenshots

N/A

Checklist

  • This PR is covered by e2e tests
  • It introduces no breaking API changes
nizar added 2 commits June 8, 2024 10:18
- Add mediaRecorderTimeslice option to RecordPluginOptions to which is passed to mediaRecorder.start().
- Add 'record-data-available' event which returns the blob that is delivered by the mediaRecorder and only that blob
Copy link
Owner

@katspaugh katspaugh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@katspaugh katspaugh merged commit 13cc442 into katspaugh:main Jun 21, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants