![]() |
![]() |
![]() |
GPS04 Reference Manual | ![]() |
---|---|---|---|---|
#include <PS04-audio-decoder.h> PS04AudioDecoder; typedef PS04AudioSample; #define PS04_AUDIO_SAMPLE_BITS #define PS04_AUDIO_SAMPLE_RATE #define PS04_DECODER_ERROR enum PS04DecoderError; PS04AudioDecoder* ps04_audio_decoder_new (PS04Stream *instream, PS04Stream *outstream); unsigned ps04_audio_decoder_calc_n_frames_from_stream_length (gsize length); unsigned ps04_audio_decoder_decode (PS04AudioDecoder *self, GError **error);
The PS04AudioDecoder class decodes an input stream in the AUD file format, writing raw audio data to an output stream.
typedef gint16 PS04AudioSample;
This type defines an audio sample as a signed 16-bit integer.
#define PS04_AUDIO_SAMPLE_BITS 16
The number of bits per sample (amplitude resolution).
#define PS04_AUDIO_SAMPLE_RATE 31250
The number of samples per second (frequency resolution).
PS04AudioDecoder* ps04_audio_decoder_new (PS04Stream *instream, PS04Stream *outstream);
Creates a new audio decoder.
instream : |
A readable PS04Stream of encoded audio data. |
outstream : |
A writable PS04Stream to receive decoded data. |
Returns : | a new PS04AudioDecoder. |
unsigned ps04_audio_decoder_calc_n_frames_from_stream_length (gsize length);
length : |
|
Returns : |
unsigned ps04_audio_decoder_decode (PS04AudioDecoder *self, GError **error);
Decodes the input stream, writing raw data to the output stream.
On error, error
is set to a PS04DecoderError value.
self : |
A PS04AudioDecoder. |
error : |
A placeholder for a GError, or NULL .
|
Returns : | the number of frames decoded. |