Closed Bug 927852 Opened 11 years ago Closed 11 years ago

don't use Moz Audio API in the Gaia TonePlayer (dialer and system/emergency-call)

Categories

(Firefox OS Graveyard :: Gaia::Dialer, defect)

x86
macOS
defect
Not set
normal

Tracking

(blocking-b2g:1.3+)

RESOLVED FIXED
1.3 Sprint 4 - 11/8
blocking-b2g 1.3+

People

(Reporter: gal, Assigned: kinetik)

References

Details

Attachments

(1 file, 2 obsolete files)

46 bytes, text/x-github-pull-request
kinetik
: review+
Details | Review
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);
blocking-b2g: --- → 1.3+
Blocks: 927245
Summary: don't use Moz Audio API → don't use Moz Audio API in the Gaia TonePlayer (dialer and system/emergency-call)
Attached patch bug927852_v0.patch (obsolete) — Splinter Review
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.
Attached file fix (obsolete) —
Attachment #821455 - Attachment is obsolete: true
Attachment #824973 - Flags: review?(etienne)
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?
Attachment #824973 - Attachment is patch: false
Attachment #824973 - Attachment mime type: text/plain → text/x-github-pull-request
(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!
Keywords: checkin-needed
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
Attached file fix
Attachment #828362 - Flags: review+
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.
https://github.com/mozilla-b2g/gaia/commit/add12c96c3e9281baa7f483f7ba751ce63df5749
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Thanks!
Depends on: 942751
Depends on: 943138
Depends on: 961986
Depends on: 963220
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: