Anders Carlsson | 7bca8ca | 2018-08-30 07:30:29 | [diff] [blame] | 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; |
Anders Carlsson | 7bca8ca | 2018-08-30 07:30:29 | [diff] [blame] | 20 | RTC_EXTERN const double kRTCAudioSessionHighPerformanceIOBufferDuration; |
Anders Carlsson | 7bca8ca | 2018-08-30 07:30:29 | [diff] [blame] | 21 | |
| 22 | // Struct to hold configuration values. |
Mirko Bonadei | e8d5724 | 2018-09-17 08:22:56 | [diff] [blame] | 23 | RTC_OBJC_EXPORT |
Mirko Bonadei | a81e9c8 | 2020-05-04 14:14:32 | [diff] [blame] | 24 | @interface RTC_OBJC_TYPE (RTCAudioSessionConfiguration) : NSObject |
Anders Carlsson | 7bca8ca | 2018-08-30 07:30:29 | [diff] [blame] | 25 | |
| 26 | @property(nonatomic, strong) NSString *category; |
| 27 | @property(nonatomic, assign) AVAudioSessionCategoryOptions categoryOptions; |
| 28 | @property(nonatomic, strong) NSString *mode; |
| 29 | @property(nonatomic, assign) double sampleRate; |
| 30 | @property(nonatomic, assign) NSTimeInterval ioBufferDuration; |
| 31 | @property(nonatomic, assign) NSInteger inputNumberOfChannels; |
| 32 | @property(nonatomic, assign) NSInteger outputNumberOfChannels; |
| 33 | |
| 34 | /** Initializes configuration to defaults. */ |
| 35 | - (instancetype)init NS_DESIGNATED_INITIALIZER; |
| 36 | |
| 37 | /** Returns the current configuration of the audio session. */ |
| 38 | + (instancetype)currentConfiguration; |
| 39 | /** Returns the configuration that WebRTC needs. */ |
| 40 | + (instancetype)webRTCConfiguration; |
| 41 | /** Provide a way to override the default configuration. */ |
Mirko Bonadei | a81e9c8 | 2020-05-04 14:14:32 | [diff] [blame] | 42 | + (void)setWebRTCConfiguration:(RTC_OBJC_TYPE(RTCAudioSessionConfiguration) *)configuration; |
Anders Carlsson | 7bca8ca | 2018-08-30 07:30:29 | [diff] [blame] | 43 | |
| 44 | @end |
| 45 | |
| 46 | NS_ASSUME_NONNULL_END |