Git Product home page Git Product logo

Comments (10)

flibitijibibo avatar flibitijibibo commented on July 19, 2024

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.

flibitijibibo avatar flibitijibibo commented on July 19, 2024

For now I've crumbled and moved the OpenALDevice update to a thread:

dd2015a

This fixes Song and CPU perf still seems okay, but y'all know how I am about threads.

from fna-mghistory.

timothydodd avatar timothydodd commented on July 19, 2024

Looks awesome, will be testing this soon!

from fna-mghistory.

flibitijibibo avatar flibitijibibo commented on July 19, 2024

The vorbisfile-cs branch has been updated for the new FNA changes.

from fna-mghistory.

flibitijibibo avatar flibitijibibo commented on July 19, 2024

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.

flibitijibibo avatar flibitijibibo commented on July 19, 2024

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.

xanather avatar xanather commented on July 19, 2024

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.

flibitijibibo avatar flibitijibibo commented on July 19, 2024

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.

flibitijibibo avatar flibitijibibo commented on July 19, 2024

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.

flibitijibibo avatar flibitijibibo commented on July 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.