replace NAudio with SoundFlow#16
Conversation
|
I've made a new branch - can you point the PR to merge into the having the audio cut and be not overlap was actually an intentional decision on my end - i thought it would sound funnier that way. but I think now that you bring this up, i think the right solution is to have a checkmark on the settings page to enable/disable overlaping audio. on your notes:
I would at minimum try to handle any exception that would be caused by no audio devices so our plugin doesn't crash the game. additionally, we should add a guard before we use the engine variable during play.
I'm not sure how to do this either. In an ideal world there would be a hook of some kind that can trigger a re-load for the default audio, but in reality I think what this would require is maybe a new button in the settings UI to "reload audio device" or more complex-ly, a drop-down list that users can change to target an audio device. we can punt this off to focus on getting soundflow tested and working with various OS and audio files. this is a good idea for an improvement and we should include this in future versions. again, thank you for your contribution and hard work! |
Changed it :)
Aight, i will get that included in this one as well :) as some might like it and others might not :)
I will check if SoundFlow uses exceptions, but it seems i can get the count of devices, so i can always check if there's 0 devices found.
the "reload audio device", does sound the easiest solution, i don't think we can get notified about devices being connected/disconnected. the reload audio device, could just dispose the SoundManager and recreate it. |
# Conflicts: # OofPlugin/OofPlugin.csproj
The audio can now overlap if multiple people die in quick succession
478fe48 to
b26dcfc
Compare
now we keep track of all active players, instead of only 1. all operations modifying the activePlayers is done via a Lock, to ensure multiple tasks doesn't modify the list at the same time
Reintiialize/Initializing the audio device, will first safely dispose the old one, before attempting to make a new one.
Incase the initilized fails, this should prevent crashes from happending, when it attempts to play an audio/stop one. There might be a better way of handling this

This is what i have when i replaced NAudio with SoundFlow, i'm not sure how we and if should handle:
I've being testing this during my merc runs yesterday, with no crashes and audio played as i would expect, as i'm unable to test NAudio, i can't tell if it works exactly the same (feedback would be required)
Fixes: #13