PS04AudioDecoder

PS04AudioDecoder — decoder for AUD files

Synopsis


#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);

Object Hierarchy


  GObject
   +----PS04AudioDecoder

Description

The PS04AudioDecoder class decodes an input stream in the AUD file format, writing raw audio data to an output stream.

Details

PS04AudioDecoder

typedef struct _PS04AudioDecoder PS04AudioDecoder;


PS04AudioSample

typedef gint16 PS04AudioSample;

This type defines an audio sample as a signed 16-bit integer.


PS04_AUDIO_SAMPLE_BITS

#define PS04_AUDIO_SAMPLE_BITS 16

The number of bits per sample (amplitude resolution).


PS04_AUDIO_SAMPLE_RATE

#define PS04_AUDIO_SAMPLE_RATE 31250

The number of samples per second (frequency resolution).


PS04_DECODER_ERROR

#define PS04_DECODER_ERROR ps04_decoder_error_quark ()


enum PS04DecoderError

typedef enum
{
  PS04_DECODER_ERROR_UNEXPECTED_EOS
} PS04DecoderError;


ps04_audio_decoder_new ()

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.

ps04_audio_decoder_calc_n_frames_from_stream_length ()

unsigned    ps04_audio_decoder_calc_n_frames_from_stream_length
                                            (gsize length);

length :
Returns :

ps04_audio_decoder_decode ()

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.