blob: 3eb5e3ad79273a81fc978d38124daf2797afc9a2 [file] [log] [blame]
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001/*
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
16NS_ASSUME_NONNULL_BEGIN
17
18RTC_EXTERN const int kRTCAudioSessionPreferredNumberOfChannels;
19RTC_EXTERN const double kRTCAudioSessionHighPerformanceSampleRate;
20RTC_EXTERN const double kRTCAudioSessionLowComplexitySampleRate;
21RTC_EXTERN const double kRTCAudioSessionHighPerformanceIOBufferDuration;
22RTC_EXTERN const double kRTCAudioSessionLowComplexityIOBufferDuration;
23
24// Struct to hold configuration values.
25RTC_EXPORT
26@interface 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:(RTCAudioSessionConfiguration *)configuration;
45
46@end
47
48NS_ASSUME_NONNULL_END