录音

 1 [DllImport("winmm.dll", EntryPoint = "mciSendString", CharSet = CharSet.Auto)]

 2         private static extern int mciSendString(

 3          string lpstrCommand,

 4          string lpstrReturnString,

 5          int uReturnLength,

 6          int hwndCallback

 7         );

 8  

 9         private static void mciSendString(String cmd)

10         {

11             mciSendString(cmd, "", 0, 0);

12         }

13  

14         private static void StartRecord()

15         {

16             mciSendString("close movie");

17             mciSendString("open new type WAVEAudio alias movie");

18             mciSendString("record movie");

19         }

20  

21         private static void StopRecord(string filename)

22         {

23             mciSendString("stop movie");

24             mciSendString("save movie " + filename);

25             mciSendString("close movie");

26         }

 

你可能感兴趣的:(录音)