-
Notifications
You must be signed in to change notification settings - Fork 166
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
Mandate a useful accepted sampling rate ranges for buffers created through AudioContext.createBuffer #119
Comments
Paul Adenot brought up a very good point in https://bugzilla.mozilla.org/show_bug.cgi?id=849230#c1. We should consider setting the minimum sample rate value to 8000Hz. |
Also, the spec doesn't specify what needs to happen if the sample rate is not accepted, as usual. ;) WebKit throws DOM_SYNTAX_ERR, I'm going to modify Gecko to do the same. We should spec this. |
96 kHz is an odd limit, considering the fad for material at 192 kHz. I think the allowed range should be either 8-48 kHz or 8-192 kHz. |
(In reply to comment #3)
8-192 KHz sounds good to me |
(In reply to comment #4)
Sounds good to me too! |
"At least" should not be confused with "limited to". These are totally different things. Current spec says "must", not "should": "An implementation must support sample-rates in at least the range 22050 to 96000." That does require that the range of sample rates must be supported, but does not prevent implementations from supporting more wide range if they want / need / are able to. There is no sense to limit sample-rate range unless there are corresponding technical limitations in a specific implementation. This is completely out of the spec scope. |
The spec currently says two things:
Looking at the discussion so far, I think the spec should say something like:
is DOM_SYNTAX_ERR the best exception though? |
(In reply to comment #7)
That sounds fine.
Not really. The best exception for this kind of error would be INDEX_SIZE_ERR, I think, since that is supposed to be used for out of range arguments http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-17189187. |
Seeing as we seem to have consensus on the solution, I am setting the issue as ASSIGNED (to CRogers - although others are welcome to send a patch to the source of the spec in dvcs.w3.org). |
Created attachment 1336 [details] Does this look good? |
Created attachment 1337 [details] Actually this is probably better! |
(In reply to comment #11)
Ehsan, we discussed this - good to go, please push to the repo. |
Fix pushed to the refactored branch, here: padenot@efcd0e0, this had never been pushed to the spec. |
Looks good. Closing. |
Currently, the spec just suggests that implementations should at least accept sampling rate ranges of 22050-96000. I think it would be better to mandate this range as opposed to just suggest it, since otherwise it would be possible to write code which works in one UA and not the other.
Also, sampling rates outside of this range probably don't make much sense anyway.
The text was updated successfully, but these errors were encountered: