{"action":"closed","issue":{"url":"https://api.github.com/repos/flibitijibibo/FNA/issues/187","labels_url":"https://api.github.com/repos/flibitijibibo/FNA/issues/187/labels{/name}","comments_url":"https://api.github.com/repos/flibitijibibo/FNA/issues/187/comments","events_url":"https://api.github.com/repos/flibitijibibo/FNA/issues/187/events","html_url":"https://github.com/flibitijibibo/FNA/issues/187","id":30660579,"number":187,"title":"[Song] Replace SDL2_mixer with Vorbisfile#/DynamicSoundEffectInstance","user":{"login":"flibitijibibo","id":1396814,"avatar_url":"https://avatars.githubusercontent.com/u/1396814?v=3","gravatar_id":"","url":"https://api.github.com/users/flibitijibibo","html_url":"https://github.com/flibitijibibo","followers_url":"https://api.github.com/users/flibitijibibo/followers","following_url":"https://api.github.com/users/flibitijibibo/following{/other_user}","gists_url":"https://api.github.com/users/flibitijibibo/gists{/gist_id}","starred_url":"https://api.github.com/users/flibitijibibo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flibitijibibo/subscriptions","organizations_url":"https://api.github.com/users/flibitijibibo/orgs","repos_url":"https://api.github.com/users/flibitijibibo/repos","events_url":"https://api.github.com/users/flibitijibibo/events{/privacy}","received_events_url":"https://api.github.com/users/flibitijibibo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/flibitijibibo/FNA/labels/Portability","name":"Portability","color":"eb6420"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2014-04-02T05:31:52Z","updated_at":"2015-01-18T10:07:14Z","closed_at":"2015-01-18T10:07:14Z","body":"Right now Song looks like this:\r\n\r\nhttps://github.com/flibitijibibo/MonoGame/blob/monogame-sdl2/MonoGame.Framework/SDL2/Media/Song.cs\r\n\r\nNoticing some stubs in there?\r\n\r\nOn top of that, this file alone depends on SDL2_mixer on top of Vorbisfile (and consequently, Ogg/Vorbis, but VideoPlayer can use those too). Even worse, this one file pokes the sound server separately from the OpenAL context, and this can get kind of nasty for certain audio configurations. Plus, it looks pretty stupid in audio control panels.\r\n\r\nI actually wanted to move this to a thread and straight Vorbisfile, but A: threads are dumb, and B: I couldn't quite get Vorbisfile# working.\r\n\r\nFor point A, we now have a solution: DynamicSoundEffectInstance:\r\n\r\nhttps://github.com/flibitijibibo/MonoGame/blob/monogame-sdl2/MonoGame.Framework/Audio/DynamicSoundEffectInstance.cs\r\n\r\nAll you'd have to do is use the Event to pull in more Vorbis data when it's needed. Simple!\r\n\r\nPoint B, since creating this issue, has now been solved. Here is Vorbisfile#:\r\n\r\nhttps://github.com/flibitijibibo/Vorbisfile-CS\r\n\r\nWith this, it should now be possible to write a new Song that uses DynamicSoundEffectInstance.\r\n\r\nA lot of this sounds like it's more of a general technical problem, but a lot of what's pulling me away from SDL2_mixer is the portability aspect of it. SDL2 itself is portable of course, but DynamicSoundEffectInstance is even more portable in that we delegate all the _real_ platform code to the Audio engine, so in the event that SDL2's not acceptable somewhere (pff), Song doesn't become an issue. If a platform can't even use Vorbisfile, well, that's their own problem (they could just move to csvorbis and not really change the code all that much, but I'd rather not have up to 2 different Vorbis libs in one project by default).\r\n\r\nHere are some games you can test with, if you don't have one yourself:\r\n\r\n- Capsized\r\n- Gateways\r\n- Dust: An Elysian Tail (Just the opening sequence)\r\n- Fist Puncher\r\n\r\nIf your MonoGame.Framework.dll doesn't work against the game, let me know and I can rebuild it fresh against upstream MG-SDL2 for you."}}