when i open it and try to record my voice and listen my voice it works perfectly but i cant record my voice second time.it plays the voice which i have recorded before the last one.
this is my code.i hope i could tell my problem.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
[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);
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
record("open new Type waveaudio Alias recsound", "", 0, 0);
record("record recsound", "", 0, 0);
}
private void button2_Click(object sender, EventArgs e)
{
record("save recsound C:\\Users\\oguzhan\\Desktop\\ddd.wav", "", 0, 0);
record("close recsound", "", 0, 0);
axWindowsMediaPlayer1.URL = "C:\\Users\\oguzhan\\Desktop\\ddd.wav";
axWindowsMediaPlayer1.Ctlcontrols.play();
}
}
}