共用方式為


Class SPXPushAudioInputStream

Declaration

@class SPXPushAudioInputStream : SPXAudioInputStream;

Description

Represents memory backed push audio input stream used for custom audio input configurations.

Methods

init

Initializes a memory-backed SPXPushAudioInputStream using the default format (16 kHz, 16 bit, mono PCM).

- (instancetype _Nonnull)init

Returns

an instance of push audio input stream.

initWithAudioFormat:

Initializes a memory-backed SPXPushAudioInputStream with the specified audio format.

- (instancetype _Nullable)initWithAudioFormat:(SPXAudioStreamFormat * _Nonnull)format

Parameters

  • format - The audio data format in which audio will be written to the push audio stream's write() method.

Returns

an instance of push audio input stream.

write:

Writes the specified audio data by making an internal copy of the data. Note: The data should not contain any audio header.

- (void)write:(NSData * _Nonnull)data

Parameters

  • data - The audio buffer of which this function will make a copy.

close

Closes the stream.

- (void)close