FishSoundComment | A comment |
FishSoundFormat | Info about a particular sound format |
FishSoundInfo | Info about a particular encoder/decoder instance |
#include <fishsound/fishsound.h>
Go to the source code of this file.
Data Structures | |
struct | FishSoundComment |
A comment. More... | |
Functions | |
const char * | fish_sound_comment_get_vendor (FishSound *fsound) |
Retrieve the vendor string. | |
const FishSoundComment * | fish_sound_comment_first (FishSound *fsound) |
Retrieve the first comment. | |
const FishSoundComment * | fish_sound_comment_next (FishSound *fsound, const FishSoundComment *comment) |
Retrieve the next comment. | |
const FishSoundComment * | fish_sound_comment_first_byname (FishSound *fsound, char *name) |
Retrieve the first comment with a given name. | |
const FishSoundComment * | fish_sound_comment_next_byname (FishSound *fsound, const FishSoundComment *comment) |
Retrieve the next comment following and with the same name as a given comment. | |
int | fish_sound_comment_add (FishSound *fsound, FishSoundComment *comment) |
Add a comment. | |
int | fish_sound_comment_add_byname (FishSound *fsound, const char *name, const char *value) |
Add a comment by name and value. | |
int | fish_sound_comment_remove (FishSound *fsound, FishSoundComment *comment) |
Remove a comment. | |
int | fish_sound_comment_remove_byname (FishSound *fsound, char *name) |
Remove all comments with a given name. |
Vorbis and Speex bitstreams use a comment format called "Vorbiscomment", defined here. Many standard comment names (such as TITLE, COPYRIGHT and GENRE) are defined in that document.
The following general features of Vorbiscomment are relevant to this API:
Each comment block contains one Vendor string, which can be retrieved with fish_sound_comment_get_vendor(). When encoding, this string is effectively fixed by the codec libraries; it cannot be set by the application.
The rest of a comment block consists of name = value pairs, with the following restrictions:
int fish_sound_comment_add | ( | FishSound * | fsound, | |
FishSoundComment * | comment | |||
) |
Add a comment.
fsound | A FishSound* handle (created with mode FISH_SOUND_ENCODE) | |
comment | The comment to add |
0 | Success | |
FISH_SOUND_ERR_BAD | fsound is not a valid FishSound* handle | |
FISH_SOUND_ERR_INVALID | Operation not suitable for this FishSound |
int fish_sound_comment_add_byname | ( | FishSound * | fsound, | |
const char * | name, | |||
const char * | value | |||
) |
Add a comment by name and value.
fsound | A FishSound* handle (created with mode FISH_SOUND_ENCODE) | |
name | The name of the comment to add | |
value | The contents of the comment to add |
0 | Success | |
FISH_SOUND_ERR_BAD | fsound is not a valid FishSound* handle | |
FISH_SOUND_ERR_INVALID | Operation not suitable for this FishSound |
const FishSoundComment* fish_sound_comment_first | ( | FishSound * | fsound | ) |
Retrieve the first comment.
fsound | A FishSound* handle |
const FishSoundComment* fish_sound_comment_first_byname | ( | FishSound * | fsound, | |
char * | name | |||
) |
Retrieve the first comment with a given name.
fsound | A FishSound* handle | |
name | the name of the comment to retrieve. |
NULL | no match was found. |
const char* fish_sound_comment_get_vendor | ( | FishSound * | fsound | ) |
Retrieve the vendor string.
fsound | A FishSound* handle |
NULL | No vendor string is associated with fsound, or fsound is NULL. |
const FishSoundComment* fish_sound_comment_next | ( | FishSound * | fsound, | |
const FishSoundComment * | comment | |||
) |
Retrieve the next comment.
fsound | A FishSound* handle | |
comment | The previous comment. |
const FishSoundComment* fish_sound_comment_next_byname | ( | FishSound * | fsound, | |
const FishSoundComment * | comment | |||
) |
Retrieve the next comment following and with the same name as a given comment.
fsound | A FishSound* handle | |
comment | A comment |
NULL | no further comments with the same name exist for this FishSound* object. |
int fish_sound_comment_remove | ( | FishSound * | fsound, | |
FishSoundComment * | comment | |||
) |
Remove a comment.
fsound | A FishSound* handle (created with FISH_SOUND_ENCODE) | |
comment | The comment to remove. |
1 | Success: comment removed | |
0 | No-op: comment not found, nothing to remove | |
FISH_SOUND_ERR_BAD | fsound is not a valid FishSound* handle | |
FISH_SOUND_ERR_INVALID | Operation not suitable for this FishSound |
int fish_sound_comment_remove_byname | ( | FishSound * | fsound, | |
char * | name | |||
) |
Remove all comments with a given name.
fsound | A FishSound* handle (created with FISH_SOUND_ENCODE) | |
name | The name of the comments to remove |
>= 0 | The number of comments removed | |
FISH_SOUND_ERR_BAD | fsound is not a valid FishSound* handle | |
FISH_SOUND_ERR_INVALID | Operation not suitable for this FishSound |
Go to the source code of this file.
enum _FishSoundCodecID |
enum _FishSoundCommand |
Command codes.
FISH_SOUND_COMMAND_NOP | No operation. |
FISH_SOUND_GET_INFO | Retrieve the FishSoundInfo. |
FISH_SOUND_GET_INTERLEAVE | Query if multichannel audio should be interpreted as interleaved. |
FISH_SOUND_SET_INTERLEAVE | Set to 1 to interleave, 0 to non-interleave. |
enum _FishSoundError |
Error values.
FISH_SOUND_OK | No error. |
FISH_SOUND_ERR_GENERIC | generic error |
FISH_SOUND_ERR_BAD | Not a valid FishSound* handle. |
FISH_SOUND_ERR_INVALID | The requested operation is not suitable for this FishSound* handle. |
FISH_SOUND_ERR_OUT_OF_MEMORY | Out of memory. |
FISH_SOUND_ERR_DISABLED | Functionality disabled at build time. |
FISH_SOUND_ERR_SHORT_IDENTIFY | Too few bytes passed to fish_sound_identify(). |
FISH_SOUND_ERR_COMMENT_INVALID | Comment violates VorbisComment restrictions. |
enum _FishSoundMode |
enum _FishSoundStopCtl |
Go to the source code of this file.
Typedefs | |
typedef int(* | FishSoundDecoded_Float )(FishSound *fsound, float *pcm[], long frames, void *user_data) |
Signature of a callback for libfishsound to call when it has decoded PCM audio data, and you want this provided as non-interleaved floats. | |
typedef int(* | FishSoundDecoded_FloatIlv )(FishSound *fsound, float **pcm, long frames, void *user_data) |
Signature of a callback for libfishsound to call when it has decoded PCM audio data, and you want this provided as interleaved floats. | |
Functions | |
int | fish_sound_set_decoded_float (FishSound *fsound, FishSoundDecoded_Float decoded, void *user_data) |
Set the callback for libfishsound to call when it has a block of decoded PCM audio ready, and you want this provided as non-interleaved floats. | |
int | fish_sound_set_decoded_float_ilv (FishSound *fsound, FishSoundDecoded_FloatIlv decoded, void *user_data) |
Set the callback for libfishsound to call when it has a block of decoded PCM audio ready, and you want this provided as interleaved floats. | |
long | fish_sound_decode (FishSound *fsound, unsigned char *buf, long bytes) |
Decode a block of compressed data. |
typedef int(* FishSoundDecoded_Float)(FishSound *fsound, float *pcm[], long frames, void *user_data) |
Signature of a callback for libfishsound to call when it has decoded PCM audio data, and you want this provided as non-interleaved floats.
fsound | The FishSound* handle | |
pcm | The decoded audio | |
frames | The count of frames decoded | |
user_data | Arbitrary user data |
FISH_SOUND_CONTINUE | Continue decoding | |
FISH_SOUND_STOP_OK | Stop decoding immediately and return control to the fish_sound_decode() caller | |
FISH_SOUND_STOP_ERR | Stop decoding immediately, purge buffered data, and return control to the fish_sound_decode() caller |
typedef int(* FishSoundDecoded_FloatIlv)(FishSound *fsound, float **pcm, long frames, void *user_data) |
Signature of a callback for libfishsound to call when it has decoded PCM audio data, and you want this provided as interleaved floats.
fsound | The FishSound* handle | |
pcm | The decoded audio | |
frames | The count of frames decoded | |
user_data | Arbitrary user data |
FISH_SOUND_CONTINUE | Continue decoding | |
FISH_SOUND_STOP_OK | Stop decoding immediately and return control to the fish_sound_decode() caller | |
FISH_SOUND_STOP_ERR | Stop decoding immediately, purge buffered data, and return control to the fish_sound_decode() caller |
long fish_sound_decode | ( | FishSound * | fsound, | |
unsigned char * | buf, | |||
long | bytes | |||
) |
Decode a block of compressed data.
No internal buffering is done, so a complete compressed audio packet must be passed each time.
fsound | A FishSound* handle (created with mode FISH_SOUND_DECODE) | |
buf | A buffer containing a compressed audio packet | |
bytes | A count of bytes to decode (i.e. the length of buf) |
FISH_SOUND_ERR_STOP_OK | Decoding was stopped by a FishSoundDecode* callback returning FISH_SOUND_STOP_OK before any input bytes were consumed. This will occur when PCM is decoded from previously buffered input, and stopping is immediately requested. | |
FISH_SOUND_ERR_STOP_ERR | Decoding was stopped by a FishSoundDecode* callback returning FISH_SOUND_STOP_ERR before any input bytes were consumed. This will occur when PCM is decoded from previously buffered input, and stopping is immediately requested. | |
FISH_SOUND_ERR_BAD | Not a valid FishSound* handle | |
FISH_SOUND_ERR_OUT_OF_MEMORY | Out of memory |
int fish_sound_set_decoded_float | ( | FishSound * | fsound, | |
FishSoundDecoded_Float | decoded, | |||
void * | user_data | |||
) |
Set the callback for libfishsound to call when it has a block of decoded PCM audio ready, and you want this provided as non-interleaved floats.
fsound | A FishSound* handle (created with mode FISH_SOUND_DECODE) | |
decoded | The callback to call | |
user_data | Arbitrary user data to pass to the callback |
0 | Success | |
FISH_SOUND_ERR_BAD | Not a valid FishSound* handle | |
FISH_SOUND_ERR_OUT_OF_MEMORY | Out of memory |
int fish_sound_set_decoded_float_ilv | ( | FishSound * | fsound, | |
FishSoundDecoded_FloatIlv | decoded, | |||
void * | user_data | |||
) |
Set the callback for libfishsound to call when it has a block of decoded PCM audio ready, and you want this provided as interleaved floats.
fsound | A FishSound* handle (created with mode FISH_SOUND_DECODE) | |
decoded | The callback to call | |
user_data | Arbitrary user data to pass to the callback |
0 | Success | |
FISH_SOUND_ERR_BAD | Not a valid FishSound* handle | |
FISH_SOUND_ERR_OUT_OF_MEMORY | Out of memory |
Go to the source code of this file.
Typedefs | |
typedef FishSoundDecoded_Float | FishSoundDecoded |
DEPRECATED TYPE. | |
Functions | |
int | fish_sound_set_decoded_callback (FishSound *fsound, FishSoundDecoded decoded, void *user_data) |
DEPRECATED FUNCTION. | |
int | fish_sound_set_interleave (FishSound *fsound, int interleave) |
DEPRECATED FUNCTION. | |
long | fish_sound_encode (FishSound *fsound, float **pcm, long frames) |
DEPRECATED FUNCTION. |
DEPRECATED TYPE.
Signature of a callback for libfishsound to call when it has decoded PCM audio data, and you want this provided as floats using the current interleave method as set by fish_sound_set_interleave().
long fish_sound_encode | ( | FishSound * | fsound, | |
float ** | pcm, | |||
long | frames | |||
) |
DEPRECATED FUNCTION.
Encode a block of audio
fsound | A FishSound* handle (created with mode FISH_SOUND_ENCODE) | |
pcm | The audio data to encode | |
frames | A count of frames to encode |
int fish_sound_set_decoded_callback | ( | FishSound * | fsound, | |
FishSoundDecoded | decoded, | |||
void * | user_data | |||
) |
DEPRECATED FUNCTION.
Set the callback for libfishsound to call when it has a block of decoded PCM audio ready, and you want this provided as floats using the current interleave method as set by fish_sound_set_interleave(). This function, and fish_sound_set_interleave(), have been superceded by the typesafe fish_sound_set_decoded_TYPE() callbacks, such as fish_sound_set_decoded_float() or fish_sound_set_decoded_float_ilv().
fsound | A FishSound* handle (created with mode FISH_SOUND_DECODE) | |
decoded | The callback to call | |
user_data | Arbitrary user data to pass to the callback |
int fish_sound_set_interleave | ( | FishSound * | fsound, | |
int | interleave | |||
) |
DEPRECATED FUNCTION.
Set the PCM format used by a FishSound object. The default value is non-interleaved. Prior to libfishsound 0.7.0, you would (optionally) specify whether you wanted to receive interleaved or per-channel PCM data using fish_sound_set_interleave(), the default being per-channel (non-interleaved) PCM. Whether or not your decoded callback expects interleaved or non-interleaved data is now implied by the particular fish_sound_set_decoded_TYPE() method you use to set it, such as fish_sound_set_decoded_float() or fish_sound_set_decoded_float_ilv().
fsound | A FishSound* handle | |
interleave | Whether to use interleaved PCM or not. Valid values are 0 for non-interleaved, and 1 for interleaved. |
0 | Success | |
-1 | Invalid fsound |