TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Mann Maurya
NA
104
9.7k
I want to record Sound File and Save it in Folder
Aug 18 2020 2:04 AM
[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);
protected void btnRecord_Click(object sender, EventArgs e)
{
record("open new Type waveaudio Alias recsound", "", 0, 0);
record("record recsound", "", 0, 0);
}
protected void btnStop_Click(object sender, EventArgs e)
{
record("save recsound D:\\Record\\" + txtname.Text + ".wav", "", 0, 0);
record("close recsound", "", 0, 0);
Computer c = new Computer();
c.Audio.Stop();
}
This code sample I Got from internet .
This code is working intermittently, sometimes its saves file and some time its not.
Thanks!!
Reply
Answers (
2
)
Install .NET Framework Version 4.7.2
how to write query in LInq to sql