SpeechAudioFormat Class Reference

Inherits from NSObject
Declared in SpeechAudioFormat.m
SpeechRecognitionService.h

Overview

The SpeechAudioFormat contains information about how the audio data was recorded and stored, including the type of compression used, number of channels, sample rate, bits per sample and other attributes.

Other Methods

– init

Initializes a SpeechAudioFormat object

- (id)init

Discussion

Initializes a SpeechAudioFormat object

Declared In

SpeechAudioFormat.m

+ createSiren7Format:

Produces a SpeechAudioFormat for data encoded in Siren7. The data must be encoded in mono, such that a 320 sample mono input frame produces a 40 bytes output frame.

+ (SpeechAudioFormat *)createSiren7Format:(int)sampleRate

Parameters

sampleRate

The samples per second of the audio that was encoded (can only be 16000).

Return Value

The created SpeechAudioFormat.

Discussion

Produces a SpeechAudioFormat for data encoded in Siren7. The data must be encoded in mono, such that a 320 sample mono input frame produces a 40 bytes output frame.

Declared In

SpeechAudioFormat.m

+ create16BitPCMFormat:

Produces a SpeechAudioFormat for 16-bit PCM data.

+ (SpeechAudioFormat *)create16BitPCMFormat:(int)sampleRate

Parameters

sampleRate

The samples per second of the audio that was encoded (can only be 16000).

Return Value

The created SpeechAudioFormat.

Discussion

Produces a SpeechAudioFormat for 16-bit PCM data.

Declared In

SpeechAudioFormat.m

Other Methods

  AverageBytesPerSecond

This value indicates how many bytes of audio data must be streamed to a D/A converter per second in order to play the audio.

@property (nonatomic, assign) int AverageBytesPerSecond

Discussion

This value indicates how many bytes of audio data must be streamed to a D/A converter per second in order to play the audio.

Declared In

SpeechRecognitionService.h

  BitsPerSample

The number of significant bits in each audio sample. Usually 16 or 24.

@property (nonatomic, assign) short BitsPerSample

Discussion

The number of significant bits in each audio sample. Usually 16 or 24.

Declared In

SpeechRecognitionService.h

  BlockAlign

The number of data bytes per sample slice.

@property (nonatomic, assign) short BlockAlign

Discussion

The number of data bytes per sample slice.

Declared In

SpeechRecognitionService.h

  ChannelCount

The number of separate audio signals in the audio data. A value of 1 means a mono signal, a value of 2 means a stereo signal.

@property (nonatomic, assign) short ChannelCount

Discussion

The number of separate audio signals in the audio data. A value of 1 means a mono signal, a value of 2 means a stereo signal.

Declared In

SpeechRecognitionService.h

  EncodingFormat

Specifies the type of compression used on the audio data. Default value is AudioCompressionType_PCM.

@property (nonatomic, assign) AudioCompressionType EncodingFormat

Discussion

Specifies the type of compression used on the audio data. Default value is AudioCompressionType_PCM.

Declared In

SpeechRecognitionService.h

  FormatSpecificData

Extra bytes for use to describe parameters to certain audio compression types.

@property (nonatomic, strong) NSData *FormatSpecificData

Discussion

Extra bytes for use to describe parameters to certain audio compression types.

This field should be null for PCM.

Declared In

SpeechRecognitionService.h

  SamplesPerSecond

Audio sample slices per second, where one slice includes all the channel samples. This value is unaffected by the number of channels.

@property (nonatomic, assign) int SamplesPerSecond

Discussion

Audio sample slices per second, where one slice includes all the channel samples. This value is unaffected by the number of channels.

Declared In

SpeechRecognitionService.h