コミュニティQ&A

Audiokineticのコミュニティ主導のQ&Aフォーラムへようこそ。ここはWwiseとStrataのユーザのみなさまがお互いに協力し合う場です。弊社チームによる直接のサポートをご希望の場合はサポートチケットページをご利用ください。バグを報告するには、Audiokinetic LauncherのBug Reportオプションをご利用ください。(Q&AフォーラムではBug Reportを受け付けておりませんのでご注意ください。専用のBug Reportシステムをご利用いただくことで、バグの報告が適切な担当部門に届き、修正される可能性が高まります。)

最適な回答を迅速に得られるよう、ご質問を投稿される際は以下のヒントをご参考ください。

  • 具体的に示す:何を達成したいのか、またはどんな問題に直面しているのかを具体的に示してください。
  • 重要な詳細情報を含める:Wwiseとゲームエンジンのバージョンやご利用のOSなど詳細情報を記載してください。
  • 試したことを説明する:すでに試してみたトラブルシューティングの手順を教えてください。
  • 事実に焦点を当てる:問題の技術的な事実を記載してください。問題に焦点を当てることで、ほかのユーザのみなさまが解決策を迅速に見つけやすくなります。

0 支持
Hi,

I'd like to find out the number of speakers/channels configured at runtime for Wwise (Windows in this case). Is there a simple way to do so? Ideally it would be something we could query periodically and update in case the output device changes in Windows.

Thank you,

Brent
Brent S. (140 ポイント) General Discussion

回答 1

0 支持
We are using Unreal (older integration) so I'll post my answer here if someone else needs it.

I added a call to register the bus volume callback for the master audio bus in the initialization routine.

    if (AK_Success != AK::SoundEngine::RegisterBusVolumeCallback(MASTER_AUDIO_BUS, AkMasterBusSpeakerVolumeMatrixCallback))
    {
        UE_LOG(LogInit, Warning, TEXT("Could not register the master bus volume callback."));
    }
 

Then had the callback set the rtpc based on the number of channels, removing the low frequency effects channel in the count if found.    

 

static const AkUniqueID MASTER_AUDIO_BUS = 3803692087U;
void FAkAudioDevice::AkMasterBusSpeakerVolumeMatrixCallback(AkSpeakerVolumeMatrixCallbackInfo *in_pCallbackInfo)
{
    static unsigned long LastNumChannels = 0xffffffff;

    if (in_pCallbackInfo
        && (in_pCallbackInfo->outputConfig.uNumChannels != LastNumChannels))
    {
        auto AudioDevice = FAkAudioDevice::Get();
        if (!AudioDevice)
        {
            return;
        }

        LastNumChannels = in_pCallbackInfo->outputConfig.uNumChannels;

        const FString& ChannelRtpc = GetDefault<UAkSettings>()->SpeakerChannelRtpcName;
        if (ChannelRtpc.Len())
        {
            // remove the .1 low frequency effects channel from the reported channel count
            const bool HasLFE = in_pCallbackInfo->outputConfig.HasLFE();
            const unsigned long ReportedChannels = LastNumChannels - (HasLFE ? 1 : 0);

            UE_LOG(LogAkAudio, Display, TEXT("Number of audio channels found: %d%s"), ReportedChannels, (HasLFE ? TEXT(".1") : TEXT("")));

            AudioDevice->SetRTPCValue(*ChannelRtpc, ReportedChannels);
        }
    }
}
Brent S. (140 ポイント)
...