Neico pretty much nailed what I was in the process of writing.

At least back in the EP1 code base there was still code to handle the
original HL1 method of moving the player model mouths based on the
amplitude of the input audio. It basically moved a controller bone alone a
defined axis based on the volume making the jaw "flap". It's in the code
base for the HL1:Source port.

I used it myself and got the mouths of HL2 player models to move based on
the in-game voice volume so the code is still "valid".

I'd start looking there at the code that controls the jaw and look at where
to pull the amplitude out (a normalised value).

// Jed


On 8 May 2013 10:40, Neico <ad...@neic0.de> wrote:

>  You're only able to get which player is currently speaking by
> pPlayer->IsSpeaking() was the function I believe, for the waveforms, they
> are hidden behind an internal engine interface which you can't access under
> normal ways (if one got trough that feel free to write it down here), but
> I've been mimicing it by using random (the following code is taken from
> Garry's Lua code for moving the player's mouth and turned into C++ Code
> with a working solution), also note that this is client side code (I use it
> in CHL2MPPlayerAnimState::Update in case you want to know):
>
>     if( m_fVoiceTimeout >= gpGlobals->curtime ) return;
>     // If we had access to the volume or waveforms from the player one
> could replace the following line to use that instead of a Random Float, but
> this is as close as it'll get
>     if( GetClientVoiceMgr()->IsPlayerSpeaking( pHL2MPPlayer->entindex() )
> || ( pHL2MPPlayer->IsLocalPlayer() &&
> GetClientVoiceMgr()->IsLocalPlayerSpeaking() ) ) m_fVoice = (
> random->RandomFloat( 0.1f, 1.0f ) / m_fVoice );
>
>     LocalFlexController_t iFlexNum = pHL2MPPlayer->GetNumFlexControllers();
>     if( --iFlexNum <= 0 ) return;
>
>     for( LocalFlexController_t i = LocalFlexController_t( 0 ); i <
> iFlexNum; i++ )
>     {
>         const char* szName = pHL2MPPlayer->GetFlexControllerName( i );
>
>         if( !V_strcmp( szName, "jaw_drop" ) || !V_strcmp( szName,
> "right_part" ) || !V_strcmp( szName, "left_part" ) || !V_strcmp( szName,
> "right_mouth_drop" ) || !V_strcmp( szName, "left_mouth_drop" )  )
>         {
>             if( GetClientVoiceMgr()->IsPlayerSpeaking(
> pHL2MPPlayer->entindex() ) || ( pHL2MPPlayer->IsLocalPlayer() &&
> GetClientVoiceMgr()->IsLocalPlayerSpeaking() ) )
> pHL2MPPlayer->SetFlexWeight( i, clamp( m_fVoice * 2, 0, 2 ) );
>             else pHL2MPPlayer->SetFlexWeight( i, 0 );
>         }
>     }
>
>     m_fVoiceTimeout = gpGlobals->curtime + 0.2f;
>
> I hope this helps you figure out how to do whatever you're trying to
> archive
>
> On 08.05.2013 10:23, Garry Newman wrote:
>
> I don't think it's exposed to modders. I had to add engine code to get it
> in G(arry's )Mod.
>
>
> On Wed, May 8, 2013 at 3:52 AM, Jesse F <jesf...@gmail.com> wrote:
>
>> I was hoping someone might be able to help me out. I'd like access to
>> info about the waveforms sent by people using in game voice. I'd mainly
>> like to know how loud they are speaking (or some similar average value) and
>> I'd like to be able to keep a list updated with which players are speaking.
>> My initial search through the code for this functionality didn't turn up
>> much.
>>
>>  --
>> Jesse
>>
>> _______________________________________________
>> To unsubscribe, edit your list preferences, or view the list archives,
>> please visit:
>> https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders
>>
>>
>>
>
>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives, please 
> visit:https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders
>
>
>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives,
> please visit:
> https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders
>
>
>
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders

Reply via email to