fishsound.h
Go to the documentation of this file.
/*
Copyright (C) 2003 Commonwealth Scientific and Industrial Research
Organisation (CSIRO) Australia
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of CSIRO Australia nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef FISH_SOUND_H_INCLUDED
#define FISH_SOUND_H_INCLUDED
#include <fishsound/constants.h>
typedef struct {
int samplerate;
int channels;
int format;
} FishSoundInfo;
typedef struct {
int format;
const char * name;
const char * extension;
} FishSoundFormat;
typedef void * FishSound;
#ifdef __cplusplus
extern "C" {
#endif
int
fish_sound_identify (unsigned char * buf, long bytes);
FishSound * fish_sound_new (int mode, FishSoundInfo * fsinfo);
long fish_sound_flush (FishSound * fsound);
int fish_sound_reset (FishSound * fsound);
int fish_sound_delete (FishSound * fsound);
int fish_sound_command (FishSound * fsound, int command, void * data,
int datasize);
int fish_sound_get_interleave (FishSound * fsound);
long fish_sound_get_frameno (FishSound * fsound);
int fish_sound_set_frameno (FishSound * fsound, long frameno);
int fish_sound_prepare_truncation (FishSound * fsound, long next_granulepos,
int next_eos);
#ifdef __cplusplus
}
#endif
#include <fishsound/decode.h>
#include <fishsound/encode.h>
#include <fishsound/comments.h>
#include <fishsound/deprecated.h>
#endif /* FISH_SOUND_H_INCLUDED */
comments.h
Encoding and decoding of comments.
constants.h
Constants used by libfishsound.
decode.h
Decode functions and callback prototypes.
deprecated.h
Deprecated interfaces.
encode.h
Encode functions and callback prototypes.
fish_sound_delete
int fish_sound_delete(FishSound *fsound)
Delete a FishSound object.
fish_sound_set_frameno
int fish_sound_set_frameno(FishSound *fsound, long frameno)
Set the current frame number of a FishSound object.
fish_sound_identify
int fish_sound_identify(unsigned char *buf, long bytes)
Identify a codec based on the first few bytes of data.
fish_sound_command
int fish_sound_command(FishSound *fsound, int command, void *data, int datasize)
Command interface.
fish_sound_new
FishSound * fish_sound_new(int mode, FishSoundInfo *fsinfo)
Instantiate a new FishSound* handle.
fish_sound_reset
int fish_sound_reset(FishSound *fsound)
Reset the codec state of a FishSound object.
fish_sound_prepare_truncation
int fish_sound_prepare_truncation(FishSound *fsound, long next_granulepos, int next_eos)
Prepare truncation details for the next block of data.
fish_sound_get_interleave
int fish_sound_get_interleave(FishSound *fsound)
Query whether a FishSound object is using interleaved PCM.
FishSound
void * FishSound
An opaque handle to a FishSound.
Definition fishsound.h:433
fish_sound_flush
long fish_sound_flush(FishSound *fsound)
Flush any internally buffered data, forcing encode.
fish_sound_get_frameno
long fish_sound_get_frameno(FishSound *fsound)
Query the current frame number of a FishSound object.
FishSoundFormat
Info about a particular sound format.
Definition fishsound.h:418
FishSoundFormat::name
const char * name
Printable name.
Definition fishsound.h:423
FishSoundFormat::format
int format
FISH_SOUND_VORBIS, FISH_SOUND_SPEEX, FISH_SOUND_FLAC etc.
Definition fishsound.h:420
FishSoundFormat::extension
const char * extension
Commonly used file extension.
Definition fishsound.h:426
FishSoundInfo
Info about a particular encoder/decoder instance.
Definition fishsound.h:404
FishSoundInfo::format
int format
FISH_SOUND_VORBIS, FISH_SOUND_SPEEX, FISH_SOUND_FLAC etc.
Definition fishsound.h:412
FishSoundInfo::samplerate
int samplerate
Sample rate of audio data in Hz.
Definition fishsound.h:406
FishSoundInfo::channels
int channels
Count of channels.
Definition fishsound.h:409