how to change sound to byte and byte to sound?
-
I've designed a udp connection using socket and threading. I want to know how I can change sound to an array of byte and change an array of byte to sound. So how can I set received sound to speaker and give output sound from its device like microphone? What should I do? Thanks a lot for your answers. Bahman
-
I've designed a udp connection using socket and threading. I want to know how I can change sound to an array of byte and change an array of byte to sound. So how can I set received sound to speaker and give output sound from its device like microphone? What should I do? Thanks a lot for your answers. Bahman
Hi, I have a partial answer to your question: store the sound data in a byte array, pin it in memory, and call the unmanaged function [DllImport("Winmm.dll", CallingConvention=CallingConvention.Cdecl)] static extern int sndPlaySound(IntPtr buffer, int dwFlags); with flag value = 4 (= SND_MEMORY) More on this in http://www.bobpowell.net/playsnd.htm[^] Dont know about capturing sounds though.
Luc Pattyn