Thursday 19 February 2009

Fontastic

Due to various commitments I've barely made any progress in the last few weeks, though I have implemented the font bank so you can import your own .xnb spritefonts and assign different ones to each character (useful if you want to make a narrator using a blank character, for instance). Any free time has been spent researching the best way to deal with that niggling Windows sound issue - at the very least I want to be able to support users importing their own .wav and .mp3s to be used as background music or sound effects. It seems that there are two remaining feasible options:

  1. SlimDX: An open-source c# wrapper for accessing DirectX functionality through managed code. This is the right idea, though I cannot find any pertinent code examples that use DirectSound.

  2. MCI/Mediaplayer: Invisibly use windows media player the audio. It's a bit of a dirty hack and I'm not sure if it will allow multiple sound sources, but it's definitely the easier of the two options.
At the moment it looks like I'm leaning towards the media player option - the wrong option, no doubt, but the easiest for now and it'll help tick things over until SlimDX matures. All this agonising over design decisions is just me thinking out aloud - when XAGE is done all the internal workings will be abstracted away from the user. It'll just work™.

2 comments:

Unknown said...

Not looked at the docs myself, but doesn't XNA V3 have MP3 support?

This article suggests it does...

http://www.kyleschouviller.com/uncategorized/xna-30-mp3wmawav-support/

Looking forward to something I can download/play with. Good luck!

Clarvalon said...

That's right, VS2008 converts wavs and mp3s into the .xnb format for use with the XNA framework. This is required for the Xbox and isn't a problem for anyone developing solely for the console.

The problem stems from Windows-only developers not having the XNA framework or VS2008 - they won't be able to convert their audio to the required .xnb format. My solution, which I've now implemented, is to code two seperate sound processers into the one engine which will work independantly depending on the file format presented to it. It seems to work pretty well, with the small caveat that Windows Media Player must be installed to play the game (I'm guessing that there aren't many versions of Windows that don't satisfy that requirement, and it's easily rectified by the end-user). It's been a real heeadache so I'm glad that it's out of the way now.

Thanks for the support - I'm still undecided whether to go for a final alpha release or just hold back until I've got a near feature-complete open beta ready.