-
Notifications
You must be signed in to change notification settings - Fork 167
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
Make decodeAudioData more precise #1563
Comments
We're in the process of upstreaming tests from the various UAs into web-platform-tests, I don't now where we're at right now, but there certainly will be tests. |
Chrome has basically skipped upstreaming the decoder tests. I think the only thing that might really be cross-platform would be decoding 16-bit PCM WAV files. We could probably move the couple of tests that we have for this. |
Do you mean we should probably reference https://mimesniff.spec.whatwg.org/#audio-or-video-type-pattern-matching-algorithm ? |
Yeah, I guess. Whatever matches implementations. (That's also why I'm interested in tests, I wonder if this is specified properly.) |
Chrome lets ffmpeg do all the sniffing. I don't know how that relates to the mimesniff algorithm, but it must be somewhat similar. Chrome has no explicit tests on sniffing; we only check that the decoded file matches what we thought it should be. |
@rtoy - Does that mean a web server cannot reliably sniff audio content without calling into ffmpeg ? Because without any algorithm it is not possible to reliably do mime sniffing. Context: |
@agnivade: Don't have anything really to add. Mime sniffing is just a heuristic anyway, right? |
Sure, that maybe. But there are major differences between the mime sniffing algorithm in https://mimesniff.spec.whatwg.org/#signature-for-mp3-without-id3 and the actual algorithm used by mozilla We should fix that. I tried to implement what was in mimesniff and it failed for every possible mp3 out there. I don't believe that should be the case. |
It's not exactly a heuristic. It determines whether or not a byte stream can be played back and needs to be interoperable across implementations. |
This explicitely refers to the algorithm to use in mimesniff, and adjusts the algorithm structure to be able to not attempt to decode if the mimesniff algorithm failed. This fixes WebAudio#1563.
* Make decodeAudioData more precise. This explicitely refers to the algorithm to use in mimesniff, and adjusts the algorithm structure to be able to not attempt to decode if the mimesniff algorithm failed. This fixes #1563. * Address review comments. * address more review comments
* Make decodeAudioData more precise. This explicitely refers to the algorithm to use in mimesniff, and adjusts the algorithm structure to be able to not attempt to decode if the mimesniff algorithm failed. This fixes WebAudio#1563. * Address review comments. * address more review comments
This comment was marked as off-topic.
This comment was marked as off-topic.
I'm not sure that #1781 sufficiently addressed this. For starters, it's pointing to the wrong mimesniff algorithm. The rules for sniffing audio and video specifically are what is intended to be used for sniffing in an audio or video context (such as Secondly, the spec for decodeAudioData() still contains:
Which I believe is what @annevk was referring to as vague. |
It would be nice if https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-decodeaudiodata invoked an algorithm in MIME Sniffing rather than just referencing the whole standard. It would also be good to say which return values are accepted/rejected.
Are there tests for this method?
The text was updated successfully, but these errors were encountered: