Skip to content

Commit

Permalink
Merge pull request #19 from CommercialTribe/ct_1634
Browse files Browse the repository at this point in the history
CT-1634: fixing audio in network test
  • Loading branch information
k7k0 authored Nov 15, 2016
2 parents 7abf983 + 26e1ea9 commit 3c1e8ff
Show file tree
Hide file tree
Showing 4 changed files with 936 additions and 894 deletions.
52 changes: 34 additions & 18 deletions OTDefaultAudioDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,49 @@
#import <Foundation/Foundation.h>
#import <OpenTok/OpenTok.h>

#define kMixerInputBusCount 2
#define kOutputBus 0
#define kInputBus 1

#define AUDIO_DEVICE_HEADSET @"AudioSessionManagerDevice_Headset"
#define AUDIO_DEVICE_BLUETOOTH @"AudioSessionManagerDevice_Bluetooth"
#define AUDIO_DEVICE_SPEAKER @"AudioSessionManagerDevice_Speaker"

@interface OTDefaultAudioDevice : NSObject <OTAudioDevice>
{
AudioStreamBasicDescription stream_format;
}

/**
* Audio device lifecycle should live for the duration of the process, and
* needs to be set before OTSession is initialized.
*
* It is not recommended to initialize unique audio device instances.
Returns YES if a wired headset is available.
*/
+ (instancetype)sharedInstance;
@property (nonatomic, readonly) BOOL headsetDeviceAvailable;

/**
* Override the audio unit preferred component subtype. This can be used to
* force RemoteIO to be used instead of VPIO (the default). It is recommended
* to set this prior to instantiating any publisher/subscriber; changes will
* not take effect until after the next audio unit setup call.
Returns YES if a bluetooth device is available.
*/
@property (nonatomic) uint32_t preferredAudioComponentSubtype;
@property (nonatomic, readonly) BOOL bluetoothDeviceAvailable;


- (BOOL)setAudioBus:(id<OTAudioBus>)audioBus;

- (OTAudioFormat*)captureFormat;
- (OTAudioFormat*)renderFormat;

- (BOOL)renderingIsAvailable;
- (BOOL)initializeRendering;
- (BOOL)renderingIsInitialized;
- (BOOL)captureIsAvailable;
- (BOOL)initializeCapture;
- (BOOL)captureIsInitialized;

- (BOOL)startRendering;
- (BOOL)stopRendering;
- (BOOL)isRendering;
- (BOOL)startCapture;
- (BOOL)stopCapture;
- (BOOL)isCapturing;
- (void)setAudioPlayoutMute:(BOOL)mute;

- (uint16_t)estimatedRenderDelay;
- (uint16_t)estimatedCaptureDelay;

//desired Audio Route can be bluetooth and headset.
//bluetooth has higher priority of all, next headset, next speaker
- (BOOL)configureAudioSessionWithDesiredAudioRoute:(NSString*)desiredAudioRoute;
- (BOOL)detectCurrentRoute;

@end
@end
Loading

0 comments on commit 3c1e8ff

Please sign in to comment.