2018-05-15 10:22:36 +02:00
|
|
|
/*
|
|
|
|
|
* Copyright 2018 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "audio_device_module.h"
|
|
|
|
|
|
2022-06-14 15:48:26 +02:00
|
|
|
#include "api/make_ref_counted.h"
|
2018-05-15 10:22:36 +02:00
|
|
|
#include "rtc_base/logging.h"
|
|
|
|
|
|
2018-08-30 09:30:29 +02:00
|
|
|
#include "sdk/objc/native/src/audio/audio_device_module_ios.h"
|
2018-05-15 10:22:36 +02:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
|
2025-01-08 05:55:05 -08:00
|
|
|
rtc::scoped_refptr<AudioDeviceModule> CreateAudioDeviceModule(
|
|
|
|
|
bool bypass_voice_processing) {
|
2021-11-04 12:01:23 +00:00
|
|
|
RTC_DLOG(LS_INFO) << __FUNCTION__;
|
2018-05-15 10:22:36 +02:00
|
|
|
#if defined(WEBRTC_IOS)
|
2025-01-08 05:55:05 -08:00
|
|
|
return rtc::make_ref_counted<ios_adm::AudioDeviceModuleIOS>(
|
2025-01-21 14:54:51 +01:00
|
|
|
bypass_voice_processing,
|
|
|
|
|
/*muted_speech_event_handler=*/nullptr,
|
|
|
|
|
/*error_handler=*/nullptr);
|
2024-07-18 23:14:45 +02:00
|
|
|
#else
|
2025-01-08 05:55:05 -08:00
|
|
|
RTC_LOG(LS_ERROR)
|
|
|
|
|
<< "current platform is not supported => this module will self destruct!";
|
2024-07-18 23:14:45 +02:00
|
|
|
return nullptr;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rtc::scoped_refptr<AudioDeviceModule> CreateMutedDetectAudioDeviceModule(
|
2025-01-21 14:54:51 +01:00
|
|
|
AudioDeviceModule::MutedSpeechEventHandler muted_speech_event_handler,
|
|
|
|
|
bool bypass_voice_processing) {
|
|
|
|
|
RTC_DLOG(LS_INFO) << __FUNCTION__;
|
|
|
|
|
return CreateMutedDetectAudioDeviceModule(muted_speech_event_handler,
|
|
|
|
|
/*error_handler=*/nullptr,
|
|
|
|
|
bypass_voice_processing);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rtc::scoped_refptr<AudioDeviceModule> CreateMutedDetectAudioDeviceModule(
|
|
|
|
|
AudioDeviceModule::MutedSpeechEventHandler muted_speech_event_handler,
|
|
|
|
|
ADMErrorHandler error_handler,
|
2025-01-08 05:55:05 -08:00
|
|
|
bool bypass_voice_processing) {
|
2024-07-18 23:14:45 +02:00
|
|
|
RTC_DLOG(LS_INFO) << __FUNCTION__;
|
|
|
|
|
#if defined(WEBRTC_IOS)
|
2025-01-08 05:55:05 -08:00
|
|
|
return rtc::make_ref_counted<ios_adm::AudioDeviceModuleIOS>(
|
2025-01-21 14:54:51 +01:00
|
|
|
bypass_voice_processing, muted_speech_event_handler, error_handler);
|
2018-05-15 10:22:36 +02:00
|
|
|
#else
|
2025-01-08 05:55:05 -08:00
|
|
|
RTC_LOG(LS_ERROR)
|
|
|
|
|
<< "current platform is not supported => this module will self destruct!";
|
2018-05-15 10:22:36 +02:00
|
|
|
return nullptr;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
2025-01-08 05:55:05 -08:00
|
|
|
} // namespace webrtc
|