2

I can record voice from microphone and after this upload the .wav file to the http webserver.

using Microsoft.VisualBasic.Devices;
using Microsoft.VisualBasic;
using System.Runtime.InteropServices;

[DllImport("winmm.dll", EntryPoint = "mciSendStringA", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
private static extern int mciSendString(string lpstrCommand, string lpstrReturnString, int uReturnLength, int hwndCallback);

Public static void recorder()
{
    mciSendString("open new Type waveaudio Alias recsound", "", 0, 0);
    mciSendString("record recsound", "", 0, 0);
}

Public static void stoprecord()
{
    mciSendString("save recsound " + file_output_name, "", 0, 0);
    mciSendString("close recsound ", "", 0, 0);
    Computer c = new Computer();
    c.Audio.Stop();
}
Public static void uploader()
{
    webclient wc = new webclient();
    wc.uploadfile("http://example.com/index.php", file_output_name);
}

But how can i stream realtime voice to the http server?

Julian
  • 33,915
  • 22
  • 119
  • 174
Leo
  • 21
  • 4

0 Answers0