Community Q&A

Welcome to Audiokinetic’s community-driven Q&A forum. This is the place where Wwise and Strata users help each other out. For direct help from our team, please use the Support Tickets page. To report a bug, use the Bug Report option in the Audiokinetic Launcher. (Note that Bug Reports submitted to the Q&A forum will be rejected. Using our dedicated Bug Report system ensures your report is seen by the right people and has the best chance of being fixed.)

To get the best answers quickly, follow these tips when posting a question:

  • Be Specific: What are you trying to achieve, or what specific issue are you running into?
  • Include Key Details: Include details like your Wwise and game engine versions, operating system, etc.
  • Explain What You've Tried: Let others know what troubleshooting steps you've already taken.
  • Focus on the Facts: Describe the technical facts of your issue. Focusing on the problem helps others find a solution quickly.

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.

 

in General Discussion by Marc S. (120 points)
edited 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.

...