Skip to content

Fix audio frame sample rate #175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: m125_release
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions audio/audio_transport_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,12 @@ int32_t AudioTransportImpl::RecordedDataIsAvailable(
bool swap_stereo_channels = false;
{
MutexLock lock(&capture_lock_);
send_sample_rate_hz = send_sample_rate_hz_;
send_num_channels = send_num_channels_;
bool has_senders = !audio_senders_.empty();
// If no senders attached, use the provided sample rate and channel count to
// initialize the AudioFrame so ProcessCaptureFrame will have correct sample
// rate.
send_sample_rate_hz = has_senders ? send_sample_rate_hz_ : sample_rate;
send_num_channels = has_senders ? send_num_channels_ : number_of_channels;
swap_stereo_channels = swap_stereo_channels_;
}

Expand Down
5 changes: 5 additions & 0 deletions modules/audio_processing/audio_processing_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,11 @@ void AudioProcessingImpl::InitializeLocked(const ProcessingConfig& config) {

formats_.api_format = config;

RTC_LOG(LS_INFO) << "AudioProcessing::InitializeLocked input sampleRate:"
<< formats_.api_format.input_stream().sample_rate_hz()
<< " output sampleRate:"
<< formats_.api_format.output_stream().sample_rate_hz();

// Choose maximum rate to use for the split filtering.
RTC_DCHECK(config_.pipeline.maximum_internal_processing_rate == 48000 ||
config_.pipeline.maximum_internal_processing_rate == 32000);
Expand Down