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.

Selected Media Not Available Unity Test Project

0 votes
Hello,

 

Wwise newbie here. I just finished Wwise101 and am working through Wwise301. I am implementing a test project to try some of the things I have learned, but am experiencing issues immediately. In my Unity project, I simply have a cube object with the PostWwiseEvent script from Wwise301 lesson 4 attached. I have only one sound implemented in Wwise that I want to attach to the cube object and play at start. I imported the sound as an SFX object titled "Platform_Placement" and attached it to an event of the same exact name. I added this event to my "Main" soundbank. I made sure both Wwise and Unity had the correct soundbank path in the settings and generated the soundbank. At first I got "Event ID not found" error in Unity, but I confirmed that the event ID within Wwise matched the Unity error. After connecting the game and viewing the profiler, I see that the event gets triggered, but the "Platform_Placement" SFX object has a "Selected Media Not Available" error. I also tried loading the "Platform_Placement" sound into an AKAmbient script, but receive the same errors. Even when I trigger the sound from the AkAmbient component, I get the same error!

 

Please help!
asked Sep 24, 2020 in General Discussion by Kenji S. (100 points)

1 Answer

0 votes

Hey Kenji, 

Sorry to hear you're having problems. Let me start by explaining a bit of things, and then let's look at what your problem might be. 

First off, there shouldn't be any difference in using an AkEvent or AkAmbient. The AkAmbient is actually inheriting the same code from an AkEvent, so it's basically just using an AkEvent with a few more properties attached to it. 
Secondly, here's a few reason that might explain why you're getting a "Selected Media Not Available" error. 

So let's try to solve it.
1) Did you create a completely new Unity Project or did you use the Wwise Adventure Game (WAG) for your new Wwise project? If you used WAG, did you try deleting the SoundBanks + WwiseIDs? 
2) Also, what game object did you attach a AkBank to (if that's what you're using)? Preferably it should be attached to a game object that doesn't get disabled, destroyed or even used for anything else. 
3) Make sure you're loading the SoundBank before you post the Event, so for example, AkEvent set to Awake and your script posting the Wwise type in Start(), which is executed after Awake.

Let me know if any of this helps! 

answered Sep 25, 2020 by Mads Maretty S. (Audiokinetic) (38,720 points)
Thanks for your response Mads! My issue was that I assumed that simply generating the SoundBanks was enough for Unity to access the sounds instead of loading with a soundbank. To answer your questions for anyone else looking at this post:

1. I created a new Unity project and put a cube object in the scene. I simply wanted to test getting audio working on my own!

2. I did not create or attach an AkBank script.

3. I just added the AkBank script to the cube object and set it to load the main soundbank on Awake. It worked and played the "Platform_Placement" sound at the start of playing the scene!
A follow up question:

What would be the best way to load a soundbank that will be accessed through multiple scenes? For example, I have a game that has a main menu scene and then the gameplay scene. If there are UI sounds that are consistent across the two scenes, is there a way to load it once in the main menu and keep them loaded in the gameplay scene or would I have to load that soundbank whenever a scene is loaded?
"If there are UI sounds that are consistent across the two scenes, is there a way to load it once in the main menu and keep them loaded in the gameplay scene"
- If you load your SoundBank in the Main scene, and don't "unload" it when loading another scene (see Unload On: property in your AkBank script), you can keep playing UI sounds. So if your Main scene is always loaded, you can add the AkBank to it and your Main SoundBank won't unload until you exit playmode (if the Unload On. property is set to destroy).

"What would be the best way to load a soundbank that will be accessed through multiple scenes?"
- Like above, SoundBanks stay in memory until you unload them.

"would I have to load that soundbank whenever a scene is loaded?"
- A note that might be worth mentioning, is that Wwise has Media Relocation.

This means that if you load this ...
# SoundBank 1: (Shotgun sound, Forrest Ambience)
... and then load ...
# SoundBank 2: (Shotgun sound, Desert Ambience)
... the Shotgun sound will not be loaded twice, and avoid that you use double the memory for it.

Result:
# Memory: Shotgun sound, Forrest Ambience, Desert Ambience.

The same applies the other way around, so if you unload Soundbank 1 from memory now, Wwise would see that another SoundBank is using the Shotgun sound and therefore not unload it.

Result:
# Memory: Shotgun sound, Forrest Ambience.

Let me know if this helps.
...