Wednesday, May 12, 2010

DynamicSoundEffectInstance is THE SHIZNITE

So, what I discovered today, is that XNA 4.0 has added support for the Microphone.  While perusing the docs, I noticed that the Microphone class has a GetData() method which returns an array of bytes.

Hmm, I thought.  You can certainly shove your Microphone up your ass, however, if XACT now has a way to GET bytes, it surely must have a way to GIVE bytes directly to the underlying audio system.  This, obviously, is exactly what one needs to be able to do to create audio proceduraly.  Henceforth, XACT was all about cueing up and playing wav files. 

A response from a MVP on a msdn forum post about procedural audio snarkily said it was a feature only useful for emulators.  Apparantly it's also useful when you have a Mic present, or are otherwise sourcing audio in real time.

The end-all is that my humble NES emulator now runs on Windows Phone 7, and (still to be tested now that I have cause to shell out for a CC license) Xbox 360.

The 360 makes me think...  Obviously a NES emulator would not be allowable.  But, as a content delivery platform, it might actually find a niche.  There's a ton of decent NES homebrew out there, and I wonder if I could bring any of it to the XBox marketplace.   Time to chat up some homebrew'ers, perhaps.  

Regardless, I have forked the project, and am now working outside of the open sourced code I stuck on googlecode.  I will still update the googlecode, but focus on the Silverlight (software rendering) side, rather than the D3D10 Silliness I was engaged in (though I'll come back to that, because there's plenty of GPU fun to be had there).

In other news, I refactored the emu itself somewhat, in a large code/namespace cleanup -- but also took care of some performance snags along the way.  Instancing it *outside* of Unity (ie; new-ing it all up) exposed how silly I'd let the object graph become.  The namespaces were always silly.  Not a hard thing to clean up, but something I've put off, for no good reason.

I knocked out a "touchpad" for the Windows Phone port.  It's hard to play mario when you have to click one gamepad button at a time with the mouse.  I need me some real hardware to play with.

No comments: