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?
views:
44answers:
2
+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
2010-09-09 02:11:48
+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
2010-09-09 02:20:43
Thank you.By the way,what time is it now?
Bennet
2010-09-09 02:28:23
9:30 PM, St. Louis time. ???
JoshVarga
2010-09-09 02:31:18
I in Asia.So...
Bennet
2010-09-09 02:58:36
Did this answer work for you? If so close, mark it as the answer.
JoshVarga
2010-09-09 21:51:05