2 * Copyright (C) Volition, Inc. 1999. All rights reserved.
4 * All source code herein is the property of Volition, Inc. You may not sell
5 * or otherwise commercially exploit the source or things you created based on
10 * $Logfile: /Freespace2/code/Sound/AudioStr.h $
15 * Routines to stream large WAV files from disk
18 * Revision 1.2 2002/06/09 04:41:12 relnev
19 * added copyright header
21 * Revision 1.1.1.1 2002/05/03 03:28:12 root
25 * 2 10/07/98 10:54a Dave
28 * 1 10/07/98 10:51a Dave
31 * AL: Fix several bugs related to pausing and enabling/disabling event
35 * AL: Clean up all audio streams if necessary in
36 * event_music_level_close()
38 * 7 12/10/97 10:04p Lawrance
39 * modify what happens in Audio_stream constructor
41 * 6 12/09/97 6:14p Lawrance
44 * 5 11/20/97 1:06a Lawrance
45 * Add Master_voice_volume, make voices play back at correctly scaled
48 * 4 10/03/97 8:24a Lawrance
49 * When unpausing, be sure to retain looping status
51 * 3 9/18/97 10:31p Lawrance
52 * add functions to pause and unpause all audio streams
54 * 2 6/04/97 1:19p Lawrance
55 * added function to check if system is initialized
57 * 1 4/28/97 4:45p John
58 * Initial version of ripping sound & movie out of OsAPI.
60 * 8 4/14/97 1:52p Lawrance
61 * making transitions happen on measure boundries
63 * 7 4/09/97 11:14a Lawrance
64 * working on event music transitions
66 * 6 4/07/97 3:15p Lawrance
67 * allowing event music to pause
69 * 5 4/03/97 4:27p Lawrance
70 * expanding functionality to support event driven music
72 * 4 4/01/97 1:31p Lawrance
73 * make music fade quickly out when stopping. Delay onset of new music to
74 * allow old music to fade out.
76 * 3 3/31/97 5:45p Lawrance
77 * supporting changes to allow multiple streamed audio files
79 * 2 3/31/97 3:56p Lawrance
80 * decompress ADPCM->PCM for streaming sounds working
82 * 1 1/22/97 10:43a John
90 // type of audio stream
92 #define ASF_EVENTMUSIC 1
94 #define ASF_NONE 3 // used to catch errors
97 // Initializes the audio streaming library. Called
98 // automatically when the sound stuff is inited.
99 void audiostream_init();
101 // Closes down the audio streaming library
102 void audiostream_close();
104 // Opens a wave file but doesn't play it.
105 int audiostream_open( const char * filename, int type );
107 // Closes the opened wave file. This doesn't have to be
108 // called between songs, because when you open the next
109 // song, it will call this internally.
110 void audiostream_close_file(int i, int fade = 1);
112 void audiostream_close_all(int fade);
114 // Plays the currently opened wave file
115 void audiostream_play(int i, float volume = -1.0f, int looping = 1);
117 // See if a particular stream is playing
118 bool audiostream_is_playing(int i);
120 // Stops the currently opened wave file
121 void audiostream_stop(int i, int rewind = 1, int paused = 0);
123 // set the volume for every audio stream of a particular type
124 void audiostream_set_volume_all(float volume, int type);
126 // set the volume for a particular audio stream
127 void audiostream_set_volume(int i, float volume);
129 // see if a particular stream is paused
130 bool audiostream_is_paused(int i);
132 // set the number of bytes that the sound should cutoff after
133 void audiostream_set_byte_cutoff(int i, unsigned int cutoff);
135 // return the number of bytes streamed to the Direct Sound buffer so far
136 unsigned int audiostream_get_bytes_committed(int i);
138 // check if the streaming has read all the bytes from disk yet
139 bool audiostream_done_reading(int i);
141 // return if audiostream has initialized ok
142 int audiostream_is_inited();
144 void audiostream_pause(int i); // pause a particular stream
145 void audiostream_pause_all(); // pause all audio streams
147 void audiostream_unpause(int i); // unpause a particular stream
148 void audiostream_unpause_all(); // unpause all audio streams
150 #endif // _AUDIOSTR_H