API reference
API reference
Select your platform
No SDKs available
No versions available

AudioDecoderJson Class

A decoder for json data and audio within a single data stream. Decodes the data into split audio and text streams
Meta::Voice::Audio::Decoding::AudioDecoderJson extends Meta.Voice.Audio.Decoding.IAudioDecoder.

Overview

Data Fields

int
Once setup this should display the number of channels expected to be decoded
int
Once setup this should display the number of samples per second expected
bool
Due to headers, sequential decode is required

Public Member Functions

AudioDecoderJson
( IAudioDecoder audioDecoder,
AudioJsonDecodeDelegate onJsonDecoded )
Constructor that takes in an audio decoder and decode callback delegate
void
Setup
( int channels,
int sampleRate )
Performs an audio decode setup with specified channels and sample rate
int
GetTotalSamples
( ulong contentLength )
Cannot determine total samples via content length alone
float []
Decode
( byte [] chunkData,
int chunkStart,
int chunkLength )
Performs a decode of full chunk data

Details

Fields

int Meta.Voice.Audio.Decoding.AudioDecoderJson.Channels
Once setup this should display the number of channels expected to be decoded
int Meta.Voice.Audio.Decoding.AudioDecoderJson.SampleRate
Once setup this should display the number of samples per second expected
bool Meta.Voice.Audio.Decoding.AudioDecoderJson.RequireSequentialDecode
Due to headers, sequential decode is required

Member Functions

Meta.Voice.Audio.Decoding.AudioDecoderJson.AudioDecoderJson
( IAudioDecoder audioDecoder,
AudioJsonDecodeDelegate onJsonDecoded )
Constructor that takes in an audio decoder and decode callback delegate
Parameters
audioDecoder
The audio decoder to receive
onJsonDecoded
The delegate to be called every time a json chunk is decoded
void Meta.Voice.Audio.Decoding.AudioDecoderJson.Setup
( int channels,
int sampleRate )
Performs an audio decode setup with specified channels and sample rate
Parameters
channels
Channels supported by audio file
sampleRate
Sample rate supported by audio file
int Meta.Voice.Audio.Decoding.AudioDecoderJson.GetTotalSamples
( ulong contentLength )
Cannot determine total samples via content length alone
float [] Meta.Voice.Audio.Decoding.AudioDecoderJson.Decode
( byte [] chunkData,
int chunkStart,
int chunkLength )
Performs a decode of full chunk data
Parameters
chunkData
A chunk of bytes to be decoded into audio data
chunkStart
The array start index into account when decoding
chunkLength
The total number of bytes to be used within chunkData
Returns
Returns an array of audio data floats that range from 0 to 1
Did you find this page helpful?
Thumbs up icon
Thumbs down icon