Closed
Bug 1118622
Opened 11 years ago
Closed 10 years ago
[Web Audio API] data from analyser getByteTimeDomainData is always full-scaled
Categories
(Core :: Web Audio, defect)
Tracking
()
RESOLVED
FIXED
mozilla39
Tracking | Status | |
---|---|---|
firefox39 | --- | fixed |
People
(Reporter: gaito, Assigned: padenot)
References
Details
Attachments
(1 file)
4.17 KB,
patch
|
ehsan.akhgari
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36
Steps to reproduce:
data retrieved with analyser getByteTimeDomainData() always has full-scaled amplitude (0-255).
test code is here :
---
<script>
var data=new Uint8Array(256);
var actx=new AudioContext();
var osc=actx.createOscillator();
var gain=actx.createGain();
var analyser=actx.createAnalyser();
osc.connect(gain);
gain.connect(analyser);
analyser.connect(actx.destination);
osc.start(0);
setInterval(function(){
analyser.getByteTimeDomainData(data);
var ctx=document.getElementById("canvas").getContext("2d");
ctx.clearRect(0,0,256,256);
for(var i=0;i<256;++i)
ctx.fillRect(i,255,1,-data[i]);
},500);
</script>
<button onclick="gain.gain.value=0">vol=0</button>
<button onclick="gain.gain.value=0.1">vol=0.1</button>
<button onclick="gain.gain.value=1">vol=1</button><br/>
<canvas id="canvas" width="256" height="256"></canvas>
---
1) access to
http://www.g200kg.com/demo/test/test-analysertimedomain.html
2) press 'vol' buttons and check the waveform amplitude
Actual results:
waveform amplitude is always full-scaled even switch volume, and it is not updated if vol=0
Expected results:
waveform amplitude should be changed according to current vol setting.
Assignee | ||
Comment 1•10 years ago
|
||
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → padenot
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Assignee | ||
Comment 2•10 years ago
|
||
Comment on attachment 8556533 [details] [diff] [review]
Apply the gain to AnalyserNode data prior to sending on the main thread. r=
I chose to do most of the work on the audio thread, the main thread is busy enough!
Attachment #8556533 -
Flags: review?(ehsan)
Updated•10 years ago
|
Attachment #8556533 -
Flags: review?(ehsan) → review+
Assignee | ||
Comment 3•10 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
status-firefox39:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
You need to log in
before you can comment on or make changes to this bug.
Description
•