Reputation: 355
I want to be able to stream a byte array directly to my speakers so that I can create sound.
I don't know where to begin.
Is it a DLL import or a memory stream?
What I want to send an array like this:
byte[] bt = {12,32,43,74,23,53,24,54,234,253,153};// example array
Upvotes: 3
Views: 2267
Reputation:
You can use the SoundPlayer
and play from a MemoryStream
:
byte[] bt = {12,32,43,74,23,53,24,54,234,253,153};// example array
var ms = new MemoryStream(bt);
var sound = new System.Media.SoundPlayer();
sound.Stream = ms;
sound.Play();
Upvotes: 4