Comments (10)
I just finished the first draft of this task:
https://github.com/flibitijibibo/MonoGame/tree/vorbisfile-cs
af3a640
Vorbisfile# now works on 32/64-bit and Song playback now seems to work pretty well. My only problem is one that actually persists with the audio engine itself; since all work is on the main thread, if your game hangs during, say, loading (Capsized is my example), the music will stop, whereas SDL2_mixer (and Windows Media Player, for that matter) could keep going on its own thread as usual.
I would greatly appreciate any testing. Note that Vorbisfile-CS is Yet Another Project File you'll need to include in your game's sln until I make the changes needed to statically link everything together.
from fna-mghistory.
For now I've crumbled and moved the OpenALDevice update to a thread:
This fixes Song and CPU perf still seems okay, but y'all know how I am about threads.
from fna-mghistory.
Looks awesome, will be testing this soon!
from fna-mghistory.
The vorbisfile-cs
branch has been updated for the new FNA changes.
from fna-mghistory.
Going to be merging this next week, so last call for testing. Things to test:
- Calls to SoundEffect.Play() and DynamicSoundEffectInstance.Play() (new OpenALDevice thread locks instance lists, may affect performance)
- Song-to-Song transitions (check for inaccurate overlap, gaps in playback, etc.)
- Song volumes (check to see if setting the volume frequently presents new problems)
EDIT: Don't bother testing Position; never implemented it and it didn't work with SDL2_mixer anyway, sooo... maybe when I get a port that uses it.
from fna-mghistory.
The merge for this is getting delayed, so you've got a bit more time to test this. The MojoShader# issue became a bit more urgent, so I may not be able to look at this until that's settled.
from fna-mghistory.
I'm not sure if this is helpful at this point in time now but I remember this project having a issue with interoping with Vorbisfile. I found something better, https://nvorbis.codeplex.com/ . NVorbis is a fully C# written Ogg Vorbis decode that works on mono too, all it needs it one managed .dll (doesn't reference anything else). Works quite well for me for playing Ogg Vorbis though XAudio2.
from fna-mghistory.
The interop has been fixed in the latest version of Vorbisfile#. At this point the only thing keeping me from merging it is the new thread, but I may try working around that soon.
from fna-mghistory.
I just pushed what's basically a rewrite of the thread used to update the Song stream. Instead of the OpenALDevice owning the thread, now it's just the Song that uses a thread to update. We do this by making an "unmanaged" version of DynamicSoundEffectInstance used by Song, which is updated in the SongThread. This not only removes the thread if you don't use Song (which is as it is now), but it basically mimics what we're doing with SDL2_mixer anyway, as far as thread count is concerned.
This works for my games, so all I need is one other dev to verify this and I'll merge it into mainline. It can be as soon as today, up to you all!
from fna-mghistory.
While I've not verified this with other developers, I've merged this in since it works for all of my titles and I'm eager to cut the dependency list down now that the site's up and people are starting to look at this a bit more.
If this doesn't work for your title, file an issue ASAP.
from fna-mghistory.
Related Issues (20)
- shader normalmap not work HOT 3
- Can't run on machine without audio device HOT 9
- [OpenGL] VMware/VBox Support? HOT 7
- [MojoShader] MOJOSHADER_glSetVertexAttribDivisor causes 'System.AccessViolationException' on some computers HOT 3
- [Keyboard] Proposal for Keyboard.GetLayoutEXT() HOT 1
- Microsoft.Xna.Framework.Input.GamePad.INTERNAL_AddInstance throws "An element with the same key already exists in the dictionary" HOT 2
- Triangle color is wrong with fairly simple shader + access violation exception HOT 7
- Unable to load a texture (.PNG) from stream HOT 9
- Initialization order mishap HOT 3
- GraphicsDeviceManager never set in Game HOT 1
- GL Object Disposal Wrappers are not thread-safe HOT 3
- DynamicSoundEffectInstance behavior incompatible with XNA4 HOT 8
- OpenGL 3.2+ Core Profile support HOT 4
- Starting game in full screen bug HOT 8
- Null reference when disposing sound effect after checking sound device exists HOT 5
- [QUESTIONS] learning, using FNA HOT 3
- More spec-compliant Touch Support HOT 34
- FNA Binary Release HOT 1
- RasterizerState.MultiSampleAntiAlias not implemented HOT 8
- Set Render Target to Another Window HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fna-mghistory.