encode.h File Reference
Encode functions and callback prototypes.
More...
Go to the source code of this file.
Detailed Description
Encode functions and callback prototypes.
Typedef Documentation
Signature of a callback for libfishsound to call when it has encoded data.
- Parameters:
-
| fsound | The FishSound* handle |
| buf | The encoded data |
| bytes | The count of bytes encoded |
| user_data | Arbitrary user data |
- Return values:
-
| 0 | to continue |
| non-zero | to 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:
-
| fsound | A FishSound* handle (created with mode FISH_SOUND_ENCODE) |
| pcm | The audio data to encode |
| frames | A 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:
-
| fsound | A FishSound* handle (created with mode FISH_SOUND_ENCODE) |
| pcm | The audio data to encode |
| frames | A 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
Set the callback for libfishsound to call when it has a block of encoded data ready.
- Parameters:
-
| fsound | A FishSound* handle (created with mode FISH_SOUND_ENCODE) |
| encoded | The callback to call |
| user_data | Arbitrary user data to pass to the callback |
- Returns:
- 0 on success, -1 on failure