I am using Monogame and Monogame.Extended for an own game-project and I’m impressed of how much has changed since when i was first trying out Monogame years ago. It helps me a lot especially if it comes to map-rendering.
The Audio-Library on the other hand makes me worry a little bit that I may have to think of an own concept. So I thought I be on the safe side if I asked the community first!
For my background musik i thought of a dynamically changing soundtrack. You can think of it as Sound-Layers that come together randomely or as a reaction to ingame events.
So i did a little bit of recon and got to the point where the Media Player is only able to play one song at a time and
I could use the SoundEffects, for they’d be able to play all at the same time, but they only support .WAV files.
The downside there is that my soundlayers would all in all take about 300mb of Wave files … when they could also be like… 20-30 mb when handled as .OGG.
Sure, i know why the sound effects dont support .OGG, because of the decompression and all…
So I … kind of desperately ask you guys if one has any idea how to accomplish playing multiple .OGG files at the same time!
I’d be very gratefull for an answer
XACT is perhaps the answer? Though I think it isn’t quite supported in MonoGame. Also I think it is DirectX so maybe not portable?
We have XACT support on all platforms, but again it uses SoundEffect internally.
We have Vorbis (Ogg is the container format, Vorbis is the audio compression format) support in the DesktopGL platforms. This essentially plays back like a SoundEffect, so take at the code in the DesktopGL project to see what you can do with OggStream yourself.
Thanks for the answer!
If you say DesktopGL platform you mean it excludes the portable ones right?
So the poor android fellas wouldn’t be able to use it am i correct?
But you said OggStream.
As i wandered through the Source I already saw the OggStream and for starters i believed it to be just what i needed.
An OGG-Clip… SeekToPosition… Play, Stop… everything there and a Singleton OggStreamer that grabs the streams and plays them in threads…
but when i tried to check it out, i couldn’t access the Class for it’s declared internal :o
Thanks for the answer!
I stumbled upon the XACT thing once and i believed it to work with Waves as well ^^"
Still goin to check it out though
You can edit and build the source to make it public.
Okay that’s what i thought then…
Just wondered if it was internal for a reason
Sorry, maybe i am just a little too careful with die Audio namespace ^^
But I will try that! Thank you very much!
Does anyone know what the reason is for this? Are there any underlying technical reasons to only stream one audio file from local storage at a time (since that’s what the MediaPlayer does if I’m correct), or is it simply a case of “XNA did it this way and that’s why we still do it”?
It is how the XNA API worked, but the OS of mobile platforms also impose a limit of streaming one song at a time. We may be able to extend the MediaPlayer API in the future.
That definitely sounds interesting! While in the subject of audio, are there any plans on storing the compiled .xnb files for SoundEffects in some kind of compressed format? This would help working around the problem of multiple simultaneous audio files while keeping down content file sizes.