diff --git a/dom/media/webaudio/AnalyserNode.cpp b/dom/media/webaudio/AnalyserNode.cpp index dcbc1a645b7d..9cd1808d3df4 100644 --- a/dom/media/webaudio/AnalyserNode.cpp +++ b/dom/media/webaudio/AnalyserNode.cpp @@ -245,7 +245,9 @@ AnalyserNode::GetFloatFrequencyData(const Float32Array& aArray) size_t length = std::min(size_t(aArray.Length()), mOutputBuffer.Length()); for (size_t i = 0; i < length; ++i) { - buffer[i] = WebAudioUtils::ConvertLinearToDecibels(mOutputBuffer[i], mMinDecibels); + buffer[i] = + WebAudioUtils::ConvertLinearToDecibels(mOutputBuffer[i], + -std::numeric_limits::infinity()); } } diff --git a/dom/media/webaudio/test/mochitest.ini b/dom/media/webaudio/test/mochitest.ini index 8247dddcbb55..12fe71b07b7e 100644 --- a/dom/media/webaudio/test/mochitest.ini +++ b/dom/media/webaudio/test/mochitest.ini @@ -33,6 +33,7 @@ support-files = [test_analyserNodeOutput.html] [test_analyserNodePassThrough.html] [test_analyserNodeWithGain.html] +[test_analyserNodeMinimum.html] [test_AudioBuffer.html] [test_audioBufferSourceNode.html] [test_audioBufferSourceNodeEnded.html] diff --git a/dom/media/webaudio/test/test_analyserNodeMinimum.html b/dom/media/webaudio/test/test_analyserNodeMinimum.html new file mode 100644 index 000000000000..e8a2f64ecb5a --- /dev/null +++ b/dom/media/webaudio/test/test_analyserNodeMinimum.html @@ -0,0 +1,51 @@ + + + + Test AnalyserNode when the input is silent + + + + + +
+
+
+ +