Audiokinetic's Community Q&A is the forum where users can ask and answer questions within the Wwise and Strata communities. If you would like to get an answer from Audiokinetic's Technical support team, make sure you use the Support Tickets page.

0 votes
Hi everyone,

I'd like to send some portion of a signal from a 2.0 audio bus to a 5.1 audio bus — but only to surround speakers (Ls, Rs). Is there a proven method for that in Wwise?
 

 

Best regards, Serge.
in General Discussion by Sergey E. (230 points)

1 Answer

0 votes

Hi Serge,

The best way to do that is with a speaker volume matrix callback.

Something like this ( although note i haven't compiled or tested the code ):

// consider using AK::SoundEngine::GetIDFromString to get this id
AkUint32 target_bus_id = 0x123456;

void speaker_volume_matrix_callback( AkSpeakerVolumeMatrixCallbackInfo* info ) {
    AkUniqueID bus_id = info->pMixerContext->GetBusID();
    if ( bus_id != target_bus_id ) {
        // or some other way to making sure you only do this when you need it
        return;
    }
    
    AKASSERT( info->outputConfig.uNumChannels == 6 );
    AKPLATFORM::AkMemSet( info->pVolumes, 0, sizeof( AkReal32 ) * info->outputConfig.uNumChannels );
    Ak::SpeakerVolumes::Matrix::VectorPtr ls = AK::SpeakerVolumes::Matrix::GetChannel( info->pVolumes, 4, 6 );
    ls[ 0 ] = 1.0f;
    Ak::SpeakerVolumes::Matrix::VectorPtr rs = AK::SpeakerVolumes::Matrix::GetChannel( info->pVolumes, 5, 6 );
    rs[ 1 ] = 1.0f;
}
by Dan M. (2.6k points)
Thank you Dan, I'll discuss this with our programmers. :)
...