using mciExecute function.(the following code is vb.net). If I have posted in irrelavent forum please let me
know where should I post questions related to audio and video (for web development).
Expand|Select|Wrap|Line Numbers
- Imports System.Runtime.InteropServices
- Imports Microsoft.VisualBasic
- Imports Microsoft.VisualBasic.Devices
- Partial Class audioRec
- Inherits System.Web.UI.Page
- <DllImport("winmm.dll", EntryPoint:="mciExecute", CharSet:=CharSet.Ansi, SetLastError:=True,
- ExactSpelling:=True)> Private Shared Function mciExecute(ByVal lpstrCommand As String) As Boolean
- End Function
- Protected Sub BtnStart_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnStart.Click
- mciExecute("open new Type waveaudio Alias recsound1")
- mciExecute("set recsound1 time format ms bitspersample 16 channels 1 samplespersec 11025")
- mciExecute("record recsound1")
- End Sub
- Protected Sub BtnStop_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnStop.Click
- mciExecute("save recsound1 c:\\record.wav")
- mciExecute("close recsound1 ")
- Dim c As New Computer
- c.Audio.Stop()
- End Sub
- Protected Sub BTNplay_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BTNplay.Click
- Dim computer As New Computer
- computer.Audio.Play("c:\\record.wav", AudioPlayMode.Background)
- End Sub
- End Class
correct the order" msg is getting displayed. I need to to record an audio file in "8khz, 16 bit, mono"
format. How can I meet this requirement.
i will be thankful for ur suggestions..
with regards,
kiran