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

Latency while recording #133

Open
bengyles opened this issue Sep 30, 2020 · 3 comments
Open

Latency while recording #133

bengyles opened this issue Sep 30, 2020 · 3 comments

Comments

@bengyles
Copy link

First of all I really like this library, great job! It has so many features just out of the box! :)

I'm using this library to basically record over a loop and be able to play it and download it, which is working fine but there is one problem: there appears to be a latency on the microphone (approximately 175ms on a desktop and more on mobile). Do you have any idea how I can tackle this problem? I was thinking about adding a slight delay to the loop after recording, so basically change the track.start property but that didn't seem to work.

Also I noticed that the recording and download part are not working on IOS devices since they don't support web audio, do you plan to support those in the future or will that not be possible? It seems to me that Apple didn't implement the webaudio standard and choose to support webrtc instead.

@naomiaro
Copy link
Owner

Webaudio is supported on iOS and Safari, the recorder uses the MediaRecorder API. It seems this API is still behind a flag which needs to be turned on by the user to be able to use it. I didn't realise it was still so experimental there.

https://www.educative.io/edpresso/how-to-enable-the-mediarecorder-api-for-safari

There seems to be another issue after enabling it though atm, I'll have to look into that.

I'm not really sure how to deal with the latency issue. You can always line up the tracks afterwards using the shift state. That's how other people are doing similar things that I know of at the moment.

@naomiaro
Copy link
Owner

naomiaro commented Apr 25, 2021

Seems the API is a bit more limited for Safari, if this is still up to date

https://blog.addpipe.com/safari-technology-preview-73-adds-limited-mediastream-recorder-api-support/

The recording in slices/chunks seems to be the issue atm hmm. It wouldn't be possible to get a live updating waveform with Safari I think at this point in time. Maybe through a workaround perhaps.

@naomiaro
Copy link
Owner

Noticing that latency hints are now offered through the webaudio api:

https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/baseLatency

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants