XNA : How do I build a Custom Importer for Sound?

Started by
5 comments, last by Deyja 14 years, 7 months ago
So basically, my engine gives me a stream which contains the binary representation of a .wav file. I need to somehow load this and be able to play a sound with XNA. How can I do this? Can I do this at runtime? Thanks. stringa
Advertisement
Is there a good reason for not using the existing sound importer or XACT?
Yes. My own content management system.
I haven't really used the XNA audio stuff, but AFAIK the only way you can create a SoundEffect is through a ContentManager. However you really don't want to go through the content importing and processing at runtime...this is because the assemblies required to do this aren't included with the XNA Framework Redistributable. Which means that to play your game on the PC, users would have to install Visual Studio and XNA Game Studio. On the 360 it just won't work, period.

Again I haven't used the XNA audio stuff myself, but I'm pretty sure that it doesn't have any way to let you pass raw audio data at runtime. I would ask on the Creator's Club forums just to be sure, though.
your best bet would be to (hopefully nondestructively) edit the sound and save it as a diff format *.ogg i believe XNA uses

there's plenty of tutorials on changing audio formats using programs like audicity, soundbooth or audition. I know you have to be careful with the bitrate and frequency or something when editing sound files
Quote:Original post by Gephoria
your best bet would be to (hopefully nondestructively) edit the sound and save it as a diff format *.ogg i believe XNA uses


Like I mentioned above, if you do this then your game will have a dependency on assemblies that are only included in a full Visual Studio + XNA Game Studio install.

Quote:Yes. My own content management system.


What will your system do that XNA's content pipeline does not?

This topic is closed to new replies.

Advertisement