coastline 0.0.4
Loading...
Searching...
No Matches
soundbuffer.h File Reference

The buffers and the channels of the sound effects of the PC port. More...

#include <windows.h>
#include <dsound.h>
#include "common/assetnames.h"
#include "common/soundbank.h"
#include "common/soundsample.h"
#include "common/soundsystem.h"
#include "ear/wavechunks.h"
Include dependency graph for soundbuffer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SoundBufferNode
 A sound buffer of a sample, in a list. More...

Enumerations

enum  { SOUND_SET_FRONT_END , SOUND_SET_RACE }
 The sets of sounds of LoadSoundSet(). More...

Functions

HRESULT CreateDirectSoundBufferFromSample (SoundBufferNode *pNode)
 Create the buffer of DirectSound of a sample, static with control of the frequency, the pan, the volume, and the position, and copy the sample into it.
HRESULT ReleaseSoundBuffer (SoundBufferNode *pNode)
 Release the buffer of DirectSound of a node.
HRESULT StopSoundBuffer (SoundBufferNode *pNode)
 Stop the buffer of DirectSound of a node that plays.
bool IsSoundChannelPlaying (int nChannel)
 Report whether the buffer of a channel plays, when sound is on.
bool SetAudioChannelLooping (int nChannel, int bLooping)
 Set whether the buffer of a channel plays in a loop, when sound is on.
void SetSoundBankEntryIndex (int nVoice, int nIndex)
 Record a sound for the even channel of a voice in the first row of the banks and in the rows of the variants and the looping sounds, as one more than its index.
void ResetSoundBankTables (void)
 Clear the first entries of the three tables of the banks of sounds.
int AppendSoundBufferToList (SoundBufferNode *pHead, SoundBufferNode *pNode)
 Add a node at the end of a list of sound buffers, not playing.
HRESULT ApplySoundBufferPan (SoundBufferNode *pNode)
 Set the pan of the buffer of a node from nPan.
HRESULT ApplySoundBufferFrequency (SoundBufferNode *pNode)
 Set the frequency of the buffer of a node from dwFrequency.
HRESULT ApplySoundBufferVolume (SoundBufferNode *pNode)
 Set the volume of the buffer of a node from nVolume scaled by g_bSfxVolume, or silence it when the sound effects are off.
HRESULT RestartOrPlaySoundBuffer (SoundBufferNode *pNode)
 Play the buffer of a node from its start: a buffer that plays goes back to its start, and one that does not starts, in a loop when bLooping is set, and is marked as playing.
HRESULT PlaySoundBuffer (SoundBufferNode *pNode, int bLooping)
 Set whether the buffer of a node loops and play it from its start.
bool SetSoundBufferFrequency (SoundBufferNode *pNode, DWORD dwFrequency)
 Set the frequency of the buffer of a node, when sound is on.
bool IsSoundBufferPlaying (SoundBufferNode *pNode)
 Report whether the buffer of a node plays.
bool SetSoundChannelFrequency (int nSample, int nChannel, DWORD dwFrequency)
 Set the frequency of a channel of a sample, when sound is on.
bool SetSoundVoiceFrequencyFloat (int nSample, int nVoice, float fFrequency)
 Set the frequency of the even channel of a voice of a sample, dropping the fraction.
bool StopSoundVoice (int nSample, int nVoice)
 Stop the buffer of the first channel of a voice of a sample, when sound is on.
bool SetSoundBufferStereoLevels (SoundBufferNode *pNode, DWORD dwLevels)
 Set the volume and the pan of the buffer of a node from the levels of its two sides.
bool SetAudioChannelStereoLevels (int nChannel, DWORD dwLevels)
 Set the levels of the two sides of the buffer of a channel and record them, when sound is on.
bool AssignAudioChannel (int nSample, int nChannel)
 Stop the buffer of a channel and give the channel the buffer of a sample for it, when sound is on.
bool SetAudioChannelFrequency (int nChannel, long long llFrequency)
 Set the frequency of the buffer of a channel, scaled by its sample, and record it, when sound is on.
bool StartSoundChannelPlayback (int nSample, int nChannel, int bLooping)
 Play the buffer of a sample for a channel and give it to the channel, when sound is on.
bool InitSoundChannelWithVolume (short nChannel, int nSample, int nLength, int nLoopLength, DWORD dwLevels)
 Request a sample and levels for a channel, give the channel the buffer of the sample, and play it.
bool SetStereoAndPlaySoundChannel (int nSample, int nChannel, DWORD dwLevels, int bLooping)
 Set the levels of the two sides of a channel of a sample and play it, when sound is on.
bool PlaySoundChannelOneWithStereo (int nSample, DWORD dwLevels, int bLooping)
 Set the levels of the two sides of channel 1 of a sample and play it.
bool SetSoundChannelStereo (int nSample, int nChannel, DWORD dwLevels)
 Set the levels of the two sides of a channel of a sample, when sound is on.
bool SetSoundVoiceStereo (int nSample, int nVoice, DWORD dwLevels)
 Set the levels of the two sides of the even channel of a voice of a sample.
bool PlaySoundChannelOneOnce (int nSample, DWORD dwLevels)
 Set the levels of the two sides of channel 1 of a sample and play it once.
bool PlayLoopedSoundVoiceWithStereo (int nSample, int nVoice, DWORD dwLevels)
 Set the levels of the two sides of the even channel of a voice of a sample and play it in a loop.
SoundBufferNode * LoadAudioFile (const char *pszPath, int sample=-1)
 Load a wave file into a node of a buffer of DirectSound at the end of g_SoundBufferListHead, at its own frequency, the centre, and the volume of the sound effects.
bool LoadSfxWaveVariants (int nEffect)
 Load the three files of a sound effect of a race, named by the prefixes the banks of sounds select for its channel: the wave (.wav), the variant (h.wav), and the looping sound (r.wav).
bool LoadSoundSet (int nSet)
 Load the samples of a set of sounds into the channels the banks of sounds enable, from the second sample to the one before the last.
HRESULT StopAllSoundBuffersInList (SoundBufferNode *pHead)
 Stop every sound buffer of a list.
HRESULT FreeSoundBufferList (SoundBufferNode *pHead)
 Release and free every node of a list of sound buffers, with the sample and the format of each, and empty the list.
bool InitializeDirectSound (void)
 Add a user of DirectSound when sound effects play.
bool ShutdownDirectSound (void)
 Drop a user of DirectSound.

Variables

IDirectSound * g_pDirectSound
 DirectSound.
IDirectSoundBuffer * g_pDirectSoundPrimaryBuffer
 The primary buffer of DirectSound.
WAVEFORMATEX * g_pDirectSoundWaveFormat
 The wave format of the primary buffer, in locked global memory.
int g_dwDirectSoundRefCount
 The users of DirectSound.
SoundBufferNode g_SoundBufferListHead
 The head of the list of the sound buffers.
SoundBufferNode * g_apSoundChannelBuffer [SOUND_CHANNEL_COUNT]
 The sound buffers of the channels of the sound effects.
int g_dwLoadedSoundSampleCount
 The number of entries of g_aSoundChannelBuffers that are loaded.
SoundChannelState g_aSoundChannelState [SOUND_CHANNEL_COUNT]
 The settings last applied to the buffer of each channel.
double g_adChannelFrequencyScale [SOUND_CHANNEL_COUNT]
 The scale of a frequency of each channel, from the sample assigned to it.

Detailed Description

The buffers and the channels of the sound effects of the PC port.

The Windows libraries play each buffer through DirectSound, and the SDL game through a buffer of the mixer of EAR.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

The sets of sounds of LoadSoundSet().

Enumerator
SOUND_SET_FRONT_END 

The sounds of the front end.

SOUND_SET_RACE 

The sounds of a race.

Function Documentation

◆ CreateDirectSoundBufferFromSample()

HRESULT CreateDirectSoundBufferFromSample ( SoundBufferNode * pNode)

Create the buffer of DirectSound of a sample, static with control of the frequency, the pan, the volume, and the position, and copy the sample into it.

The volume is set full and the pan centred, and bHardware records where the buffer is. A step that fails releases the buffer.

Parameters
pNodeThe node of the sample.
Returns
DS_OK, or the error of the step that failed.
Ghidra address:
BRD3D: 0x100722d0
Ghidra address:
BRGlide: 0x1006b240

◆ ReleaseSoundBuffer()

HRESULT ReleaseSoundBuffer ( SoundBufferNode * pNode)

Release the buffer of DirectSound of a node.

Parameters
pNodeThe node.
Returns
Always DS_OK.
Ghidra address:
BRD3D: 0x10072520
Ghidra address:
BRGlide: 0x1006b490

◆ StopSoundBuffer()

HRESULT StopSoundBuffer ( SoundBufferNode * pNode)

Stop the buffer of DirectSound of a node that plays.

Parameters
pNodeThe node.
Returns
The result of the stop, or DS_OK for a buffer that does not play.
Ghidra address:
BRD3D: 0x10072550
Ghidra address:
BRGlide: 0x1006b4c0

◆ IsSoundChannelPlaying()

bool IsSoundChannelPlaying ( int nChannel)

Report whether the buffer of a channel plays, when sound is on.

Parameters
nChannelThe channel.
Returns
Whether it plays, false without a buffer, and true without sound.
Ghidra address:
BRD3D: 0x10072fe0
Ghidra address:
BRGlide: 0x1006bf50

◆ SetAudioChannelLooping()

bool SetAudioChannelLooping ( int nChannel,
int bLooping )

Set whether the buffer of a channel plays in a loop, when sound is on.

Parameters
nChannelThe channel.
bLoopingWhether it loops.
Returns
Whether it was set, false without a buffer, and true without sound.
Ghidra address:
BRD3D: 0x10072640
Ghidra address:
BRGlide: 0x1006b5b0

◆ SetSoundBankEntryIndex()

void SetSoundBankEntryIndex ( int nVoice,
int nIndex )

Record a sound for the even channel of a voice in the first row of the banks and in the rows of the variants and the looping sounds, as one more than its index.

Parameters
nVoiceThe voice, half the channel.
nIndexThe index of the sound.
Ghidra address:
BRD3D: 0x10073080
Ghidra address:
BRGlide: 0x1006bff0

◆ ResetSoundBankTables()

void ResetSoundBankTables ( void )

Clear the first entries of the three tables of the banks of sounds.

Ghidra address:
BRD3D: 0x10073060
Ghidra address:
BRGlide: 0x1006bfd0

◆ AppendSoundBufferToList()

int AppendSoundBufferToList ( SoundBufferNode * pHead,
SoundBufferNode * pNode )

Add a node at the end of a list of sound buffers, not playing.

Parameters
pHeadThe head of the list.
pNodeThe node.
Returns
Always 0.
Ghidra address:
BRD3D: 0x10072450
Ghidra address:
BRGlide: 0x1006b3c0

◆ ApplySoundBufferPan()

HRESULT ApplySoundBufferPan ( SoundBufferNode * pNode)

Set the pan of the buffer of a node from nPan.

Parameters
pNodeThe node.
Returns
The result of SetPan().
Ghidra address:
BRD3D: 0x10072490
Ghidra address:
BRGlide: 0x1006b400

◆ ApplySoundBufferFrequency()

HRESULT ApplySoundBufferFrequency ( SoundBufferNode * pNode)

Set the frequency of the buffer of a node from dwFrequency.

Parameters
pNodeThe node.
Returns
The result of SetFrequency().
Ghidra address:
BRD3D: 0x100724b0
Ghidra address:
BRGlide: 0x1006b420

◆ ApplySoundBufferVolume()

HRESULT ApplySoundBufferVolume ( SoundBufferNode * pNode)

Set the volume of the buffer of a node from nVolume scaled by g_bSfxVolume, or silence it when the sound effects are off.

Parameters
pNodeThe node.
Returns
The result of SetVolume().
Ghidra address:
BRD3D: 0x100724d0
Ghidra address:
BRGlide: 0x1006b440

◆ RestartOrPlaySoundBuffer()

HRESULT RestartOrPlaySoundBuffer ( SoundBufferNode * pNode)

Play the buffer of a node from its start: a buffer that plays goes back to its start, and one that does not starts, in a loop when bLooping is set, and is marked as playing.

Parameters
pNodeThe node.
Returns
The result of SetCurrentPosition() or Play().
Ghidra address:
BRD3D: 0x10072a00
Ghidra address:
BRGlide: 0x1006b970

◆ PlaySoundBuffer()

HRESULT PlaySoundBuffer ( SoundBufferNode * pNode,
int bLooping )

Set whether the buffer of a node loops and play it from its start.

Parameters
pNodeThe node.
bLoopingWhether the buffer plays in a loop.
Returns
The result of RestartOrPlaySoundBuffer().
Ghidra address:
BRD3D: 0x100729e0
Ghidra address:
BRGlide: 0x1006b950

◆ SetSoundBufferFrequency()

bool SetSoundBufferFrequency ( SoundBufferNode * pNode,
DWORD dwFrequency )

Set the frequency of the buffer of a node, when sound is on.

Parameters
pNodeThe node.
dwFrequencyThe frequency, in samples a second.
Returns
Whether the frequency was set, and true without sound.
Ghidra address:
BRD3D: 0x10072700
Ghidra address:
BRGlide: 0x1006b670

◆ IsSoundBufferPlaying()

bool IsSoundBufferPlaying ( SoundBufferNode * pNode)

Report whether the buffer of a node plays.

Parameters
pNodeThe node.
Returns
Whether it plays, and false when its status cannot be read.
Ghidra address:
BRD3D: 0x10073020
Ghidra address:
BRGlide: 0x1006bf90

◆ SetSoundChannelFrequency()

bool SetSoundChannelFrequency ( int nSample,
int nChannel,
DWORD dwFrequency )

Set the frequency of a channel of a sample, when sound is on.

Parameters
nSampleThe sample.
nChannelThe channel.
dwFrequencyThe frequency, in samples a second.
Returns
Whether the frequency was set, and true without sound.
Ghidra address:
BRD3D: 0x10072770
Ghidra address:
BRGlide: 0x1006b6e0

◆ SetSoundVoiceFrequencyFloat()

bool SetSoundVoiceFrequencyFloat ( int nSample,
int nVoice,
float fFrequency )

Set the frequency of the even channel of a voice of a sample, dropping the fraction.

Parameters
nSampleThe sample.
nVoiceThe voice, half the channel.
fFrequencyThe frequency, in samples a second.
Returns
The result of SetSoundChannelFrequency().
Ghidra address:
BRD3D: 0x10072750
Ghidra address:
BRGlide: 0x1006b6c0

◆ StopSoundVoice()

bool StopSoundVoice ( int nSample,
int nVoice )

Stop the buffer of the first channel of a voice of a sample, when sound is on.

Parameters
nSampleThe sample.
nVoiceThe voice. Its first channel is twice the voice.
Returns
Whether the buffer stopped, and true without a buffer or without sound.
Ghidra address:
BRD3D: 0x10072ba0
Ghidra address:
BRGlide: 0x1006bb10

◆ SetSoundBufferStereoLevels()

bool SetSoundBufferStereoLevels ( SoundBufferNode * pNode,
DWORD dwLevels )

Set the volume and the pan of the buffer of a node from the levels of its two sides.

Parameters
pNodeThe node.
dwLevelsThe level of the left side in the high word and of the right in the low word, each up to 32.
Returns
Whether the levels were set.
Ghidra address:
BRD3D: 0x10072820
Ghidra address:
BRGlide: 0x1006b790

◆ SetAudioChannelStereoLevels()

bool SetAudioChannelStereoLevels ( int nChannel,
DWORD dwLevels )

Set the levels of the two sides of the buffer of a channel and record them, when sound is on.

Parameters
nChannelThe channel.
dwLevelsThe levels, as SetSoundBufferStereoLevels().
Returns
Whether the levels were set, and true without sound.
Ghidra address:
BRD3D: 0x100727c0
Ghidra address:
BRGlide: 0x1006b730

◆ AssignAudioChannel()

bool AssignAudioChannel ( int nSample,
int nChannel )

Stop the buffer of a channel and give the channel the buffer of a sample for it, when sound is on.

Parameters
nSampleThe sample.
nChannelThe channel.
Returns
Whether the sample has a buffer for the channel, and true without sound.
Ghidra address:
BRD3D: 0x100725c0
Ghidra address:
BRGlide: 0x1006b530

◆ SetAudioChannelFrequency()

bool SetAudioChannelFrequency ( int nChannel,
long long llFrequency )

Set the frequency of the buffer of a channel, scaled by its sample, and record it, when sound is on.

Parameters
nChannelThe channel.
llFrequencyThe frequency in units of 2 to the power of -32.
Returns
Whether the frequency was set, and true without sound.
Ghidra address:
BRD3D: 0x10072680
Ghidra address:
BRGlide: 0x1006b5f0

◆ StartSoundChannelPlayback()

bool StartSoundChannelPlayback ( int nSample,
int nChannel,
int bLooping )

Play the buffer of a sample for a channel and give it to the channel, when sound is on.

The frequency of the buffer, without the scale of the channel, is requested and recorded.

Parameters
nSampleThe sample.
nChannelThe channel.
bLoopingWhether the buffer plays in a loop.
Returns
Whether the buffer plays, false without a buffer, and true without sound.
Ghidra address:
BRD3D: 0x10072910
Ghidra address:
BRGlide: 0x1006b880

◆ InitSoundChannelWithVolume()

bool InitSoundChannelWithVolume ( short nChannel,
int nSample,
int nLength,
int nLoopLength,
DWORD dwLevels )

Request a sample and levels for a channel, give the channel the buffer of the sample, and play it.

Parameters
nChannelThe channel.
nSampleThe sample.
nLengthThe length of the sample, which is not read.
nLoopLengthThe length of the loop of the sample, where any value but 0 plays it in a loop.
dwLevelsThe levels, as SetSoundBufferStereoLevels().
Returns
Whether the buffer plays, and false when the sample has no buffer for the channel.
Ghidra address:
BRD3D: 0x10075260
Ghidra address:
BRGlide: 0x1006e4c0

◆ SetStereoAndPlaySoundChannel()

bool SetStereoAndPlaySoundChannel ( int nSample,
int nChannel,
DWORD dwLevels,
int bLooping )

Set the levels of the two sides of a channel of a sample and play it, when sound is on.

Parameters
nSampleThe sample, an index into g_aSoundChannelBuffers.
nChannelThe channel.
dwLevelsThe levels, as SetSoundBufferStereoLevels() takes them.
bLoopingWhether the buffer plays in a loop.
Returns
Whether the levels were set and the buffer played, and true without sound.
Ghidra address:
BRD3D: 0x10072a90
Ghidra address:
BRGlide: 0x1006ba00

◆ PlaySoundChannelOneWithStereo()

bool PlaySoundChannelOneWithStereo ( int nSample,
DWORD dwLevels,
int bLooping )

Set the levels of the two sides of channel 1 of a sample and play it.

Parameters
nSampleThe sample.
dwLevelsThe levels, as SetSoundBufferStereoLevels() takes them.
bLoopingWhether the buffer plays in a loop.
Returns
The result of SetStereoAndPlaySoundChannel().
Ghidra address:
BRD3D: 0x10072a70
Ghidra address:
BRGlide: 0x1006b9e0

◆ SetSoundChannelStereo()

bool SetSoundChannelStereo ( int nSample,
int nChannel,
DWORD dwLevels )

Set the levels of the two sides of a channel of a sample, when sound is on.

Parameters
nSampleThe sample.
nChannelThe channel.
dwLevelsThe levels, as SetSoundBufferStereoLevels() takes them.
Returns
Whether the levels were set, and true without sound.
Ghidra address:
BRD3D: 0x10072b30
Ghidra address:
BRGlide: 0x1006baa0

◆ SetSoundVoiceStereo()

bool SetSoundVoiceStereo ( int nSample,
int nVoice,
DWORD dwLevels )

Set the levels of the two sides of the even channel of a voice of a sample.

Parameters
nSampleThe sample.
nVoiceThe voice, half the channel.
dwLevelsThe levels, as SetSoundBufferStereoLevels() takes them.
Returns
The result of SetSoundChannelStereo().
Ghidra address:
BRD3D: 0x10072b80
Ghidra address:
BRGlide: 0x1006baf0

◆ PlaySoundChannelOneOnce()

bool PlaySoundChannelOneOnce ( int nSample,
DWORD dwLevels )

Set the levels of the two sides of channel 1 of a sample and play it once.

Parameters
nSampleThe sample.
dwLevelsThe levels, as SetSoundBufferStereoLevels() takes them.
Returns
The result of PlaySoundChannelOneWithStereo().
Ghidra address:
BRD3D: 0x10072af0
Ghidra address:
BRGlide: 0x1006ba60

◆ PlayLoopedSoundVoiceWithStereo()

bool PlayLoopedSoundVoiceWithStereo ( int nSample,
int nVoice,
DWORD dwLevels )

Set the levels of the two sides of the even channel of a voice of a sample and play it in a loop.

Parameters
nSampleThe sample.
nVoiceThe voice, half the channel.
dwLevelsThe levels, as SetSoundBufferStereoLevels() takes them.
Returns
The result of SetStereoAndPlaySoundChannel().
Ghidra address:
BRD3D: 0x10072b10
Ghidra address:
BRGlide: 0x1006ba80

◆ LoadAudioFile()

SoundBufferNode * LoadAudioFile ( const char * pszPath,
int sample = -1 )

Load a wave file into a node of a buffer of DirectSound at the end of g_SoundBufferListHead, at its own frequency, the centre, and the volume of the sound effects.

A step that fails frees what it created.

Parameters
pszPathThe path of the file.
Returns
The node, or null.
Ghidra address:
BRD3D: 0x10072ca0
Ghidra address:
BRGlide: 0x1006bc10
Parameters
sampleThe SDL sample index, or -1 for no assigned sample.

◆ LoadSfxWaveVariants()

bool LoadSfxWaveVariants ( int nEffect)

Load the three files of a sound effect of a race, named by the prefixes the banks of sounds select for its channel: the wave (.wav), the variant (h.wav), and the looping sound (r.wav).

Without sound, or when the first bank does not enable the channel, the three are cleared.

Parameters
nEffectThe effect, half the channel.
Returns
Whether the files loaded, and false at once when the looping sound does not.
Ghidra address:
BRD3D: 0x100730a0
Ghidra address:
BRGlide: 0x1006c010

◆ LoadSoundSet()

bool LoadSoundSet ( int nSet)

Load the samples of a set of sounds into the channels the banks of sounds enable, from the second sample to the one before the last.

The set of a race first loads the variants of its sound effects. Nothing loads without sound.

Parameters
nSetThe set, by the SOUND_SET_ values.
Returns
Whether every sample loaded.
Ghidra address:
BRD3D: 0x10073320
Ghidra address:
BRGlide: 0x1006c290

◆ StopAllSoundBuffersInList()

HRESULT StopAllSoundBuffersInList ( SoundBufferNode * pHead)

Stop every sound buffer of a list.

Parameters
pHeadThe head of the list.
Returns
Always DS_OK.
Ghidra address:
BRD3D: 0x10072bf0
Ghidra address:
BRGlide: 0x1006bb60

◆ FreeSoundBufferList()

HRESULT FreeSoundBufferList ( SoundBufferNode * pHead)

Release and free every node of a list of sound buffers, with the sample and the format of each, and empty the list.

The head is not freed.

Parameters
pHeadThe head of the list.
Returns
Always DS_OK.
Ghidra address:
BRD3D: 0x10072c20
Ghidra address:
BRGlide: 0x1006bb90

◆ InitializeDirectSound()

bool InitializeDirectSound ( void )

Add a user of DirectSound when sound effects play.

The first user clears the channels and the banks, allocates the wave format of 22050 Hz, 16 bits, and two channels, and creates DirectSound with priority and its primary buffer, playing in a loop. A step that fails releases what it created.

Returns
Whether the last step succeeded, and true without sound effects or for a later user.
Ghidra address:
BRD3D: 0x10073560
Ghidra address:
BRGlide: 0x1006c4d0

◆ ShutdownDirectSound()

bool ShutdownDirectSound ( void )

Drop a user of DirectSound.

The last user resets the audio, stops and releases the primary buffer and DirectSound, and frees the wave format and the list of sound buffers.

Returns
Always true.
Ghidra address:
BRD3D: 0x10073730
Ghidra address:
BRGlide: 0x1006c6a0

Variable Documentation

◆ g_pDirectSound

IDirectSound* g_pDirectSound
extern

DirectSound.

Ghidra address:
BRD3D: 0x118290f8
Ghidra address:
BRGlide: 0x1184c458

◆ g_pDirectSoundPrimaryBuffer

IDirectSoundBuffer* g_pDirectSoundPrimaryBuffer
extern

The primary buffer of DirectSound.

Ghidra address:
BRD3D: 0x11828fe4
Ghidra address:
BRGlide: 0x1184c344

◆ g_pDirectSoundWaveFormat

WAVEFORMATEX* g_pDirectSoundWaveFormat
extern

The wave format of the primary buffer, in locked global memory.

Ghidra address:
BRD3D: 0x11828f50
Ghidra address:
BRGlide: 0x1184c2b0

◆ g_dwDirectSoundRefCount

int g_dwDirectSoundRefCount
extern

The users of DirectSound.

The last ShutdownDirectSound() releases it.

Ghidra address:
BRD3D: 0x118290fc
Ghidra address:
BRGlide: 0x1184c45c

◆ g_SoundBufferListHead

SoundBufferNode g_SoundBufferListHead
extern

The head of the list of the sound buffers.

Only its first member and its link are read here.

Ghidra address:
BRD3D: 0x11828f48
Ghidra address:
BRGlide: 0x1184c2a8

◆ g_apSoundChannelBuffer

SoundBufferNode* g_apSoundChannelBuffer[SOUND_CHANNEL_COUNT]
extern

The sound buffers of the channels of the sound effects.

Ghidra address:
BRD3D: 0x11828f08
Ghidra address:
BRGlide: 0x1184c268

◆ g_dwLoadedSoundSampleCount

int g_dwLoadedSoundSampleCount
extern

The number of entries of g_aSoundChannelBuffers that are loaded.

Ghidra address:
BRD3D: 0x11828f00
Ghidra address:
BRGlide: 0x1184c260

◆ g_aSoundChannelState

SoundChannelState g_aSoundChannelState[SOUND_CHANNEL_COUNT]
extern

The settings last applied to the buffer of each channel.

Ghidra address:
BRD3D: 0x11828d20
Ghidra address:
BRGlide: 0x1184c080

◆ g_adChannelFrequencyScale

double g_adChannelFrequencyScale[SOUND_CHANNEL_COUNT]
extern

The scale of a frequency of each channel, from the sample assigned to it.

Ghidra address:
BRD3D: 0x11828e88
Ghidra address:
BRGlide: 0x1184c1e8