Xenko throws NotImplementedException on Audio feature usage
While testing the Xenko audio features, Xenko threw a NotImplementedException (see StackTrace below). It seems this is happening when we are trying to AttachSoundEffect(...) to the AudioEmitterComponent. Directly playing the soundEffect via soundEffect.Play() is working fine.
Script code:
` public class SoundEffectScript : StartupScript { public SoundEffect soundEffect;
public override void Start()
{
base.Start();
soundEffect = Content.Load<SoundEffect>("SoundEffects/SoundEffect");
AudioEmitterComponent audioComp = Entity.GetOrCreate<AudioEmitterComponent>();
audioComp.AttachSoundEffect(soundEffect);
AudioEmitterSoundController controller = audioComp.GetSoundEffectController(soundEffect);
controller.Play();
}
}
`
StackTrace:
bei SiliconStudio.Xenko.Internal.Refactor.ThrowNotImplementedException(String message) in C:\TeamCity\work\e71632f3cedbf5cf\sources\engine\SiliconStudio.Xenko.Shared\Refactor\Refactor.cs:Zeile 27. bei SiliconStudio.Xenko.Audio.AudioEmitterProcessor.OnSoundControllerListChanged(Object o, ControllerCollectionChangedEventArgs args) in C:\TeamCity\work\e71632f3cedbf5cf\sources\engine\SiliconStudio.Xenko.Engine\Audio\AudioEmitterProcessor.cs:Zeile 226. bei SiliconStudio.Xenko.Engine.AudioEmitterComponent.AttachSoundEffect(SoundEffect soundEffect) in C:\TeamCity\work\e71632f3cedbf5cf\sources\engine\SiliconStudio.Xenko.Engine\Engine\AudioEmitterComponent.cs:Zeile 145. bei MyGame.SoundEffectScript.Start() in C:\Users\Me\Desktop\MyGame\MyGame\MyGame.Game\SoundEffectScript.cs:Zeile 26. bei SiliconStudio.Core.MicroThreading.Scheduler.Run() in C:\TeamCity\work\e71632f3cedbf5cf\sources\common\core\SiliconStudio.Core.MicroThreading\Scheduler.cs:Zeile 250. --- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde --- bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() bei SiliconStudio.Xenko.Engine.Processors.ScriptSystem.HandleSynchronousException(ScriptComponent script, Exception e) in C:\TeamCity\work\e71632f3cedbf5cf\sources\engine\SiliconStudio.Xenko.Engine\Engine\Processors\ScriptSystem.cs:Zeile 230. bei SiliconStudio.Xenko.Engine.Processors.ScriptSystem.Scheduler_ActionException(Scheduler scheduler, SchedulerEntry schedulerEntry, Exception e) in C:\TeamCity\work\e71632f3cedbf5cf\sources\engine\SiliconStudio.Xenko.Engine\Engine\Processors\ScriptSystem.cs:Zeile 221. bei SiliconStudio.Core.MicroThreading.Scheduler.Run() in C:\TeamCity\work\e71632f3cedbf5cf\sources\common\core\SiliconStudio.Core.MicroThreading\Scheduler.cs:Zeile 254. bei SiliconStudio.Xenko.Engine.Processors.ScriptSystem.Update(GameTime gameTime) in C:\TeamCity\work\e71632f3cedbf5cf\sources\engine\SiliconStudio.Xenko.Engine\Engine\Processors\ScriptSystem.cs:Zeile 104. bei SiliconStudio.Xenko.Games.GameSystemCollection.Update(GameTime gameTime) in C:\TeamCity\work\e71632f3cedbf5cf\sources\engine\SiliconStudio.Xenko.Games\GameSystemCollection.cs:Zeile 97. bei SiliconStudio.Xenko.Games.GameBase.Update(GameTime gameTime) in C:\TeamCity\work\e71632f3cedbf5cf\sources\engine\SiliconStudio.Xenko.Games\GameBase.cs:Zeile 932. bei SiliconStudio.Xenko.Games.GameBase.InitializeBeforeRun() in C:\TeamCity\work\e71632f3cedbf5cf\sources\engine\SiliconStudio.Xenko.Games\GameBase.cs:Zeile 422. bei SiliconStudio.Xenko.Games.GamePlatform.OnInitCallback() in C:\TeamCity\work\e71632f3cedbf5cf\sources\engine\SiliconStudio.Xenko.Games\GamePlatform.cs:Zeile 171. bei SiliconStudio.Xenko.Games.GameWindowWinforms.Run() in C:\TeamCity\work\e71632f3cedbf5cf\sources\engine\SiliconStudio.Xenko.Games\Desktop\GameWindow.Windows.Desktop.cs:Zeile 195. bei SiliconStudio.Xenko.Games.GamePlatform.Run(GameContext gameContext) in C:\TeamCity\work\e71632f3cedbf5cf\sources\engine\SiliconStudio.Xenko.Games\GamePlatform.cs:Zeile 124. bei SiliconStudio.Xenko.Games.GameBase.Run(GameContext gameContext) in C:\TeamCity\work\e71632f3cedbf5cf\sources\engine\SiliconStudio.Xenko.Games\GameBase.cs:Zeile 461. bei MyGame.MyGameApp.Main(String[] args) in C:\Users\Me\Desktop\MyGame\MyGame\MyGame.Windows\MyGameApp.cs:Zeile 11. bei System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() bei System.Threading.ThreadHelper.ThreadStart_Context(Object state) bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) bei System.Threading.ThreadHelper.ThreadStart()
This should be fixed in the next release (coming soon)
Thanks for the answer!