session-ios/Signal/src/audio/SoundInstance.h
Gil Azaria 6951fd1fbe Fixed issue #139.
Testing has been completed on outgoing calls only. It is recommended that testing is conducted on incoming calls before a commit to upstream.
2014-11-02 00:21:49 +01:00

32 lines
870 B
Objective-C

#import <AVFoundation/AVAudioPlayer.h>
/**
* Wrapper for system dependant audio interface.
**/
@interface SoundInstance : NSObject <AVAudioPlayerDelegate>
typedef enum {
SoundInstanceTypeNothing,
SoundInstanceTypeInboundRingtone,
SoundInstanceTypeOutboundRingtone,
SoundInstanceTypeHandshakeSound,
SoundInstanceTypeCompletedSound,
SoundInstanceTypeBusySound,
SoundInstanceTypeErrorAlert,
SoundInstanceTypeAlert
} SoundInstanceType;
@property (nonatomic) SoundInstanceType instanceType;
+(SoundInstance*) soundInstanceForFile:(NSString*) audioFile;
-(NSString*) getId;
-(void) setAudioToLoopIndefinitely;
-(void) setAudioLoopCount:(NSInteger) loopCount;
-(void) setCompeletionBlock:(void (^)(SoundInstance*)) block;
- (void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)player
successfully:(BOOL)flag;
@end