Questions et réponses de la communauté

Bienvenue sur le forum de questions et réponses d'Audiokinetic, propulsé par la communauté. C'est l'endroit où les utilisateurs de Wwise et Strata s'entraident. Pour obtenir une aide directe de notre équipe, veuillez utiliser la page « Tickets de soutien ». Pour signaler un bug, utilisez l'option Bug Report dans l'Audiokinetic Launcher. (Veuillez noter que les rapports de bug soumis au forum questions-réponses seront rejetés. L'utilisation de notre système de rapport de bug dédié garantit que votre rapport est vu par les bonnes personnes et a les meilleures chances d'être corrigé.)

Pour obtenir rapidement les meilleures réponses, suivez ces conseils lorsque vous posez une question :

  • Soyez précis : qu'essayez-vous de réaliser ou quel est le problème spécifique que vous rencontrez ?
  • Pensez à inclure les détails importants : incluez des détails tels que les versions de Wwise et du moteur de jeu, le système d'exploitation, etc.
  • Expliquez ce que vous avez essayé de faire : indiquez aux autres les mesures que vous avez déjà prises pour essayer de résoudre le problème.
  • Concentrez-vous sur les faits : décrivez les aspects techniques de votre problème. Se concentrer sur le problème aide les autres personnes à trouver rapidement une solution.

+1 vote

I am using Wwise Unity Integration Version 19, integration bundle 2019.2.6.1867, based on WwiseSDK 2019.2.6 Build 7381.

 

I have an AK.Wwise.Event that is localized for multiple languages.

I can verify that if I perform these steps:

  1. Unload the soundbank that contains the event with: AkBankManager.UnloadBank(bankName)
  2. Change the Language with:  AkSoundEngine.SetCurrentLanguage(newLangName)
  3. Wait a few frames...
  4. Re-load the soundbank with: AkBankManager.LoadBank(bankName)
  5. Finally call event.Post(...)

That the correct version plays for the language in question. So far so good


 

Now as an experiment I want to try and do this dynamically. 

Basically if the event in question is currently playing (so I have its playingID and have previously Post-ed it) and the language is changed, I want to stop the event and re-start its new localized version at the same timestamp it just left off at, effectively allowing the user to switch between languages on the fly.

 

I have a proof of concept of this working mostly, but unfortunately for some reason I randomly get WWise: Media was not loaded for this source errors. 

The basic approach:

  • I have a simple dropdown UI for testing where I can pick from all the languages I have files for in the bank under the given name. 
  • Based on user input it calls AkSoundEngine.SetCurrentLanguage(...) 
  • Since AK::StreamMgr::AddLanguageChangeObserver does not seem to be exposed do the C# API, I am detecting when the language changes by regularly checking AkSoundEngine.GetCurrentLanguage().
  • Once a change is observed, I reload the event's bank(s) using a coroutine to ensure the bank loads completely: https://gist.github.com/JohannesMP/2b6b58e5a5bce4b273c8b869aba3ead1
  • I manage my  AK.Wwise.Event with its own component that now receives the AkCallbackType.AK_EndOfEvent callback, as a result of the event being stopped since its bank was unloaded.
  • I waits a few frames to make sure the bank is definitely done loading, and then post the event again.
  • And finally we use AkSoundEngine.SeekOnEvent to set the time to where it was before the language change.

 

As mentioned, seemingly at random I will get a WWise: Media was not loaded for this source error when the event is re-posted after the soundbank finished reloading, which I cannot explain. This even happens if I extend the delays between unloading the bank, loading the bank, and re-Post-ing the event to many seconds. More curious is that once a given AK.Wwise.Event  has entered this 'error' state, I can try calling Post as many times as I want, it will continue to insist that the media is not loaded. Only by switching to a different language (which reloads the bank) and back again does it seem to recover.

 

 

So my question here is, what is causing this error, and how can I avoid it?

I'm positive it's not a matter of not waiting long enough for the bank to finish loading, and it seems to be fairly random when it happens, but seems to be more common if I switch back and forth between languages a few times.

 

 

dans General Discussion par Johannes P. (110 points)
Did you ever get an answer to this? I'm seeing something similar with Wwise 2022.1.18.

Please sign-in or register to answer this question.

...