mirror of
https://github.com/celisej567/source-sdk-2013.git
synced 2026-09-23 20:09:45 +03:00
Added sound pitch scaling and env_microphone detection for sentences
This commit is contained in:
@@ -1417,6 +1417,45 @@ int SENTENCEG_Lookup(const char *sample)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(MAPBASE) && defined(GAME_DLL)
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Wrapper to emit a sentence and also a close caption token for the sentence as appropriate.
|
||||
// Input : filter -
|
||||
// iEntIndex -
|
||||
// iChannel -
|
||||
// iSentenceIndex -
|
||||
// flVolume -
|
||||
// iSoundlevel -
|
||||
// iFlags -
|
||||
// iPitch -
|
||||
// bUpdatePositions -
|
||||
// soundtime -
|
||||
//-----------------------------------------------------------------------------
|
||||
void CBaseEntity::EmitSentenceByIndex( IRecipientFilter& filter, int iEntIndex, int iChannel, int iSentenceIndex,
|
||||
float flVolume, soundlevel_t iSoundlevel, int iFlags /*= 0*/, int iPitch /*=PITCH_NORM*/,
|
||||
const Vector *pOrigin /*=NULL*/, const Vector *pDirection /*=NULL*/,
|
||||
bool bUpdatePositions /*=true*/, float soundtime /*=0.0f*/, int iSpecialDSP /*= 0*/, int iSpeakerIndex /*= 0*/ )
|
||||
{
|
||||
CUtlVector< Vector > soundOrigins;
|
||||
|
||||
bool bSwallowed = CEnvMicrophone::OnSentencePlayed(
|
||||
iEntIndex,
|
||||
iSentenceIndex,
|
||||
iSoundlevel,
|
||||
flVolume,
|
||||
iFlags,
|
||||
iPitch,
|
||||
pOrigin,
|
||||
soundtime,
|
||||
soundOrigins );
|
||||
if ( bSwallowed )
|
||||
return;
|
||||
|
||||
enginesound->EmitSentenceByIndex( filter, iEntIndex, iChannel, iSentenceIndex,
|
||||
flVolume, iSoundlevel, iFlags, iPitch * GetSoundPitchScale(), iSpecialDSP, pOrigin, pDirection, &soundOrigins, bUpdatePositions, soundtime, iSpeakerIndex );
|
||||
}
|
||||
#endif
|
||||
|
||||
void UTIL_EmitAmbientSound( int entindex, const Vector &vecOrigin, const char *samp, float vol, soundlevel_t soundlevel, int fFlags, int pitch, float soundtime /*= 0.0f*/, float *duration /*=NULL*/ )
|
||||
{
|
||||
#ifdef STAGING_ONLY
|
||||
|
||||
Reference in New Issue
Block a user