Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Unified Diff: media/base/audio_bus.cc

Issue 1195633003: Add a silent audio sink to consume WebAudio data on silence detection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ifdef android only constants Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/audio_bus.h ('k') | media/base/audio_bus_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/audio_bus.cc
diff --git a/media/base/audio_bus.cc b/media/base/audio_bus.cc
index 719dbcd55714c941b5d61f2c13cb56f40269ce2b..2e34f1ebc3f7453b6213e719e7e253ef8e2da49d 100644
--- a/media/base/audio_bus.cc
+++ b/media/base/audio_bus.cc
@@ -218,6 +218,16 @@ void AudioBus::Zero() {
ZeroFrames(frames_);
}
+bool AudioBus::AreFramesZero() const {
+ for (size_t i = 0; i < channel_data_.size(); ++i) {
+ for (int j = 0; j < frames_; ++j) {
+ if (channel_data_[i][j])
+ return false;
+ }
+ }
+ return true;
+}
+
int AudioBus::CalculateMemorySize(const AudioParameters& params) {
return CalculateMemorySizeInternal(
params.channels(), params.frames_per_buffer(), NULL);
« no previous file with comments | « media/base/audio_bus.h ('k') | media/base/audio_bus_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698