The best-kept secret about the XNA Game Studio 3.0 CTP

Thursday, May 08 2008

Well, the big announcement about the Game Studio 3.0 CTP went out an hour ago.  Everybody is excited about the built-in Zune support, and that's cool, but there's another feature that's in there that I think is more exciting than that.  It's called SoundEffect, and it lurks in your Microsoft.Xna.Framework.Audio library.

Why is it special?  Remember all that stuff you had to do with XACT to create the WavBank/SoundBank stuff just to get sounds loaded into the content pipeline? Try this instead:

  1. Drop the WAV file into your Content area (let's say it's "shipexplode.wav" file)
  2. Create a SoundEffect instance (i.e., "Microsoft.Xna.Framework.Audio.SoundEffect  spaceShipExplosion;")
  3. Load the content:  "spaceShipExplosion = Content.Load<SoundEffect>("shipexplode.wav");"
  4. In your update area (or wherever): "spaceShipExplosion.Play();"

What this means is that XACT would only be used for more advanced sound processing needs.  But for the majority of you, you will find the SoundEffects API is very satisfactory, and probably all you need.

14 comment(s)

Excellent!

What other new non-Zune features are there? I can't find any list of features anywhere on the net (the readme doesn't provide much information outside of possible issues - though I haven't downloaded the release yet).

Does this sound effects API provide support for other (more compressed) audio formats?

Mahdi Khodadadi Fard wrote on Wednesday, May 07 2008

So don't we need XACT for audio ? will XACT be omited from XNA ?

Mike wrote on Wednesday, May 07 2008

I would be interested to know what other non-xbox, non-zune features there are as well.  Like for instance, is there better support for handling Windows Forms?  That'll be the deal breaker for me.

Mike,

WinForms support is full-featured in XNA Game Studio already; a few changes in GS 2.0 made it easier.

Check out these samples on our site:

WinForms Series 1:  Graphics Device

creators.xna.com/.../WinForms-Series-1_3A00_--Graphics-Device.aspx

WinForms Series 2:  Content Loading

creators.xna.com/.../WinForms-Series-2_3A00_--Content-Loading.aspx

Matt Picioccio

XNA Community Team

I too am curious about support for compressed formats like WMA/MP3/Ogg Vorbis. The real issue with XACT and sound support in XGS 2.0 is the lack of compression and the huge filesizes that derive from that.

Andrew G wrote on Wednesday, May 07 2008

Ditto about compressed sounds!  :)  It'd be so great to have something better than ADPCM.  Music just takes up so much space :)  I know XACT uses some special compression for xbox which is twice as good as ADPCM, couldn't that be used for PC?  Otherwise Ogg would be great.

Also any chance of XNA having a way to author directly to a soundbuffer so we could play track-based music formats or write our own synthesizers?

Andrew G wrote on Wednesday, May 07 2008

Ahhh, according to this article to can import mp3, wav and wma and they all get converted to wma, so hopefully better compression..i'm going to go try it out!  Article and sample here here:

www.kyleschouviller.com/.../xna-30-mp3wmawav-support

TroutButter wrote on Wednesday, May 07 2008

Is it possible to play sounds with this new API without using the content pipeline? I really don't like having to "compile" my assets along with my code.

I prefer the old way of just loading sound/models/textures myself and using them without having to recompile it in VS. That is not helpful to the non-programmers on a team.

platinumacetric wrote on Wednesday, May 07 2008

Hey dave,

been a long time since i commented on this blog, but do you have any estimate when 64bit support will come around.

thanks

Dave, where can we find more "secret" stuff about this release? ...

Pete, the best way to find "secret stuff" is to use the product :-)

Platinum,

We plan to support it before RTM.

:-D