2 * $Logfile: /Freespace2/code/Sound/AudioStr.h $
7 * Routines to stream large WAV files from disk
10 * Revision 1.1 2002/05/03 03:28:12 root
14 * 2 10/07/98 10:54a Dave
17 * 1 10/07/98 10:51a Dave
20 * AL: Fix several bugs related to pausing and enabling/disabling event
24 * AL: Clean up all audio streams if necessary in
25 * event_music_level_close()
27 * 7 12/10/97 10:04p Lawrance
28 * modify what happens in Audio_stream constructor
30 * 6 12/09/97 6:14p Lawrance
33 * 5 11/20/97 1:06a Lawrance
34 * Add Master_voice_volume, make voices play back at correctly scaled
37 * 4 10/03/97 8:24a Lawrance
38 * When unpausing, be sure to retain looping status
40 * 3 9/18/97 10:31p Lawrance
41 * add functions to pause and unpause all audio streams
43 * 2 6/04/97 1:19p Lawrance
44 * added function to check if system is initialized
46 * 1 4/28/97 4:45p John
47 * Initial version of ripping sound & movie out of OsAPI.
49 * 8 4/14/97 1:52p Lawrance
50 * making transitions happen on measure boundries
52 * 7 4/09/97 11:14a Lawrance
53 * working on event music transitions
55 * 6 4/07/97 3:15p Lawrance
56 * allowing event music to pause
58 * 5 4/03/97 4:27p Lawrance
59 * expanding functionality to support event driven music
61 * 4 4/01/97 1:31p Lawrance
62 * make music fade quickly out when stopping. Delay onset of new music to
63 * allow old music to fade out.
65 * 3 3/31/97 5:45p Lawrance
66 * supporting changes to allow multiple streamed audio files
68 * 2 3/31/97 3:56p Lawrance
69 * decompress ADPCM->PCM for streaming sounds working
71 * 1 1/22/97 10:43a John
79 // type of audio stream
81 #define ASF_EVENTMUSIC 1
83 #define ASF_NONE 3 // used to catch errors
86 // Initializes the audio streaming library. Called
87 // automatically when the sound stuff is inited.
88 void audiostream_init();
90 // Closes down the audio streaming library
91 void audiostream_close();
93 // Opens a wave file but doesn't play it.
94 int audiostream_open( char * filename, int type );
96 // Closes the opened wave file. This doesn't have to be
97 // called between songs, because when you open the next
98 // song, it will call this internally.
99 void audiostream_close_file(int i, int fade = 1);
101 void audiostream_close_all(int fade);
103 // Plays the currently opened wave file
104 void audiostream_play(int i, float volume = -1.0f, int looping = 1);
106 // See if a particular stream is playing
107 int audiostream_is_playing(int i);
109 // Stops the currently opened wave file
110 void audiostream_stop(int i, int rewind = 1, int paused = 0);
112 // set the volume for every audio stream of a particular type
113 void audiostream_set_volume_all(float volume, int type);
115 // set the volume for a particular audio stream
116 void audiostream_set_volume(int i, float volume);
118 // see if a particular stream is paused
119 int audiostream_is_paused(int i);
121 // set the number of bytes that the sound should cutoff after
122 void audiostream_set_byte_cutoff(int i, unsigned int cutoff);
124 // return the number of bytes streamed to the Direct Sound buffer so far
125 unsigned int audiostream_get_bytes_committed(int i);
127 // check if the streaming has read all the bytes from disk yet
128 int audiostream_done_reading(int i);
130 // return if audiostream has initialized ok
131 int audiostream_is_inited();
133 void audiostream_pause(int i); // pause a particular stream
134 void audiostream_pause_all(); // pause all audio streams
136 void audiostream_unpause(int i); // unpause a particular stream
137 void audiostream_unpause_all(); // unpause all audio streams
139 #endif // _AUDIOSTR_H