WPF audio manipulation

I want to improve the audio a bit using a standard WPF application.

This is what I need:

  • ability to move smoothly
  • change step
  • play multiple sounds at once.

I know the SoundPlayer class isn't enough because it can't play multiple sounds at the same time, so I started looking in the XNA Soundeffect class (and the like), but I'm not sure exactly how the interaction between XNA and WPF works.

Can someone shed some light for me?

Cheers Mark

+2


source to share


3 answers


So thanks for the library's help, but I solved this problem with the XNA XACT tool and the audio framework that ships with XNA.

I ended up just being able to add a link to the XNA.Net libraries and use them. There was confusion at first, but in the end, as long as you call Update () on your AudioEngine object from time to time, it works very well.

You can set programmable variables in your audio project (inside XACT) that you manually manipulate with C #, I did this by adjusting the volume and pitch with the x and y mouse buttons on the screen.



Here is a link to a tutorial that shows it nicely: http://blogs.msdn.com/coding4fun/archive/2007/04/27/2307521.aspx

- Mark

0


source


You can achieve all of this with NAudio , although you will need to write some custom code on top of the main library.



  • Derived a WaveStream class that, in its Read method, returns to the beginning of its original stream whenever it ends.
  • This is your most difficult request. Do you want the sound to play faster, or just increase the pitch? Check out Skype Voice Changer for an example of using NAudio to perform DSP in real time.
  • Use WaveMixerStream to mix multiple WaveStreams together.
+2


source


Take a look at the BASS library .

It has a .NET wrapper that will work for WPF and can do whatever you are looking for. (Although the loop requires some coding, I think you can find an example of this in their discussion forums)

+1


source







All Articles