- Added a wrapper that takes care of determining the file type of audio files.

- Fix: 'hit' sounds of non-profile NPCs were not played correctly

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8580 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2018-07-21 15:02:44 +00:00
parent 69aeea0679
commit d66bdad9e3
7 changed files with 101 additions and 337 deletions
+4 -9
View File
@@ -345,19 +345,14 @@ BOOLEAN CameBackToVoicePageButNotFinished( )
UINT32 PlayVoice( void )
{
CHAR8 zFileName[164];
CHAR8 zFileNameHelp[164];
UINT16 iSlot = gIMPVoice[iCurrentVoice].voiceset;
Assert( (iSlot >= 0) && (iSlot <= 999) );
sprintf( zFileName, "Speech\\%03d_001.mp3", iSlot );
if ( !FileExists( zFileName ) )
{
sprintf( zFileName, "Speech\\%03d_001.ogg", iSlot );
if ( !FileExists( zFileName ) )
{
sprintf( zFileName, "Speech\\%03d_001.wav", iSlot );
}
}
sprintf( zFileNameHelp, "Speech\\%03d_001", iSlot );
SoundFileExists( zFileNameHelp, zFileName );
return(PlayJA2SampleFromFile( zFileName, RATE_11025, MIDVOLUME, 1, MIDDLEPAN ));
}