C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,146 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Can you Please Help me fix this issue. I am beginner to it.
I have shared the Pic and code.
Thanks for help
using System;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace Dispatch_Command_Training_Assist
{
public partial class Form1: Form
{
[DllImport("winmm.d11", EntryPoint = "mciSendStringA", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
public static extern int myfunc(string a, string b, int c, int d);
public Form1()
{
InitializeComponent();
}
public void StartRecording_Click(object sender, EventArgs e)
{
myfunc("open new type waveaudio Alias recsound", "", 0, 0);
myfunc("record recsound", null, 0, 0);
StartRecording.Text = " Recording....";
StartRecording.ForeColor = System.Drawing.Color.Red;
}
public void StopRecording_Click(object sender, EventArgs e)
{
myfunc("pause recsound", null, 0, 0);
SaveFileDialog sfd = new SaveFileDialog();
sfd.Filter = "wave|*.wav";
if(sfd.ShowDialog() == DialogResult.OK)
{
myfunc("save recsound" + sfd.FileName, null, 0, 0);
myfunc("close recsound", null, 0, 0);
}
}
}
}
Try "winmm.dll"
or "winmm.DLL"
instead of "winmm.d11"
.