Github-Arduino/libraries/ideawu_RTC/multimedia/webrtc/modules/audio_device/ios/audio_device_ios.cc
int32_t AudioDeviceIPhone::SetLoudspeakerStatus(bool enable) {
    WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
                 "AudioDeviceIPhone::SetLoudspeakerStatus(enable=%d)", enable);

    UInt32 doChangeDefaultRoute = enable ? 1 : 0;
    OSStatus err = AudioSessionSetProperty(
        kAudioSessionProperty_OverrideCategoryDefaultToSpeaker,
        sizeof(doChangeDefaultRoute), &doChangeDefaultRoute);

    if (err != noErr) {
        WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id,
            "Error changing default output route " \
            "(only available on iOS 3.1 or later)");
        return -1;
    }

    return 0;
}
// ----------------------------------------------------------------------------
//  SetLoudspeakerStatus
//
//  Overrides the receiver playout route to speaker instead. See
//  kAudioSessionProperty_OverrideCategoryDefaultToSpeaker in CoreAudio
//  documentation.
// ----------------------------------------------------------------------------
SetLoudspeakerStatus
Overrides the receiver playout route to speaker instead.
SetLoudspeakerStatus Overrides the receiver playout route to speaker instead .
int32_t AudioDeviceIPhone::SetLoudspeakerStatus(bool enable) {
    WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
                 "AudioDeviceIPhone::SetLoudspeakerStatus(enable=%d)", enable);
    UInt32 doChangeDefaultRoute = enable ? 1 : 0;
    OSStatus err = AudioSessionSetProperty(
        kAudioSessionProperty_OverrideCategoryDefaultToSpeaker,
        sizeof(doChangeDefaultRoute), &doChangeDefaultRoute);
    if (err != noErr) {
        WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id,
            "Error changing default output route " \
            "(only available on iOS 3.1 or later)");
        return -1;
    }
    return 0;
}
int32_t AudioDeviceIPhone :: SetLoudspeakerStatus ( bool enable ) { WEBRTC_TRACE ( kTraceInfo , kTraceAudioDevice , _id , " " , enable ) ; UInt32 doChangeDefaultRoute = enable ? 1 : 0 ; OSStatus err = AudioSessionSetProperty ( kAudioSessionProperty_OverrideCategoryDefaultToSpeaker , sizeof ( doChangeDefaultRoute ) , & doChangeDefaultRoute ) ; if ( err != noErr ) { WEBRTC_TRACE ( kTraceError , kTraceAudioDevice , _id , " " " " ) ; return -1 ; } return 0 ; }
SetLoudspeakerStatus
Overrides the receiver playout route to speaker instead.
SetLoudspeakerStatus Overrides the receiver playout route to speaker instead .