1 /* 2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. 3 * 4 * Use of this source code is governed by a BSD-style license 5 * that can be found in the LICENSE file in the root of the source 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 #import <AVFoundation/AVFoundation.h> 12 #import <Foundation/Foundation.h> 13 14 #import "RTCMacros.h" 15 16 NS_ASSUME_NONNULL_BEGIN 17 18 RTC_EXTERN const int kRTCAudioSessionPreferredNumberOfChannels; 19 RTC_EXTERN const double kRTCAudioSessionHighPerformanceSampleRate; 20 RTC_EXTERN const double kRTCAudioSessionLowComplexitySampleRate; 21 RTC_EXTERN const double kRTCAudioSessionHighPerformanceIOBufferDuration; 22 RTC_EXTERN const double kRTCAudioSessionLowComplexityIOBufferDuration; 23 24 // Struct to hold configuration values. 25 RTC_OBJC_EXPORT 26 @interface RTC_OBJC_TYPE (RTCAudioSessionConfiguration) : NSObject 27 28 @property(nonatomic, strong) NSString *category; 29 @property(nonatomic, assign) AVAudioSessionCategoryOptions categoryOptions; 30 @property(nonatomic, strong) NSString *mode; 31 @property(nonatomic, assign) double sampleRate; 32 @property(nonatomic, assign) NSTimeInterval ioBufferDuration; 33 @property(nonatomic, assign) NSInteger inputNumberOfChannels; 34 @property(nonatomic, assign) NSInteger outputNumberOfChannels; 35 36 /** Initializes configuration to defaults. */ 37 - (instancetype)init NS_DESIGNATED_INITIALIZER; 38 39 /** Returns the current configuration of the audio session. */ 40 + (instancetype)currentConfiguration; 41 /** Returns the configuration that WebRTC needs. */ 42 + (instancetype)webRTCConfiguration; 43 /** Provide a way to override the default configuration. */ 44 + (void)setWebRTCConfiguration:(RTC_OBJC_TYPE(RTCAudioSessionConfiguration) *)configuration; 45 46 @end 47 48 NS_ASSUME_NONNULL_END 49