SYAudioManager Class Reference

Manages the playback of audio output from files or TTS. More...

#import <SYAudioManager.h>

Inheritance diagram for SYAudioManager:
Collaboration diagram for SYAudioManager:

Instance Methods

((unavailable("Use +[SYAudioManager sharedAudioManager] instead.") - __attribute__
 SYAudioManager is singleton, use [SYAudioManager sharedAudioManager] to access singleton instance. More...
 
(void) - playOutput:
 Plays audio output asynchronously. If audio output queue is empty, output will be played immediately. Otherwise it will be added to the end of the queue and played later. The given output won't be redirected, even if redirection is set up (redirectPCMOutput or redirectTTSOutput). More...
 
(void) - skipCurrentOutput
 Skips the output at the front of the queue. If the current output has already started playing, it will be interrupted. The next output item in the queue will be played. More...
 
(void) - stopOutputAndClearQueue
 Stops playing the current output immediately and clears any queued output. More...
 
(void) - clearQueue
 Removes all output from the audio queue Currently played output will be allowed to finish. More...
 
(void) - redirectPCMOutput:
 Use this method to get raw PCM audio data and override SYAudioManager PCM audio output with custom solution. Pass nil to use default SYAudioManager PCM output. Note: if playback is requested with SYAudioManager.playOutput, it won't be redirected. More...
 
(void) - redirectTTSOutput:
 Use this method to get TTS data and override SYAudioManager TTS output with custom solution. Pass nil to use default SYAudioManager TTS output. Note: if playback is requested with SYAudioManager.playOutput, it won't be redirected. More...
 

Class Methods

(nonnull SYAudioManager *) + sharedAudioManager
 Accesses the SYAudioManager singleton instance. More...
 
((unavailable("Use +[SYAudioManager sharedAudioManager] instead.") + __attribute__
 

Properties

id< SYAudioManagerDelegatedelegate
 SYAudioManagerDelegate,. More...
 
BOOL managesAudioSession
 Controls whether the SYAudioManager manages the application's audio session. If managesAudioSession is YES, the SYAudioManager will change the type of the audio session and activate and deactivate the session as necessary to play SDK audio output. The default value is YES. More...
 
SYAudioRoute audioRoute
 The current audio output route. Effective only if SYAudioManager.managesAudioSession is set to YES. More...
 
SYAudioPlaybackMode playbackMode
 Controls interaction with other audio sources. Effective only if SYAudioManager.managesAudioSession is set to YES. More...
 

Detailed Description

Manages the playback of audio output from files or TTS.

Method Documentation

◆ sharedAudioManager

+ (nonnull SYAudioManager*) sharedAudioManager

Accesses the SYAudioManager singleton instance.

Returns
SYAudioManager instance.

◆ __attribute__ [1/2]

- ((unavailable("Use +[SYAudioManager sharedAudioManager] instead.") __attribute__

SYAudioManager is singleton, use [SYAudioManager sharedAudioManager] to access singleton instance.

◆ __attribute__ [2/2]

+ ((unavailable("Use +[SYAudioManager sharedAudioManager] instead.") __attribute__

◆ playOutput:

- (void) playOutput: (nonnull SYAudioOutput *)  output

Plays audio output asynchronously. If audio output queue is empty, output will be played immediately. Otherwise it will be added to the end of the queue and played later. The given output won't be redirected, even if redirection is set up (redirectPCMOutput or redirectTTSOutput).

◆ skipCurrentOutput

- (void) skipCurrentOutput

Skips the output at the front of the queue. If the current output has already started playing, it will be interrupted. The next output item in the queue will be played.

◆ stopOutputAndClearQueue

- (void) stopOutputAndClearQueue

Stops playing the current output immediately and clears any queued output.

◆ clearQueue

- (void) clearQueue

Removes all output from the audio queue Currently played output will be allowed to finish.

◆ redirectPCMOutput:

- (void) redirectPCMOutput: (nullable PCMDataReadyBlock)  customPCMPlay

Use this method to get raw PCM audio data and override SYAudioManager PCM audio output with custom solution. Pass nil to use default SYAudioManager PCM output. Note: if playback is requested with SYAudioManager.playOutput, it won't be redirected.

◆ redirectTTSOutput:

- (void) redirectTTSOutput: (nullable TTSDataReadyBlock)  customTTSPlay

Use this method to get TTS data and override SYAudioManager TTS output with custom solution. Pass nil to use default SYAudioManager TTS output. Note: if playback is requested with SYAudioManager.playOutput, it won't be redirected.

Property Documentation

◆ delegate

- (id<SYAudioManagerDelegate>) delegate
readwritenonatomicweak

◆ managesAudioSession

- (BOOL) managesAudioSession
readwritenonatomicassign

Controls whether the SYAudioManager manages the application's audio session. If managesAudioSession is YES, the SYAudioManager will change the type of the audio session and activate and deactivate the session as necessary to play SDK audio output. The default value is YES.

◆ audioRoute

- (SYAudioRoute) audioRoute
readwritenonatomicassign

The current audio output route. Effective only if SYAudioManager.managesAudioSession is set to YES.

◆ playbackMode

- (SYAudioPlaybackMode) playbackMode
readwritenonatomicassign

Controls interaction with other audio sources. Effective only if SYAudioManager.managesAudioSession is set to YES.


The documentation for this class was generated from the following file: