everyone. I'm trying to get an external sound to play in Unity, however I get an error when I try to play it: "Wwise: Cannot open file: Gong_2.wem"
My Project Settings has the input path set up for all of my files to ExternalSources.wsources, which is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<ExternalSourcesList SchemaVersion="1" Root="..\Assets\WwiseExternalSources">
<Source Path="SeedDrop.wav" Conversion="Default Conversion Settings" />
<Source Path="Gong_2.wav" Conversion="Default Conversion Settings" />
<Source Path="shyApplauseTemp.wav" Conversion="Default Conversion Settings" />
</ExternalSourcesList>
The output path is set to the D:\game\WwiseProject\GeneratedSoundBanks\Windows
folder of my Unity project, and I see that all wem
file is present in that folder after generating soundbanks.
The following is the code I'm using to play the sound:
AkExternalSourceInfo source = new AkExternalSourceInfo();
source.iExternalSrcCookie = AkSoundEngine.GetIDFromString("External_Source");
source.szFile = "Gong_2.wem";
source.idCodec = AkSoundEngine.AKCODECID_PCM;
AkSoundEngine.PostEvent("Play_Voice", gameObject, 0, null, null, 1, source);
The sound bank is loaded in and the Play_Voice
event is happening, but it is throwing an error on finding the Gong_2.wem
file.
Is there something wrong with my setup? Where is it looking for the Gong_2.wem file?
Sound should play and no error in console