1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
public class Program
{
[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);
static void Main(string[] args)
{
mciSendString("open new Type waveaudio Alias recsound", "", 0, 0);
mciSendString("record recsound", "", 0, 0);
Console.WriteLine("recording, press Enter to stop and save ...");
Console.ReadLine();
mciSendString("save recsound c:\\work\\result.wav", "", 0, 0);
mciSendString("close recsound ", "", 0, 0);
}
} |
Partager