00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef __FISH_SOUND_H__
00033 #define __FISH_SOUND_H__
00034
00035 #include <fishsound/constants.h>
00036
00294 typedef struct {
00296 int samplerate;
00297
00299 int channels;
00300
00302 int format;
00303 } FishSoundInfo;
00304
00308 typedef struct {
00310 int format;
00311
00313 const char * name;
00314
00316 const char * extension;
00317 } FishSoundFormat;
00318
00323 typedef void * FishSound;
00324
00336 typedef int (*FishSoundDecoded) (FishSound * fsound, float ** pcm,
00337 long frames, void * user_data);
00338
00350 typedef int (*FishSoundEncoded) (FishSound * fsound, unsigned char * buf,
00351 long bytes, void * user_data);
00352
00369 int
00370 fish_sound_identify (unsigned char * buf, long bytes);
00371
00378 FishSound * fish_sound_new (int mode, FishSoundInfo * fsinfo);
00379
00388 int fish_sound_set_decoded_callback (FishSound * fsound,
00389 FishSoundDecoded decoded,
00390 void * user_data);
00391
00400 int fish_sound_set_encoded_callback (FishSound * fsound,
00401 FishSoundEncoded encoded,
00402 void * user_data);
00403
00411 long fish_sound_decode (FishSound * fsound, unsigned char * buf, long bytes);
00412
00422 long fish_sound_encode (FishSound * fsound, float ** pcm, long frames);
00423
00429 long fish_sound_flush (FishSound * fsound);
00430
00436 int fish_sound_reset (FishSound * fsound);
00437
00443 int fish_sound_delete (FishSound * fsound);
00444
00453 int fish_sound_command (FishSound * fsound, int command, void * data,
00454 int datasize);
00455
00456 #endif