Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Core/GameEngine/Source/Common/Audio/AudioRequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,8 @@

AudioRequest::~AudioRequest()
{

if (m_usePendingEvent)
{
delete m_pendingEvent;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ class MilesAudioManager : public AudioManager
void initSamplePools();
void processRequest( AudioRequest *req );

void playAudioEvent( AudioEventRTS *event );
void playAudioEvent( AudioEventRTS*& event );
void stopAudioEvent( AudioHandle handle );
void pauseAudioEvent( AudioHandle handle );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ void MilesAudioManager::pauseAmbient( Bool shouldPause )
}

//-------------------------------------------------------------------------------------------------
void MilesAudioManager::playAudioEvent( AudioEventRTS *event )
void MilesAudioManager::playAudioEvent( AudioEventRTS*& event )
{
#ifdef INTENSIVE_AUDIO_DEBUG
DEBUG_LOG(("MILES (%d) - Processing play request: %d (%s)", TheGameLogic->getFrame(), event->getPlayingHandle(), event->getEventName().str()));
Expand Down Expand Up @@ -710,15 +710,16 @@ void MilesAudioManager::playAudioEvent( AudioEventRTS *event )

// Put this on here, so that the audio event RTS will be cleaned up regardless.
audio->m_audioEventRTS = event;
event = nullptr;
audio->m_stream = stream;
audio->m_type = PAT_Stream;

if (stream) {
if ((info->m_soundType == AT_Streaming) && event->getUninterruptible()) {
if ((info->m_soundType == AT_Streaming) && audio->m_audioEventRTS->getUninterruptible()) {
setDisallowSpeech(TRUE);
}
AIL_set_stream_volume_pan(stream, getEffectiveVolume(event), 0.5f);
playStream(event, stream);
AIL_set_stream_volume_pan(stream, getEffectiveVolume(audio->m_audioEventRTS), 0.5f);
playStream(audio->m_audioEventRTS, stream);
m_playingStreams.push_back(audio);
audio = nullptr;
}
Expand Down Expand Up @@ -779,13 +780,14 @@ void MilesAudioManager::playAudioEvent( AudioEventRTS *event )
}
// Push it onto the list of playing things
audio->m_audioEventRTS = event;
event = nullptr;
audio->m_3DSample = sample3D;
audio->m_file = nullptr;
audio->m_type = PAT_3DSample;
m_playing3DSounds.push_back(audio);

if (sample3D) {
audio->m_file = playSample3D(event, sample3D);
audio->m_file = playSample3D(audio->m_audioEventRTS, sample3D);
m_sound->notifyOf3DSampleStart();
}

Expand Down Expand Up @@ -850,13 +852,14 @@ void MilesAudioManager::playAudioEvent( AudioEventRTS *event )

// Push it onto the list of playing things
audio->m_audioEventRTS = event;
event = nullptr;
audio->m_sample = sample;
audio->m_file = nullptr;
audio->m_type = PAT_Sample;
m_playingSounds.push_back(audio);

if (sample) {
audio->m_file = playSample(event, sample);
audio->m_file = playSample(audio->m_audioEventRTS, sample);
m_sound->notifyOf2DSampleStart();
}

Expand Down
Loading