Freigeben über


Class SPXAudioStreamFormat

Declaration

@class SPXAudioStreamFormat : NSObject;

Description

Represents the audio stream format used for custom audio input configurations.

Methods

init

Initializes the audio stream format object with the default audio stream format (16 kHz, 16 bit, mono PCM).

- (instancetype _Nonnull)init

Returns

an instance of audio stream format.

initUsingPCMWithSampleRate:bitsPerSample:channels:

Initialize the audio stream format object with the specified PCM waveformat characteristics.

- (instancetype _Nullable)initUsingPCMWithSampleRate:(NSUInteger)samplesPerSecond
    bitsPerSample:(NSUInteger)bitsPerSample channels:(NSUInteger)channels

Parameters

  • samplesPerSecond - sample rate, in samples per second (Hertz).
  • bitsPerSample - bits per sample.
  • channels - number of channels in the waveform-audio data.

Returns

an instance of audio stream format.

initUsingCompressedFormat:

Creates an audio stream format object with the specified compressed audio container format, to be used as input format. Support added in 1.5.0. Note: Compressed input is only supported on iOS.

- (instancetype _Nullable)initUsingCompressedFormat:(SPXAudioStreamContainerFormat)audioStreamContainerFormat

Parameters

  • audioStreamContainerFormat - compressed format type.

Returns

an instance of audio stream format.