Commit c043e178 authored by ckehoe's avatar ckehoe Committed by Commit bot

Fixing mono/stereo crash

BUG=467216

Review URL: https://codereview.chromium.org/1020683002

Cr-Commit-Position: refs/heads/master@{#321245}
parent 915a2504
......@@ -175,7 +175,7 @@ void AudioRecorderImpl::OnData(media::AudioInputStream* stream,
// Buffer full, send it for processing.
if (buffer_->frames() == buffer_frame_index_) {
ProcessSamples(buffer_.Pass(), decode_callback_);
buffer_ = media::AudioBus::Create(kDefaultChannels, total_buffer_frames_);
buffer_ = media::AudioBus::Create(source->channels(), total_buffer_frames_);
buffer_frame_index_ = 0;
// Copy any remaining frames in the source to our buffer.
......
......@@ -10,7 +10,6 @@ const int kDefaultRepetitions = 5;
const float kDefaultSampleRate = 48000.0f;
const int kDefaultBitsPerSample = 16;
const float kDefaultCarrierFrequency = 18500.0f;
const int kDefaultChannels = 2;
const media::ChannelLayout kDefaultChannelLayout = media::CHANNEL_LAYOUT_STEREO;
} // namespace audio_modem
......@@ -25,9 +25,8 @@ extern const float kDefaultSampleRate;
extern const int kDefaultBitsPerSample;
extern const float kDefaultCarrierFrequency;
// The next two really need to be configurable since they don't need to be
// consistent across platforms, or even playing/recording.
extern const int kDefaultChannels;
// This really needs to be configurable since it doesn't need
// to be consistent across platforms, or even playing/recording.
extern const media::ChannelLayout kDefaultChannelLayout;
// Enum to represent the audio band (audible vs. ultrasound).
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment