1 /* 2 * OpenBOR - http://www.LavaLit.com 3 * ----------------------------------------------------------------------- 4 * All rights reserved, see LICENSE in OpenBOR root for details. 5 * 6 * Copyright (c) 2004 - 2011 OpenBOR Team 7 */ 8 9 #ifndef SOUNDMIX_H 10 #define SOUNDMIX_H 11 12 #include "types.h" 13 14 /* 15 ** Sound mixer. 16 ** Now supports ADPCM instead of MP3 (costs less CPU time). 17 ** 18 ** Also plays WAV files (unsigned, mono, both 8-bit and 16-bit). 19 */ 20 21 void sound_stop_playback(); 22 int sound_start_playback(int bits, int frequency); 23 void sound_exit(); 24 int sound_init(int channels); 25 26 27 // Returns interval in milliseconds 28 u32 sound_getinterval(); 29 int sound_load_sample(char *filename, char *packfilename, int iLog); 30 void sound_unload_sample(int index); 31 void sound_unload_all_samples(); 32 int sound_play_sample(int samplenum, unsigned int priority, int lvolume, int rvolume, unsigned int speed); 33 int sound_loop_sample(int samplenum, unsigned int priority, int lvolume, int rvolume, unsigned int speed); 34 void sound_stop_sample(int channel); 35 void sound_stopall_sample(); 36 void sound_pause_sample(int toggle); 37 void sound_volume_sample(int channel, int lvolume, int rvolume); 38 int sound_getpos_sample(int channel); 39 40 #ifdef DC 41 int sound_was_music_opened(); 42 #endif 43 44 int sound_open_music(char *filename, char *packname, int volume, int loop, u32 music_offset); 45 void sound_close_music(); 46 void sound_update_music(); 47 void sound_volume_music(int left, int right); 48 void sound_music_tempo(int music_tempo); 49 int sound_query_music(char *artist, char *title); 50 void sound_pause_music(int toggle); 51 52 void update_sample(unsigned char *buf,int size); 53 54 #endif 55