#include <fishsound/constants.h>
#include <fishsound/comments.h>
Go to the source code of this file.
Data Structures | |
struct | FishSoundFormat |
Info about a particular sound format. More... | |
struct | FishSoundInfo |
Info about a particular encoder/decoder instance. More... | |
Typedefs | |
typedef void * | FishSound |
An opaque handle to a FishSound. | |
typedef int(* | FishSoundDecoded )(FishSound *fsound, float **pcm, long frames, void *user_data) |
Signature of a callback for libfishsound to call when it has decoded audio PCM data. | |
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_identify (unsigned char *buf, long bytes) |
Identify a codec based on the first few bytes of data. | |
FishSound * | fish_sound_new (int mode, FishSoundInfo *fsinfo) |
Instantiate a new FishSound* handle. | |
int | fish_sound_set_decoded_callback (FishSound *fsound, FishSoundDecoded decoded, void *user_data) |
Set the callback for libfishsound to call when it has a block of decoded audio ready. | |
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_decode (FishSound *fsound, unsigned char *buf, long bytes) |
Decode a block of data. | |
long | fish_sound_encode (FishSound *fsound, float **pcm, long frames) |
Encode a block of audio. | |
long | fish_sound_flush (FishSound *fsound) |
Flush any internally buffered data, forcing encode. | |
int | fish_sound_reset (FishSound *fsound) |
Reset the codec state of a FishSound object. | |
int | fish_sound_delete (FishSound *fsound) |
Delete a FishSound object. | |
int | fish_sound_command (FishSound *fsound, int command, void *data, int datasize) |
Command interface. | |
int | fish_sound_get_interleave (FishSound *fsound) |
Query whether a FishSound object is using interleaved PCM. | |
int | fish_sound_set_interleave (FishSound *fsound, int interleave) |
Set the PCM format used by a FishSound object. | |
long | fish_sound_get_frameno (FishSound *fsound) |
Query the current frame number of a FishSound object. | |
int | fish_sound_set_frameno (FishSound *fsound, long frameno) |
Set the current frame number of a FishSound object. | |
int | fish_sound_prepare_truncation (FishSound *fsound, long next_granulepos, int next_eos) |
Prepare truncation details for the next block of data. |
|
An opaque handle to a FishSound. This is returned by fishsound_new() and is passed to all other fish_sound_*() functions. |
|
Signature of a callback for libfishsound to call when it has decoded audio PCM data.
|
|
Signature of a callback for libfishsound to call when it has encoded data.
|
|
Command interface.
|
|
Decode a block of data.
|
|
Delete a FishSound object.
|
|
Encode a block of audio.
|
|
Flush any internally buffered data, forcing encode.
|
|
Query the current frame number of a FishSound object. For decoding, this is the greatest frame index that has been decoded and made available to a FishSoundDecoded callback. This function is safe to call from within a FishSoundDecoded callback, and corresponds to the frame number of the last frame in the current decoded block. For encoding, this is the greatest frame index that has been encoded. This function is safe to call from within a FishSoundEncoded callback, and corresponds to the frame number of the last frame encoded in the current block.
|
|
Query whether a FishSound object is using interleaved PCM.
|
|
Identify a codec based on the first few bytes of data.
|
|
Instantiate a new FishSound* handle.
|
|
Prepare truncation details for the next block of data. The semantics of these parameters derives directly from Ogg encapsulation of Vorbis, described here. When decoding from Ogg, you should call this function with the granulepos and eos of the ogg_packet structure. This call should be made before passing the packet's data to fish_sound_decode(). Failure to do so may result in minor decode errors on the first and/or last packet of the stream. When encoding into Ogg, you should call this function with the granulepos and eos that will be used for the ogg_packet structure. This call should be made before passing the block of audio data to fish_sound_encode(). Failure to do so may result in minor encoding errors on the first and/or last packet of the stream.
|
|
Reset the codec state of a FishSound object. When decoding from a seekable file, fish_sound_reset() should be called after any seek operations. See also fish_sound_set_frameno().
|
|
Set the callback for libfishsound to call when it has a block of decoded audio ready.
|
|
Set the callback for libfishsound to call when it has a block of encoded data ready.
|
|
Set the current frame number of a FishSound object. When decoding from a seekable file, fish_sound_set_frameno() should be called after any seek operations, otherwise the value returned by fish_sound_get_frameno() will simply continue to increment. See also fish_sound_reset().
|
|
Set the PCM format used by a FishSound object. The default value is non-interleaved.
|