diff --git a/dom/media/AudioSegment.h b/dom/media/AudioSegment.h index 1d8b4920d574..6878509939c1 100644 --- a/dom/media/AudioSegment.h +++ b/dom/media/AudioSegment.h @@ -208,23 +208,6 @@ struct AudioChunk { bool IsMuted() const { return mVolume == 0.0f; } - bool IsAudible() const { - for (auto&& channel : mChannelData) { - // Transform sound into dB RMS and assume that the value smaller than -100 - // is inaudible. - float dbrms = 0.0; - for (uint32_t idx = 0; idx < mDuration; idx++) { - dbrms += std::pow(static_cast(channel)[idx], 2); - } - dbrms /= mDuration; - dbrms = std::sqrt(dbrms) != 0.0 ? 20 * log10(dbrms) : -1000.0; - if (dbrms > -100.0) { - return true; - } - } - return false; - } - size_t SizeOfExcludingThisIfUnshared(MallocSizeOf aMallocSizeOf) const { return SizeOfExcludingThis(aMallocSizeOf, true); } diff --git a/dom/media/webaudio/AudioBlock.h b/dom/media/webaudio/AudioBlock.h index abf55ae08e16..b5178c9d8a37 100644 --- a/dom/media/webaudio/AudioBlock.h +++ b/dom/media/webaudio/AudioBlock.h @@ -38,7 +38,6 @@ class AudioBlock : private AudioChunk { using AudioChunk::ChannelCount; using AudioChunk::ChannelData; using AudioChunk::GetDuration; - using AudioChunk::IsAudible; using AudioChunk::IsNull; using AudioChunk::SizeOfExcludingThis; using AudioChunk::SizeOfExcludingThisIfUnshared;