Hi selmaguzel,
I have heard that Windows Media Player control cannot work with byte arrays directly. However, you can use something like File.WriteAllBytes(path, data) or alternatively if you don't want to write the file you could convert the byte array to a stream and then play that
Code:
var bytes = File.ReadAllBytes(@"C:\WINDOWS\Media\ding.wav"); // as sample
using (Stream s = new MemoryStream(bytes))
{
// http://msdn.microsoft.com/en-us/library/ms143770%28v=VS.100%29.aspx
System.Media.SoundPlayer myPlayer = new System.Media.SoundPlayer(s);
myPlayer.Play();
}
Bookmarks