473,757 Members | 6,899 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sound recording

Hello, I want to create a program that records a sound track from the
microphone, and save it into a file.
Can anybody tell me please how do I get the audio from the microphone?
thanks for your help
Nov 16 '05 #1
4 2935
The only way to do this is using p/invoke and the multimedia library. Take a
look at the waveIn<xxxxxx> functions.

Search for WimMM in MSDN. or Multimedia SDK.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Michael" <Mi*****@discus sions.microsoft .com> wrote in message
news:53******** *************** ***********@mic rosoft.com...
Hello, I want to create a program that records a sound track from the
microphone, and save it into a file.
Can anybody tell me please how do I get the audio from the microphone?
thanks for your help

Nov 16 '05 #2
On Thu, 9 Dec 2004 18:32:53 +0100, "Bob Powell [MVP]"
<bob@_spamkille r_bobpowell.net > wrote:
The only way to do this is using p/invoke and the multimedia library. Take a
look at the waveIn<xxxxxx> functions.

Search for WimMM in MSDN. or Multimedia SDK.


Hey Bob! MS just added some managed code support to the Oct DirectX SDK.
I've been waiting for them to get up to speed on managed code, and sure
enough, there's some examples in C#, including DirectSound. Long overdue.

I've tried using the WinMM library before, with mixed results. I'm hoping
that the .NET runtime speeds up a bit. Though I haven't traced the
problems I've experienced, they pretty much have to be coming from the
transition between unmanaged DLLs and managed code. I'm not sure what
..NET is doing there, or how to find out.

I was trying an approach closer to 'IJW' via layered C++ unmanaged/managed
DLLs (the latter accessed by the C# app). Maybe the p/Invoke/attribute
approach is faster, but I had a lot of various data types to transport, so
I tried to isolate them on the C++ side. Seemed slow. You wouldn't think
P/Invoke could be much faster than the IJW approach but maybe so.

Nov 16 '05 #3
Well pinvoke.net doesn't contain any of the functions I need.
THanks for ur help anyway...
Do u know if the Net frame work will contain functions for wave I/O?
Or is there some other way to do it?

"Bob Powell [MVP]" wrote:
The only way to do this is using p/invoke and the multimedia library. Take a
look at the waveIn<xxxxxx> functions.

Search for WimMM in MSDN. or Multimedia SDK.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Michael" <Mi*****@discus sions.microsoft .com> wrote in message
news:53******** *************** ***********@mic rosoft.com...
Hello, I want to create a program that records a sound track from the
microphone, and save it into a file.
Can anybody tell me please how do I get the audio from the microphone?
thanks for your help


Nov 16 '05 #4
On Thu, 9 Dec 2004 13:55:05 -0800, "Michael"
<Mi*****@discus sions.microsoft .com> wrote:
Well pinvoke.net doesn't contain any of the functions I need.
THanks for ur help anyway...
Do u know if the Net frame work will contain functions for wave I/O?
Or is there some other way to do it?
I've already posted a suggestion about DX9, but Bob is correct about this.
P/Invoke is a mechanism that allows you to access older Win32 DLLs from
..NET. P/invoke is just the method to do this. It is not a sound lib.

All things considered, stick with the example code from the Oct DX9 SDK.
It does what you want already and it's in C#.


"Bob Powell [MVP]" wrote:
The only way to do this is using p/invoke and the multimedia library. Take a
look at the waveIn<xxxxxx> functions.

Search for WimMM in MSDN. or Multimedia SDK.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Michael" <Mi*****@discus sions.microsoft .com> wrote in message
news:53******** *************** ***********@mic rosoft.com...
> Hello, I want to create a program that records a sound track from the
> microphone, and save it into a file.
> Can anybody tell me please how do I get the audio from the microphone?
> thanks for your help



Nov 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4125
by: Josh | last post by:
I am having a problem with sound in my program, it takes information from a TargetDataLine, put's it in a temporary file, then takes it back out of the temporary file and plays it using a SourceDataLine. currently, it does not play back. andrewjj20 the play method: class Player implements Runnable { public Player() {
0
1418
by: dvaughan | last post by:
i'd like to make a web page that records things the remote user says i've been working with the SASDK since that's a pretty obvious place to start. i don't currently require the recognition capabilities, but they might come in handy later for knowing when the user said an expected phrase, etc. the RecordSound control seems to be the right thing. it works fine for me when i use the telephony application simulator, but of course i really...
0
1529
by: ajac | last post by:
In the windows xp system the sound recording system give us only 1 minute of recording time. I would like to get the "recording time Length " to the maximum. please let me know Urgently. Regards, ajac
5
2132
by: Larry L | last post by:
I want to play a repetitive sound, and have a user click on a button each time it plays (say 5-10 times) and measure how far off he is from the sound each time. The only way I know to play a sound in JS is bgsound, and I know how to loop and pause, so as to do the 1st part. I haven't figured out how to then test the delay in response. Since some of the responses may also be *before* the sound plays by some milliseconds, that also...
6
2510
by: Dovelet | last post by:
Hi all, I would like to write DOS program to change the MS Windows Sound Recording source. When I run it with the parameter, it will change the recording source as follow: C:\> abc.exe microphone <- the Sound recording source change to Microphone C:\> abc.exe line <- the sound recording source change to Line-IN
1
15878
by: Nikhil Aggarwal | last post by:
I have to make an mp3 sound recorder to record through mike. So, I plan to use lame as mp3 encoder which is written in C. I am unable to import its dll in C# project as a reference because it says that the dll formed is not a valid managed dll. So, I compiled the project as a static library (.lib) and used it in a cpp project. I was able to use it successfully this way. Secondly, I was also unable to find any sound recording library in C#....
3
2341
by: larry | last post by:
Hi, my friends, My boss asked me to use sound card to do analog to digital conversion for my application. I know when we record sound, sound card changes anolog signal to digital file. I have no idea where should I start? Do I need to write a driver for sound card? Is there any tool from Visual Stuido? Would you like to help me? H e l p ! Regards,
4
1508
by: jdcharbonneau | last post by:
I am working on a foreign language learning program. (C# DotNet V2) I have some written text, and a recording of a native speaker speaking that text. I would like to be able to do the following: 1 - synchronize the voice with the text, so that the background color of each word is hilighted as the voice reads that word. 2 - be able to jump around within the recorded text. For instance if the user double-clicks a certain sentence - just...
8
3870
by: jer | last post by:
I've noticed you've helped a lot of people that were trying to do sound recording through VB.net. I'm searched all over the internet, and I'm still having problems write sound to a wav file. My code originate from a VB 6 application, and I'm trying to use vb 2005. I was having a lot of issues until I saw your post that cleaned up a lot of the structures and DLL calls in this: ...
0
2260
by: Karthik | last post by:
Hi, I want to record a sound wave from a mic and at the same time invert it and play the inverted wave.My code goes as follows, however nothing is written into the E:\inverted.wav file.Thanks in advance for any help. from Tkinter import * root = Tk() import tkSnack tkSnack.initializeSnack(root)
0
10072
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9906
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9885
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8737
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6562
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5172
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3829
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3399
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.