Closed Bug 927852 Opened 7 years ago Closed 7 years ago
don't use Moz Audio API in the Gaia Tone
Player (dialer and system/emergency-call)
The Moz Audio API is deprecated and we should use Web Audio instead. We are about to drop Moz Audio API so we should replace this for 1.3. apps/communications/dialer/js/keypad.js: this._audio.mozSetup(1, this._sampleRate); apps/system/emergency-call/js/keypad.js: this._audio.mozSetup(2, this._sampleRate);
Summary: don't use Moz Audio API → don't use Moz Audio API in the Gaia TonePlayer (dialer and system/emergency-call)
An old WIP patch can be found here: https://github.com/etiennesegonzac/gaia/compare/web-audio-tone-player
Something like this? Tested locally on desktop, not on actual phone hardware.
Attachment #821455 - Flags: feedback?(etienne)
Assignee: nobody → etienne
Target Milestone: --- → 1.3 Sprint 4 - 11/8
(In reply to Matthew Gregan [:kinetik] from comment #2) > Created attachment 821455 [details] [diff] [review] > bug927852_v0.patch > > Something like this? Well yes, something *exactly* like this :) Taking the liberty to assign this to you since it's pretty much done here.
Assignee: etienne → kinetik
Comment on attachment 821455 [details] [diff] [review] bug927852_v0.patch * bug 922569 should introduce some unit-test coverage for the TonePlayer, which would help with adding some here * it's probably a good time to put the TonePlayer in shared/ and have a little bit less duplication between the dialer and the system app But those 2 things could be filed as follow up bug, depends on how much time you have :)
Attachment #821455 - Flags: feedback?(etienne) → feedback+
Thanks Etienne, I've put a pull request up: https://github.com/mozilla-b2g/gaia/pull/13245 I don't have much time to spend on this (just want to kill the old audio API as soon as possible), so I'll leave your excellent suggestions for a followup bug.
Follow up bug 933278 is open for the unit-tests.
Comment on attachment 824973 [details] [review] fix r=me with a small nit: the kShortPressDuration is 0.25 in the emergency call keypad, and 0.3 in the dialer. We should probably use the same value in both places (I like the result better with 0.25 fwiw).
Attachment #824973 - Flags: review?(etienne) → review+
(In reply to Etienne Segonzac (:etienne) from comment #8) > the kShortPressDuration is 0.25 in the emergency call keypad, and 0.3 in the > dialer. > > We should probably use the same value in both places (I like the result > better with 0.25 fwiw). That's what the original code had, so I kept it, but it makes sense to standardize on something. I pushed a small followup that uses 0.25 everywhere. I think this is ready to be merged now. Since the pull request is already active, is there anything else I need to do?
(In reply to Matthew Gregan [:kinetik] from comment #9) > I think this is ready to be merged now. Since the pull request is already > active, is there anything else I need to do? Can you squash the commits into one? Thanks, then it's ready to merge.
(In reply to Etienne Segonzac (:etienne) from comment #10) > Can you squash the commits into one? Thanks, then it's ready to merge. Thanks, done!
Is there an updated pull request? I don't see a merge option on that one.
Comment on attachment 824973 [details] [review] fix Weird, maybe it's because I did a fixup + rebase and pushed? Or because Travis-CI is horked? It updated the pull request with the correct commits... Anyway, I closed that and opened a new one: https://github.com/mozilla-b2g/gaia/pull/13450
Attachment #824973 - Attachment is obsolete: true
FYI, I landed the patch to disable the Audio Data API (bug 927245) on mozilla-inbound just now, so you'll need to merge this to have a working dialer.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.