473,326 Members | 2,134 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,326 software developers and data experts.

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 2912
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*****@discussions.microsoft.com> wrote in message
news:53**********************************@microsof t.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@_spamkiller_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*****@discussions.microsoft.com> wrote in message
news:53**********************************@microsof t.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*****@discussions.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*****@discussions.microsoft.com> wrote in message
news:53**********************************@microsof t.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
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...
0
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...
0
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. ...
5
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...
6
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...
1
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...
3
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...
4
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: ...
8
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...
0
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.