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.

Using Audio Input plugin in UE4

0 votes

Hello.  I'd like to use the Audio input plugin in C++ with UE4.

As background information, let me show you how I fist created a simple gunshot sound I was able to create with the First Person Template.

So I first load the bank from the BeginPlay().  Obviously, subsequent calls to LoadBank() will fail with AK_BankAlreadyLoaded but I'm not concerned with that for the moment.

void AWwiseTestCharacter::BeginPlay()
{
    FAkAudioDevice* AudioDevice = FAkAudioDevice::Get();

    AKRESULT res = AudioDevice->LoadBank("Main.bnk", AK_DEFAULT_POOL_ID, bankID);

    switch (res)
    {
        case AK_Success:

            break;

        case AK_BankAlreadyLoaded:
            UE_LOG(LogFPChar, Warning, TEXT("%s"), ANSI_TO_TCHAR("Bank already loaded."));
            break;

        default:
            UE_LOG(LogFPChar, Warning, TEXT("Wwise Load error: %d"), (int32)res);
            break;
    }
}

Firing the event was simple enough:

void AWwiseTestCharacter::OnFire()
{

    FAkAudioDevice* AudioDevice = FAkAudioDevice::Get();

    if (AudioDevice)
        uint32 WwiseID = AudioDevice->PostEvent(TEXT("FIRE_TRIGGER"), this, 0, NULL, NULL, false);

}

Now I'm trying to use the Audio Input Plug-in.

The first thing I did was to add a new sound SFX in the Wwise project, in my default work unit, added "Wwise audio input" as source, named it "MyVoice". (I don't know if renaming the "Wwise Audio Input" text has any significance but I also changed it to "MyVoice").

Then I created an event called "Voice_Trigger" and attached "MyVoice" onto it.  I tested it with my microphone and it works.

I generated the sound bank.

Now where do I go from here ?  I don't know how to get a handler to the plugin from the FAkAudioDevice object so I can add the necessary callbacks.  And any post event on my voice data returns a Event ID not found.

Is the process described accurate and what to I need to get it a step further ?  If the SFX a good choice or is it better to use a "Sound Voice".

Regards.

 

asked Jan 18, 2016 in General Discussion by Marc S. (120 points)
edited Jan 18, 2016 by Marc S.
Well any event attached to a sound to be generated by a plugin (audio input, Mp3, Sine wave) doesn't generate the event.  I made a Wwise_IDs.h output of my generated bank and none of those events are present.  All the ones from normal *.wav files are there, though.  Any hint ?

Please sign-in or register to answer this question.

...