Pablo
01/26/2025, 7:45 PMactiveSoundEffectFilePath: String?
in my UiState
and set it to a path when a sound effect must be played and make a call to some viewmodel fun playAudio(path: String)
when the Screen sees that the uistate constains that variable different from null? As this is audio, I'm not sure, and can't find any official link about this. If my approach is the correct one, where should be managed the logic for playing the sound effect? If the app haves various screens, each one with his own viewmodel... must the app have a "global" viewmodel that must receive these kind of global stuff like sound effects and manage them? that global viewmodel whould coexist with screens viewmodels, is that correct? if not... is not a better option to have a simple singleton "SoundEffectsManager" that triggers sounds and call it on the composables? without involving viewmodelsPablo
01/26/2025, 9:53 PMPablo
01/26/2025, 9:54 PM