// back-indented fields new in TA codebase, will re-format when MP3 code finished -ste
// note: field missing in TA: qboolean loopSound; // from an S_AddLoopSound call, cleared each frame
//
intstartSample;// START_SAMPLE_IMMEDIATE = set immediately on next mix
intentnum;// to allow overriding a specific sound
intentchannel;// to allow overriding a specific sound
intleftvol;// 0-255 volume after spatialization
intrightvol;// 0-255 volume after spatialization
intmaster_vol;// 0-255 volume before spatialization
vec3_torigin;// only use if fixed_origin is set
qbooleanfixed_origin;// use origin instead of fetching entnum's origin
sfx_t*thesfx;// sfx structure
qbooleanloopSound;// from an S_AddLoopSound call, cleared each frame
//
MP3STREAMMP3StreamHeader;
byteMP3SlidingDecodeBuffer[50000/*12000*/];// typical back-request = -3072, so roughly double is 6000 (safety), then doubled again so the 6K pos is in the middle of the buffer)
intiMP3SlidingDecodeWritePos;
intiMP3SlidingDecodeWindowPos;
// Open AL specific
boolbLooping;// Signifies if this channel / source is playing a looping sound
// bool bAmbient; // Signifies if this channel / source is playing a looping ambient sound
boolbProcessed;// Signifies if this channel / source has been processed
boolbStreaming;// Set to true if the data needs to be streamed (MP3 or dialogue)
STREAMINGBUFFERbuffers[NUM_STREAMING_BUFFERS];// AL Buffers for streaming
ALuintalSource;// Open AL Source
boolbPlaying;// Set to true when a sound is playing on this channel / source
intiStartTime;// Time playback of Source begins
}channel_t;
#define WAV_FORMAT_PCM 1
#define WAV_FORMAT_ADPCM 2 // not actually implemented, but is the value that you get in a header
#define WAV_FORMAT_MP3 3 // not actually used this way, but just ensures we don't match one of the legit formats
typedefstruct{
intformat;
intrate;
intwidth;
intchannels;
intsamples;
intdataofs;// chunk starts this many bytes from file start