Main Page | Modules | Data Structures | File List | Data Fields | Globals

fishsound.h

Go to the documentation of this file.
00001 /*
00002    Copyright (c) 2002, 2003, Xiph.org Foundation
00003 
00004    Redistribution and use in source and binary forms, with or without
00005    modification, are permitted provided that the following conditions
00006    are met:
00007 
00008    - Redistributions of source code must retain the above copyright
00009    notice, this list of conditions and the following disclaimer.
00010 
00011    - Redistributions in binary form must reproduce the above copyright
00012    notice, this list of conditions and the following disclaimer in the
00013    documentation and/or other materials provided with the distribution.
00014 
00015    - Neither the name of the Xiph.org Foundation nor the names of its
00016    contributors may be used to endorse or promote products derived from
00017    this software without specific prior written permission.
00018 
00019    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00020    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00021    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00022    A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR
00023    CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00024    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00025    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00026    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00027    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00028    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00029    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
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 /* __FISH_SOUND_H__ */

Generated on Thu Mar 11 16:02:40 2004 for libfishsound by doxygen 1.3.5