Index: media/audio/audio_parameters.cc |
diff --git a/media/audio/audio_parameters.cc b/media/audio/audio_parameters.cc |
index 5e77c60cb94484a4db36cba14f31c84a994fd3c0..b7ea4870c23c2bf5f6b51c2bfbfaa5279c566ef1 100644 |
--- a/media/audio/audio_parameters.cc |
+++ b/media/audio/audio_parameters.cc |
@@ -89,6 +89,12 @@ int AudioParameters::GetBytesPerFrame() const { |
return channels_ * bits_per_sample_ / 8; |
} |
+base::TimeDelta AudioParameters::GetBufferDuration() const { |
+ return base::TimeDelta::FromMicroseconds( |
+ frames_per_buffer_ * base::Time::kMicrosecondsPerSecond / |
+ static_cast<float>(sample_rate_)); |
+} |
+ |
void AudioParameters::SetDiscreteChannels(int channels) { |
channel_layout_ = CHANNEL_LAYOUT_DISCRETE; |
channels_ = channels; |