Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Documentation
Sidebar

SDLAudioStreamManager Class Reference

Section Contents

Overview

Undocumented

delegate

The delegate describing when files are done playing or any errors that occur

Objective-C

@property (readwrite, nonatomic)
    id<SDLAudioStreamManagerDelegate> _Nullable delegate;

playing

Whether or not we are currently playing audio

Objective-C

@property (readonly, getter=isPlaying, assign, nonatomic) BOOL playing;

Swift

var isPlaying: Bool { get }

queue

The queue of audio files that will be played in sequence

Objective-C

@property (readonly, copy, nonatomic) NSArray<SDLAudioFile *> *_Nonnull queue;

Swift

var queue: [SDLAudioFile] { get }

-init

Init should only occur with dependencies. use initWithManager:

Objective-C

- (nonnull instancetype)init;

Return Value

A failure

-initWithManager:

Create an audio stream manager with a reference to the parent stream manager.

Warning

For internal use

Objective-C

- (nonnull instancetype)initWithManager:
    (nonnull id<SDLStreamingAudioManagerType>)streamManager;

Parameters

streamManager

The parent stream manager

Return Value

The audio stream manager

-pushWithFileURL:

Push a new file URL onto the queue after converting it into the correct PCM format for streaming binary data. Call playNextWhenReady to start playing the next completed pushed file.

Note

This happens on a serial background thread and will provide an error callback using the delegate if the conversion fails.

Objective-C

- (void)pushWithFileURL:(nonnull NSURL *)fileURL;

Swift

func push(withFileURL fileURL: URL)

Parameters

fileURL

File URL to convert

-playNextWhenReady

Play the next item in the queue. If an item is currently playing, it will continue playing and this item will begin playing after it is completed.

When complete, this will callback on the delegate.

Objective-C

- (void)playNextWhenReady;

Swift

func playNextWhenReady()

-stop

Stop playing the queue after the current item completes and clear the queue. If nothing is playing, the queue will be cleared.

Objective-C

- (void)stop;

Swift

func stop()
View on GitHub.com
Previous Section Next Section