Suggested design/architecture for UI audio?
Posted: 14 Mar 2024, 13:07
Looking at viewtopic.php?t=2098, I see PlaySoundAction and Interactivity, and the suggestion of potentially implementing a custom action, which I might do eventually for FMOD. But for now, I have more design-related questions from the XAML/UI POV.
1. How does one add this Interactivity/sound action to a XAML? Doesn't seem like it can be just dropped-in (missing assembly etc); I'll dig into this one as it's not exactly Noesis' fault.
EDIT: Looks like I can just use "xmlns:b="http://schemas.microsoft.com/xaml/behaviors"" directly, and other answers online are outdated.
2. Say I have a series of menu buttons that should share the same click/hover sounds - how should that be structured? It wouldn't make sense to have a copy of the full Play Sound / Interactivity code in each button in the XAML.
2a. If the solution is to instead drive it from code or some custom class, can I still go through the Noesis::PlayAudioCallback?
2b. Can the solution have these common sounds set up, but with an optional override? So all buttons on the menu use the same click/hover sounds, specified in one place, but one button might have its own distinct on-click sound.
3. Will specifying audio by string in my WPF/C# mock-up cause issues if that audio doesn't exist? Because it lives in FMOD audio banks, and exposing the raw audio to VS Blend just to please it would be a lot.
4. Stepping back, how is the audio+UI relationship definitely at scale in Noesis, typically? Maybe at the style level, with some resource dictionary xaml files which somehow set up the audio/sound effect strings/names? Working on something in the strategy space, so lots of icons and clicking and hovering, with potentially different reactions based on e.g. hovering ally vs enemy, which all sound like candidates for triggers in style + having some statics in the resources.xaml like "EnemyHoverSoundName" and a string for the FMOD audio effect.
Thanks!
1. How does one add this Interactivity/sound action to a XAML? Doesn't seem like it can be just dropped-in (missing assembly etc); I'll dig into this one as it's not exactly Noesis' fault.
EDIT: Looks like I can just use "xmlns:b="http://schemas.microsoft.com/xaml/behaviors"" directly, and other answers online are outdated.
2. Say I have a series of menu buttons that should share the same click/hover sounds - how should that be structured? It wouldn't make sense to have a copy of the full Play Sound / Interactivity code in each button in the XAML.
2a. If the solution is to instead drive it from code or some custom class, can I still go through the Noesis::PlayAudioCallback?
2b. Can the solution have these common sounds set up, but with an optional override? So all buttons on the menu use the same click/hover sounds, specified in one place, but one button might have its own distinct on-click sound.
3. Will specifying audio by string in my WPF/C# mock-up cause issues if that audio doesn't exist? Because it lives in FMOD audio banks, and exposing the raw audio to VS Blend just to please it would be a lot.
4. Stepping back, how is the audio+UI relationship definitely at scale in Noesis, typically? Maybe at the style level, with some resource dictionary xaml files which somehow set up the audio/sound effect strings/names? Working on something in the strategy space, so lots of icons and clicking and hovering, with potentially different reactions based on e.g. hovering ally vs enemy, which all sound like candidates for triggers in style + having some statics in the resources.xaml like "EnemyHoverSoundName" and a string for the FMOD audio effect.
Thanks!