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
[Web Audio] Added Audio API tests: MediaElementAudioSource interface #396
Conversation
amitayd
commented
Oct 31, 2013
- Test with source output to OfflineAudioContext
- Test with source output to ScriptProcessor
- Added trimEmptyElements() to helpers.js
Critic review: https://critic.hoppipolla.co.uk/r/386 This is an external review system which you may optionally use for the code review of your pull request. |
Needs review (possibly by @chrislo)
Thanks, |
Yep, I'll take a look at this. Might take me a few days, but I'll get back to you. Thanks for the PR! |
Great, whenever you have the time. |
zero-valued elements | ||
*/ | ||
function trimEmptyElements(array) { | ||
var start = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I see why this function is required - it's because calling play
on an audio element doesn't happen at a predictable time?
In the case of these tests I think it's required, but we should be careful not to use this function as a crutch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, couldn't get enough precision (per sample) with the media events such as play. Would be happy to get rid of this function, but couldn't find a better way to compare the actual play/stop of the media.
This looks really good, thank you. I've made a few comments, but primarily
I really appreciate your contribution, thank you. |
Thanks for the comments! will work on that and update the pull request. Regarding the first main issue:
As I wrote in my notes:
Also asked it in the public-audio list. How should a real-time streaming source behave in regards to an offlineAudioContext rendering? I'm probably missing it in the spec, but could you point that out for me? thanks, |
* Test with source output to OfflineAudioContext * Test with source output to ScriptProcessor * Added trimEmptyElements() to helpers.js * Added a white noise wave file generator in utilities dir
Updated the pull request with a new commit. Addressed the following issues:
I didn't remove the test based on ScriptProcessor, as it exposes other failures in the implementations (compared to the OfflineAudioContext test). For example, in that test under Chrome, the scriptProcessor gets some additional data, not from the wave file, in its processaudio event input buffer. If you'd insist, of course I can remove that test, but I'm not sure why wouldn't we want to have as much tests as possible, especially when its demonstrated that those test results are not redundant. Thanks, |
@chrislo |
@amitayd there was some discussion about whether offlineAudioContext should even allow the creation of mediaElementAudioSource node and the streaming source and destination nodes. I've re-raised that discussion on the mailing list. Thank you for bringing it to our attention again! In the meantime, I'll add the ScriptProcessor based test you wrote to the test suite. |
Merging the changes from #396 with some cleaning up and code review.
Merged into master, thank you. |