Skip to content

Conversation

joeybones
Copy link

Issue/Feature

This PR addresses unhandled promise rejections that occur when AudioContext.resume() fails in restrictive environments like mobile webviews, throwing the error "InvalidStateError: Failed to start the audio device".

Related Issues

Fixes #1743

Solution

Added .catch() handler to ctx.resume() to handle resume failures
Added a new resumeerror event that applications can listen to for error handling

Reproduction/Testing

Breaking Changes

No breaking changes. The new resumeerror event is additive. ctx.resume() failures now catch unhandled promise rejections. There are no API changes

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

Successfully merging this pull request may close these issues.

Error: Unhandled Promise Rejection: InvalidStateError: Failed to start the audio device - interrupted context state -
1 participant