tags:

views:

44

answers:

2

I put a sound file stored in the database as a Byte[] .Now,I want to play this sound file in my WPF program. How can I do this?

+1  A: 

Perhaps this link is relevant to your situation:

http://vbcity.com/blogs/xtab/archive/2009/06/29/how-to-play-sounds-and-music-in-wpf.aspx

Bob Jacobs
+1  A: 

You would need to do something like the following:

private void PlaySoundFromBytes(byte[] rawSoundBytes)
{
    Stream rawStream = new MemoryStream(rawSoundBytes);
    var player = new SoundPlayer(rawStream);
    player.Play();
}
JoshVarga
Thank you.By the way,what time is it now?
Bennet
9:30 PM, St. Louis time. ???
JoshVarga
I in Asia.So...
Bennet
Did this answer work for you? If so close, mark it as the answer.
JoshVarga