user621818
user621818

Reputation: 33

How to play dynamic sounds in XNA?

Is it possible to dynanmically generate sounds with XNA C# code?

I looked into this some time ago when XNA was first released. At that time it was only possible to playback sound resources included in the compiled code.

Have there been any changes or new features added since XNA 1.0 that would allow an XNA application to generate and playback audio on the fly?

Upvotes: 3

Views: 2544

Answers (3)

Cheezmeister
Cheezmeister

Reputation: 4985

Depends how dynamic you want to get. I know that XACT will let you change pitch and such, which, when combined with using cues in a programmatic fashion, can give some nice results.

If you want to generate your own waveform, you're out of luck. There's always the option of dropping below the framework and doing it yourself.

Upvotes: 0

Empyrean
Empyrean

Reputation: 1833

Yes.

XNA 4.0 added support for dynamic audio that allows you to:

Read more in the blog entry What’s “Dynamic” about this SoundEffectInstance? and in the AppHub article Dynamic Audio.

Upvotes: 5

MusiGenesis
MusiGenesis

Reputation: 75276

I think you can do this in XNA with DirectSound. Here's a link with code that seems to do what you want:

http://forums.create.msdn.com/forums/t/40361.aspx

Upvotes: 1

Related Questions