Bug 1659244 - Remove audibility code from AudioSegment and AudioBlock. r=pehrsons

Same rationale as for AudioData, the audibility is best computed externally.

Differential Revision: https://phabricator.services.mozilla.com/D90432
This commit is contained in:
Paul Adenot 2020-09-23 11:46:54 +00:00
Родитель 55b9625c87
Коммит 718b5288e8
2 изменённых файлов: 0 добавлений и 18 удалений

Просмотреть файл

@ -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<const AudioDataValue*>(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);
}

Просмотреть файл

@ -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;