libfishsound 1.0.0
Typedefs | Functions
encode.h File Reference

Encode functions and callback prototypes. More...

Go to the source code of this file.

Typedefs

typedef int(* FishSoundEncoded )(FishSound *fsound, unsigned char *buf, long bytes, void *user_data)
 Signature of a callback for libfishsound to call when it has encoded data.

Functions

int fish_sound_set_encoded_callback (FishSound *fsound, FishSoundEncoded encoded, void *user_data)
 Set the callback for libfishsound to call when it has a block of encoded data ready.
long fish_sound_encode_float (FishSound *fsound, float *pcm[], long frames)
 Encode a block of PCM audio given as non-interleaved floats.
long fish_sound_encode_float_ilv (FishSound *fsound, float **pcm, long frames)
 Encode a block of audio given as interleaved floats.

Detailed Description

Encode functions and callback prototypes.


Typedef Documentation

typedef int(* FishSoundEncoded)(FishSound *fsound, unsigned char *buf, long bytes, void *user_data)

Signature of a callback for libfishsound to call when it has encoded data.

Parameters:
fsoundThe FishSound* handle
bufThe encoded data
bytesThe count of bytes encoded
user_dataArbitrary user data
Return values:
0to continue
non-zeroto stop encoding immediately and return control to the fish_sound_encode() caller

Function Documentation

long fish_sound_encode_float ( FishSound fsound,
float *  pcm[],
long  frames 
)

Encode a block of PCM audio given as non-interleaved floats.

Parameters:
fsoundA FishSound* handle (created with mode FISH_SOUND_ENCODE)
pcmThe audio data to encode
framesA count of frames to encode
Returns:
The number of frames encoded
Note:
For multichannel audio, the audio data is interpreted according to the current PCM style
long fish_sound_encode_float_ilv ( FishSound fsound,
float **  pcm,
long  frames 
)

Encode a block of audio given as interleaved floats.

Parameters:
fsoundA FishSound* handle (created with mode FISH_SOUND_ENCODE)
pcmThe audio data to encode
framesA count of frames to encode
Returns:
The number of frames encoded
Note:
For multichannel audio, the audio data is interpreted according to the current PCM style
int fish_sound_set_encoded_callback ( FishSound fsound,
FishSoundEncoded  encoded,
void *  user_data 
)

Set the callback for libfishsound to call when it has a block of encoded data ready.

Parameters:
fsoundA FishSound* handle (created with mode FISH_SOUND_ENCODE)
encodedThe callback to call
user_dataArbitrary user data to pass to the callback
Returns:
0 on success, -1 on failure