1 /*---------------------------------------------------------------------------* 2 Project: Revolution SOUNDFILE dynamic link library 3 File: soundfile.h 4 5 Copyright (C)1998-2006 Nintendo All Rights Reserved. 6 7 These coded instructions, statements, and computer programs contain 8 proprietary information of Nintendo of America Inc. and/or Nintendo 9 Company Ltd., and are protected by Federal copyright law. They may 10 not be disclosed to third parties or copied or duplicated in any form, 11 in whole or in part, without the prior written consent of Nintendo. 12 13 $Log: soundfile.h,v $ 14 Revision 1.2 2006/02/09 06:51:39 aka 15 Changed copyright. 16 17 18 *---------------------------------------------------------------------------*/ 19 20 #ifndef __SOUNDFILE_H__ 21 #define __SOUNDFILE_H__ 22 23 /*--------------------------------------------------------------------------* 24 Status 25 *--------------------------------------------------------------------------*/ 26 #define SOUND_FILE_SUCCESS 0 27 #define SOUND_FILE_FORMAT_ERROR 1 28 #define SOUND_FILE_FOPEN_ERROR 2 29 #define SOUND_FILE_CORRUPTED 3 30 31 /*--------------------------------------------------------------------------* 32 SOUNDINFO struct 33 *--------------------------------------------------------------------------*/ 34 typedef struct 35 { 36 37 int channels; // Number of channels 38 int bitsPerSample; // Number of bits per sample 39 int sampleRate; // Sample rate in Hz 40 int samples; // Number for samples 41 int loopStart; // 1 based sample index for loop start 42 int loopEnd; // 1 based sample count for loop samples 43 int bufferLength; // buffer length in bytes 44 45 } SOUNDINFO; 46 47 48 /*--------------------------------------------------------------------------* 49 Function prototypes 50 *--------------------------------------------------------------------------*/ 51 int getSoundInfo (char *path, SOUNDINFO *info); 52 int getSoundSamples (char *path, SOUNDINFO *info, void *dest); 53 54 int writeWaveFile (char *path, SOUNDINFO *info, void *samples); 55 int writeAiffFile (char *path, SOUNDINFO *info, void *samples); 56 57 typedef int (*soundFileFnType1)(u8 *path, SOUNDINFO *soundinfo); 58 typedef int (*soundFileFnType2)(u8 *path, SOUNDINFO *soundinfo, void *dest); 59 typedef int (*soundFileFnType3)(char *path, SOUNDINFO *info, void *samples); 60 61 #endif // __SOUNDFILE_H__ 62