RTCAudioSessionConfiguration.h 1.7 KB

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