커뮤니티 Q&A

Audiokinetic의 커뮤니티 Q&A 포럼에 오신 것을 환영합니다. 이 포럼은 Wwise와 Strata 사용자들이 서로 도움을 주는 곳입니다. Audiokinetic의 직접적인 도움을 얻으려면 지원 티켓 페이지를 사용하세요. 버그를 보고하려면 Audiokinetic 런처에서 Bug Report 옵션을 사용하세요. (Q&A 포럼에 제출된 버그 보고는 거절됩니다. 전용 Bug Report 시스템을 사용하면 보고 내용이 담당자에게 정확히 전달되어 문제 해결 가능성이 크게 높아집니다.)<segment 6493>

빠르고 정확한 답변을 얻으려면 질문을 올릴 때 다음 팁을 참고하세요.

  • 구체적인 내용을 적어주세요: 무엇을 하려는지, 혹은 어떤 특정 문제에 부딪혔는지 설명하세요.
  • 핵심 정보를 포함하세요: Wwise와 게임 엔진 버전, 운영체제 등 관련 정보를 함께 제공하세요.
  • 시도한 방법들을 알려주세요: 문제 해결을 위해 이미 어떤 단계를 시도해봤는지 설명해주세요.
  • 객관적인 사실에 초점을 맞추세요: 문제의 기술적 사실을 중심으로 설명하세요. 문제에 집중할수록 다른 사람들이 더 빠르게 해결책을 찾을 수 있습니다.

0 투표

Hello,

I am trying to utilize all of my outputs from my soundcard which are 8 aux outputs + 2 optical outputs.

I would like to create a UE blueprint callable function to post event to secondary outputs.

I have added another system audio device called "System_Optical" and created a master bus for it.

I did follow and combine some of tutorials and findings from users and the documents such as 

Integrating Secondary Outputs (audiokinetic.com)

Blog | Audiokinetic

Q & A | Audiokinetic

I got to a point where I could get my secondary outputs ID and Name correctly but I couldn't do AddOutput();

The result was "AK_NotInitialized(102)".

I don't really know where to start fixing. If anyone has any idea, please shed some light.

Here is my code (C++ Actor Class):


void AMyActor_WwiseCustom::PostEventOn2ndOutput(UAkAudioEvent* Event, UAkComponent* in_pComponent)
{
    FString deviceName = "S/PDIF";
    FString WwiseDeviceName = "System_Optical";
    AKRESULT res = AK_Fail;

    TTuple <AkUInt32, FString> result;
    AkUInt32 immDeviceCount = AK::GetWindowsDeviceCount(AkDeviceState_Active);

    for (AkUInt32 i = 0; i < immDeviceCount; ++i) {
        AkUInt32 deviceId = AK_INVALID_DEVICE_ID;
        AK::GetWindowsDevice(i, deviceId, NULL, AkDeviceState_Active);

        auto deviceNameWstr = AK::GetWindowsDeviceName(i, deviceId, AkDeviceState_Active);
        UE_LOG(LogAkAudio, Warning, TEXT("Windows Audio Device: %s"), deviceNameWstr);

        if (FString(deviceNameWstr).Contains(deviceName)) {
            result.Key = deviceId;
            result.Value = FString(deviceNameWstr);
            break;
        }
    }

    AkOutputDeviceID deviceId = AK_INVALID_DEVICE_ID;

    UE_LOG(LogAkAudio, Warning, TEXT("Device ID: %i"), result.Key);

    if (result.Key) {
        FOnAkPostEventCallback nullCallback;
        AkOutputSettings outputSettings(*WwiseDeviceName, result.Key);
        auto gameObjID = in_pComponent->GetAkGameObjectID();
        res = AK::SoundEngine::AddOutput(outputSettings, &deviceId, &gameObjID, 1);

        UAkGameplayStatics::PostEvent(Event, GetOwner(), int32(0), nullCallback);
    }
}


Really appreciate.

General Discussion SNAPtz (260 포인트) 로 부터

1 답변

0 투표
 
우수 답변

Hi there,

AK_NotInitialized means AddOutput() was called before the Sound Engine was in state where it is able to add a secondary output. The requirements are:

  1. The Sound Engine is initialized
  2. The Init bank is loaded
  3. The primary output device has been initialized (this is done automatically when the Init bank is finished loading).

If you want to add multiple outputs during the startup phase of your project, the best way would probably be to register a callback the primary device initialization using AK::SoundEngine::RegisterAudioDeviceStatusCallback. When you are notified that the primary device is up and running, now is the time to start adding secondary outputs.

Hope this helps,

Philippe Milot

Philippe M. (580 포인트) 로 부터
선택됨 SNAPtz 로 부터
Thank you very much Philippe. Luckily for us, Wwise exposed AddOutput in version 2022.1.6 which made it much easier to setup and call. We get it to work. However, I'll keep your answer in mind, in case we really need to go that route.
...