mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Still need to: - Fix indentation - Check for any FutureSource being returned instead of FutureSource.future - Check for then: vs thenTry: mixups - Check for main thread related issues - Check for other exception catching issues - Adjust directory layout - Manual end-to-end testing
55 lines
1.7 KiB
Objective-C
55 lines
1.7 KiB
Objective-C
#import <Foundation/Foundation.h>
|
|
#import <AudioToolbox/AudioToolbox.h>
|
|
#import <AVFoundation/AVFoundation.h>
|
|
#import "AudioCallbackHandler.h"
|
|
#import "CyclicalBuffer.h"
|
|
#import "Environment.h"
|
|
#import "RemoteIOBufferListWrapper.h"
|
|
#import "Terminable.h"
|
|
|
|
enum State {
|
|
NOT_STARTED,
|
|
STARTED,
|
|
TERMINATED
|
|
};
|
|
|
|
/**
|
|
*
|
|
* RemoteIOAudio is responsible for playing audio through the speakers and
|
|
* recording audio through the microphone. It sends/receives this information
|
|
* to/from its AudioCallbackHandler delegate.
|
|
*
|
|
* Uses Apple's Remote I/O AudioUnit, for simultaneous input and output of audio.
|
|
* The AudioUnit provides format conversion between the hardware audio formats
|
|
* and Redphone's audio format.
|
|
*
|
|
*/
|
|
@interface RemoteIOAudio : NSObject <AVAudioSessionDelegate> {
|
|
|
|
AudioUnit rioAudioUnit;
|
|
|
|
BOOL isStreaming;
|
|
|
|
id<AudioCallbackHandler> delegate;
|
|
|
|
NSMutableSet * unusedBuffers;
|
|
|
|
id<OccurrenceLogger> starveLogger;
|
|
id<ConditionLogger> conditionLogger;
|
|
id<ValueLogger> playbackBufferSizeLogger;
|
|
id<ValueLogger> recordingQueueSizeLogger;
|
|
}
|
|
|
|
@property (nonatomic,readonly) enum State state;
|
|
@property (strong) CyclicalBuffer* recordingQueue;
|
|
@property (strong) CyclicalBuffer* playbackQueue;
|
|
@property (assign) AudioUnit rioAudioUnit;
|
|
|
|
+(RemoteIOAudio*) remoteIOInterfaceStartedWithDelegate:(id<AudioCallbackHandler>)delegateIn untilCancelled:(TOCCancelToken*)untilCancelledToken;
|
|
-(void) populatePlaybackQueueWithData:(NSData*)data;
|
|
-(NSUInteger)getSampleRateInHertz;
|
|
-(BOOL) toggleMute;
|
|
|
|
@end
|
|
|