RTCAudioSessionConfiguration.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. #import <AVFoundation/AVFoundation.h>
  11. #import <Foundation/Foundation.h>
  12. #import "RTCMacros.h"
  13. NS_ASSUME_NONNULL_BEGIN
  14. RTC_EXTERN const int kRTCAudioSessionPreferredNumberOfChannels;
  15. RTC_EXTERN const double kRTCAudioSessionHighPerformanceSampleRate;
  16. RTC_EXTERN const double kRTCAudioSessionLowComplexitySampleRate;
  17. RTC_EXTERN const double kRTCAudioSessionHighPerformanceIOBufferDuration;
  18. RTC_EXTERN const double kRTCAudioSessionLowComplexityIOBufferDuration;
  19. // Struct to hold configuration values.
  20. RTC_OBJC_EXPORT
  21. @interface RTC_OBJC_TYPE (RTCAudioSessionConfiguration) : NSObject
  22. @property(nonatomic, strong) NSString *category;
  23. @property(nonatomic, assign) AVAudioSessionCategoryOptions categoryOptions;
  24. @property(nonatomic, strong) NSString *mode;
  25. @property(nonatomic, assign) double sampleRate;
  26. @property(nonatomic, assign) NSTimeInterval ioBufferDuration;
  27. @property(nonatomic, assign) NSInteger inputNumberOfChannels;
  28. @property(nonatomic, assign) NSInteger outputNumberOfChannels;
  29. /** Initializes configuration to defaults. */
  30. - (instancetype)init NS_DESIGNATED_INITIALIZER;
  31. /** Returns the current configuration of the audio session. */
  32. + (instancetype)currentConfiguration;
  33. /** Returns the configuration that WebRTC needs. */
  34. + (instancetype)webRTCConfiguration;
  35. /** Provide a way to override the default configuration. */
  36. + (void)setWebRTCConfiguration:(RTC_OBJC_TYPE(RTCAudioSessionConfiguration) *)configuration;
  37. @end
  38. NS_ASSUME_NONNULL_END