mirror of
https://github.com/1dot13/source.git
synced 2026-08-19 14:20:30 +02:00
- 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:
@@ -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 ));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user