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
Exclusive access to audio hardware #72
Comments
Jer, is this something you still believe is important to consider? I know iOS has been shipping for a little while and didn't know if this was still an issue. |
Yes I believe it is still an issue. It's unfortunate that we weren't able to resolve this prior to iOS 6, but I believe this is still important to resolve for future implementations. |
Updating my proposal: Interface ChangesAudioContextAdd the concept of pausing and resuming to AudioContext.
AlgorithmsAn AudioContext would start in the "playing" state. An audio hardware interruption would move the state from "playing" to "interrupted". When interruption ends, if When the state is "playing", When the state is "interrupted", both When the state is "interrupted" or "paused", the context's Attributes
Methods
|
We'll come back to this later with a more complete proposal. Next version. |
This is no longer an issue now that we have implemented suspend and resume. |
Re-opening this issue. Additionally,
|
AudioWG call:
|
@jernoble Can you clarify the state transitions here? Assuming we're running, the only transitions are running -> interrupted -> running if allowed. And running -> interrupted -> suspended if the interruption is over, but we're not allowed to resume playing? Calling suspend or resume in the interrupted state causes these promises to be rejected? So once we're in the interrupted state, there's no way for the user to get out of that except wait for the OS to finish the interruption? Presumably, we can still call close to close the context in the interrupted state? What happens if we're suspended? Can we transition to interrupted by the OS? Seems like we might want to do that to match what running->interrupted does. I guess that means when the interruption ends, we go back to suspended instead of resuming? Or maybe we don't go to interrupted state. When the user resumes(), we immediately go to interrupted if the OS says we were interrupted? Then the rest of the behavior is defined by the running->interrupted transitions above. |
Tel;econf: We'll leave this issue as is for discussing exclusive access to audio HW. The discussion about an interrupted state will be filed as a new issue in v2. |
Per #72 (comment), I'm closing this again. Further discussions about the interrupted state will be handled in issue WebAudio/web-audio-api-v2#115 If at some later date we want to support exclusive access to HW, reopen this issue or, better yet, file a new issue for the V2 spec. |
http://www.w3.org/2011/audio/track/issues/15
Raised by: Jer Noble
On product: Web Audio API
On the mailing list, Jer Noble proposed an addition to the WebAudio API which would allow the API to be implemented on platforms which allow exclusive access to audio hardware.
http://lists.w3.org/Archives/Public/public-audio/2012AprJun/0122.html
The proposed changes:
Chris Rogers questioned why the startRendering() method was necessary:
http://lists.w3.org/Archives/Public/public-audio/2012AprJun/0124.html
Jer Noble replied with a use case demonstrating its use:
http://lists.w3.org/Archives/Public/public-audio/2012AprJun/0126.html
The text was updated successfully, but these errors were encountered: