API reference

AudioDecoderJson Class

A decoder for json data and audio within a single data stream. Decodes the data into split audio and text streams

Constructors

AudioDecoderJson ( audioDecoder , onJsonDecoded )
Constructor that takes in an audio decoder and decode callback delegate
Signature
Meta.Voice.Audio.Decoding.AudioDecoderJson.AudioDecoderJson(IAudioDecoder audioDecoder, AudioJsonDecodeDelegate onJsonDecoded)
Parameters
audioDecoder: IAudioDecoder  The audio decoder to receive
onJsonDecoded: AudioJsonDecodeDelegate  The delegate to be called every time a json chunk is decoded

Fields

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

Methods

Decode ( chunkData , chunkStart , chunkLength )
Performs a decode of full chunk data
Signature
float [] Meta.Voice.Audio.Decoding.AudioDecoderJson.Decode(byte[] chunkData, int chunkStart, int chunkLength)
Parameters
chunkData: byte []  A chunk of bytes to be decoded into audio data
chunkStart: int  The array start index into account when decoding
chunkLength: int  The total number of bytes to be used within chunkData
Returns
float []  Returns an array of audio data floats that range from 0 to 1
GetTotalSamples ( contentLength )
Cannot determine total samples via content length alone
Signature
int Meta.Voice.Audio.Decoding.AudioDecoderJson.GetTotalSamples(ulong contentLength)
Parameters
contentLength: ulong
Returns
int
Setup ( channels , sampleRate )
Performs an audio decode setup with specified channels and sample rate
Signature
void Meta.Voice.Audio.Decoding.AudioDecoderJson.Setup(int channels, int sampleRate)
Parameters
channels: int  Channels supported by audio file
sampleRate: int  Sample rate supported by audio file
Returns
void