-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRecorder.cs
41 lines (37 loc) · 1.26 KB
/
Recorder.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System.Diagnostics;
using System;
using System.Collections;
using System.Drawing;
using Microsoft.VisualBasic;
using System.Data;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Threading;
namespace NAudioApp
{
class Program
{
// TODO: add some compression
// TODO: add remote player
// TODO: add discovery/connection
// TODO: add automatic muting of host speakers
[DllImport("winmm.dll", EntryPoint = "mciSendStringA", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
private static extern int record(string lpstrCommand, string lpstrReturnString, int uReturnLength, int hwndCallback);
// static void Main(string[] args)
// {
// Program.start();
// Thread.Sleep(2000);
// Program.stop();
// }
public static void start()
{
record("open new Type waveaudio Alias recsound", "", 0, 0);
record("record recsound", "", 0, 0);
}
public static void stop()
{
record("save recsound C:\\Users\\PiyuNir\\hackerton-project\\test.wav", "", 0, 0);
record("close recsound", "", 0, 0);
}
}
}