blob: 6c6f808a32012f9884c2e896e77cad2e9cef7bcd [file] [log] [blame]
Anders Carlsson7bca8ca2018-08-30 07:30:291/*
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;
Anders Carlsson7bca8ca2018-08-30 07:30:2920RTC_EXTERN const double kRTCAudioSessionHighPerformanceIOBufferDuration;
Anders Carlsson7bca8ca2018-08-30 07:30:2921
22// Struct to hold configuration values.
Mirko Bonadeie8d57242018-09-17 08:22:5623RTC_OBJC_EXPORT
Mirko Bonadeia81e9c82020-05-04 14:14:3224@interface RTC_OBJC_TYPE (RTCAudioSessionConfiguration) : NSObject
Anders Carlsson7bca8ca2018-08-30 07:30:2925
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 Bonadeia81e9c82020-05-04 14:14:3242+ (void)setWebRTCConfiguration:(RTC_OBJC_TYPE(RTCAudioSessionConfiguration) *)configuration;
Anders Carlsson7bca8ca2018-08-30 07:30:2943
44@end
45
46NS_ASSUME_NONNULL_END