473,396 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

audio recording problem with mciExecute() in vb.net

I am developing a web application in that I need to record audio, for that I am importing "winmm.dll" and

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
  1. Imports System.Runtime.InteropServices
  2. Imports Microsoft.VisualBasic
  3. Imports Microsoft.VisualBasic.Devices
  4.  
  5. Partial Class audioRec
  6.     Inherits System.Web.UI.Page
  7.     <DllImport("winmm.dll", EntryPoint:="mciExecute", CharSet:=CharSet.Ansi, SetLastError:=True, 
  8.  
  9. ExactSpelling:=True)> Private Shared Function mciExecute(ByVal lpstrCommand As String) As Boolean
  10.     End Function
  11.  
  12.     Protected Sub BtnStart_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnStart.Click
  13.  
  14.         mciExecute("open new Type waveaudio Alias recsound1")
  15.         mciExecute("set recsound1 time format ms bitspersample 16 channels 1 samplespersec 11025")
  16.         mciExecute("record recsound1")
  17.  
  18.  
  19.  
  20.     End Sub
  21.  
  22.     Protected Sub BtnStop_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnStop.Click
  23.         mciExecute("save recsound1 c:\\record.wav")
  24.         mciExecute("close recsound1 ")
  25.  
  26.         Dim c As New Computer
  27.         c.Audio.Stop()
  28.     End Sub
  29.  
  30.     Protected Sub BTNplay_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BTNplay.Click
  31.         Dim computer As New Computer
  32.         computer.Audio.Play("c:\\record.wav", AudioPlayMode.Background)
  33.     End Sub
  34. End Class
  35.  
but when I am clicking the start button "the order in which you are passing parameters is invalid please

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
Oct 26 '07 #1
0 1953

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Sugapablo | last post by:
I had an idea for something that I can't find any evidence if it exists, or if it can be done. I assume it can be done. What I'd like to be able to do, is to allow people who come to my website,...
1
by: Noah | last post by:
I need to record raw 8-bit mono audio from a generic sound card on MS-Windows. I need to do something like this: sound_device = open audio device buffer = sound_device.read ('1 second, 8 bit,...
7
by: psk | last post by:
Hi, I need to read live audio from microphone and somehow make data packets from it and send using my client-server implementation where it will be played. Can anyone tell me abt any...
5
by: ACaunter | last post by:
Hi all, I am in desperate need of being able to have the users of my asp.net site to be able to make a recording from their computer mic, and save that audio on my server.. the user should be able...
1
by: ACaunter | last post by:
Hi all, Have been getting no luck lately, but there must be a way i can recording audio from the website and save it.. It's no problem on applications (VB.Net), and I know other have done it...
1
by: zhangzhi | last post by:
HI£º i have a big problem about audio recording. my boss wanna a application of audio monitor, and he wanna it will detect voice and start recording automatically, avoiding recording silences....
2
by: tiffxi | last post by:
I'm an ASP.NET newbie. I'm trying to write an audio-recording code in an ASP.Net page. I created a windows User Control that has the buttons and codes for this (it calls the winmm.dll in system32...
1
by: fevos | last post by:
hi i look at this article in msdn Recording and Playing Sound with the Waveform Audio Interface and download the P/Invoke Library Sample that record using wave in and wave out . how do i get...
1
by: waqasahmed996 | last post by:
Hi to all, i want to ask that is audio recording is possible in flash. actually i want to make recording from browser. is that possible in flash. if yes please give me some help or send me some...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.