Clean up the Config to enable 48kHz support in AudioProcessing
Now 48kHz is enabled by default. BUG=webrtc:3146 Review URL: https://codereview.webrtc.org/1233393003 Cr-Commit-Position: refs/heads/master@{#9643}
This commit is contained in:
parent
ef35f069e7
commit
b3b79b6115
@ -210,8 +210,7 @@ AudioProcessingImpl::AudioProcessingImpl(const Config& config,
|
||||
#endif
|
||||
beamformer_enabled_(config.Get<Beamforming>().enabled),
|
||||
beamformer_(beamformer),
|
||||
array_geometry_(config.Get<Beamforming>().array_geometry),
|
||||
supports_48kHz_(config.Get<AudioProcessing48kHzSupport>().enabled) {
|
||||
array_geometry_(config.Get<Beamforming>().array_geometry) {
|
||||
echo_cancellation_ = new EchoCancellationImpl(this, crit_);
|
||||
component_list_.push_back(echo_cancellation_);
|
||||
|
||||
@ -375,7 +374,7 @@ int AudioProcessingImpl::InitializeLocked(const ProcessingConfig& config) {
|
||||
std::min(api_format_.input_stream().sample_rate_hz(),
|
||||
api_format_.output_stream().sample_rate_hz());
|
||||
int fwd_proc_rate;
|
||||
if (supports_48kHz_ && min_proc_rate > kSampleRate32kHz) {
|
||||
if (min_proc_rate > kSampleRate32kHz) {
|
||||
fwd_proc_rate = kSampleRate48kHz;
|
||||
} else if (min_proc_rate > kSampleRate16kHz) {
|
||||
fwd_proc_rate = kSampleRate32kHz;
|
||||
|
||||
@ -191,8 +191,6 @@ class AudioProcessingImpl : public AudioProcessing {
|
||||
const bool beamformer_enabled_;
|
||||
rtc::scoped_ptr<Beamformer<float>> beamformer_;
|
||||
const std::vector<Point> array_geometry_;
|
||||
|
||||
const bool supports_48kHz_;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -116,15 +116,6 @@ struct Beamforming {
|
||||
const std::vector<Point> array_geometry;
|
||||
};
|
||||
|
||||
// Use to enable 48kHz support in audio processing. Must be provided through the
|
||||
// constructor. It will have no impact if used with
|
||||
// AudioProcessing::SetExtraOptions().
|
||||
struct AudioProcessing48kHzSupport {
|
||||
AudioProcessing48kHzSupport() : enabled(true) {}
|
||||
explicit AudioProcessing48kHzSupport(bool enabled) : enabled(enabled) {}
|
||||
bool enabled;
|
||||
};
|
||||
|
||||
static const int kAudioProcMaxNativeSampleRateHz = 32000;
|
||||
|
||||
// The Audio Processing Module (APM) provides a collection of voice processing
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user