views:

528

answers:

2

I wish to play Tones in WPF from a sound card device (not system speaker). Im disappointed to find that apart from playing a beep or a wav file WPF does not have any native way to play simple sound frequencies. ie play(freq, duration);

Looking into using DirectX DirectSound Ive hit a problem on how WPF using windows handles, as Direct X needs a Windows Form handle.

Does anyone have a solution to play tones in WPF?

+4  A: 

You can always use the WindowInteropHelper to get the native handle for your WPF window.

Will
I have used this to get the handle to a WPF window for other DirectX/XNA things.
SteveM
+1  A: 

You can use WindowformHost to create window form control and then pass handle of this control to DirectSound, i have done this with DirectShow, it showing video n playing sound for me

Firoz