1 #ifndef _SOUND_H_ 2 #define _SOUND_H_ 3 4 #include "pce.h" 5 6 extern UChar sound_driver; 7 8 #ifdef DJGPP 9 10 #ifdef BYTE 11 12 #undef BYTE 13 #undef WORD 14 #undef DWORD 15 16 #endif 17 18 #ifdef DJGPP 19 20 #include <audio.h> //SEAL include 21 22 extern HAC hVoice; 23 24 extern LPAUDIOWAVE lpWave; 25 26 #endif 27 28 #include <libamp.h> 29 30 #endif 31 32 #include "cleantyp.h" 33 34 #define SOUND_BUF_MS 200 35 // I think it's too long but for a beginning it'll be enough 36 37 //#define SBUF_SIZE_BYTE 44100*SOUND_BUF_MS/1000 38 // Calculated for mono sound 39 #define SBUF_SIZE_BYTE 1024*8 40 41 42 #ifdef ALLEGRO 43 44 extern AUDIOSTREAM* PCM_stream; 45 46 extern SAMPLE *CD_sample; 47 48 #endif 49 50 extern unsigned char * big_buf; 51 52 extern UChar gen_vol; 53 54 extern UInt32 sbuf_size; 55 56 extern char* sbuf[6];//[SBUF_SIZE_BYTE]; 57 // the buffer where the "DATA-TO-SEND-TO-THE-SOUND-CARD" go 58 // one for each channel 59 60 extern char* adpcmbuf; 61 62 extern UChar new_adpcm_play; 63 // Have we begun a new adpcm sample (i.e. must be reset adpcm index/prev value) 64 65 #ifndef SDL 66 67 extern char main_buf[SBUF_SIZE_BYTE]; 68 // the mixed buffer, may be removed later for hard mixing... 69 70 #else 71 72 extern UChar main_buf[SBUF_SIZE_BYTE]; 73 // the mixed buffer, may be removed later for hard mixing... 74 75 #endif 76 77 extern UInt32 CycleOld; 78 extern UInt32 CycleNew; 79 // indicates the last time music has been "released" 80 81 extern UInt32 dwNewPos; 82 83 extern UInt32 AdpcmFilledBuf; 84 85 extern char MP3_playing; 86 // is MP3 playing ? 87 88 int InitSound(void); 89 void TrashSound(void); 90 void write_psg(int ch); 91 void WriteBuffer(char *, int, unsigned); 92 93 void write_adpcm(void); 94 void dump_audio_chunck(UChar* content, int length); 95 96 int start_dump_audio(void); 97 void stop_dump_audio(void); 98 99 #endif // HDEF_SOUND_H 100