Click here to Skip to main content
15,885,365 members
Please Sign up or sign in to vote.
1.80/5 (5 votes)
See more:
As part of a project I have to capture sound input through mic, to do some signal processing and would like to store the resulting sound in windows using c/c++.
Have any default c/c++ library or methods to capture Mic input sound in Windows?, pls suggest a better way …. Pls provide if anyone have sample programs...
Posted
Updated 4-Apr-17 0:20am
Comments
[no name] 13-Sep-13 5:37am    
This question has been asked a million times. Please google this and search codeproject. There is tons of stuff here and elsewhere.

https://www.google.com.au/#q=capture+sound+windows+c%2B%2B
H.Brydon 14-Sep-13 21:11pm    
I agree - that would work out to about one question asked per 10 CP members. Yup, that's about right. :-)
[no name] 15-Sep-13 2:54am    
I was going to say 10 million but the search only got 7 million hits. Perverse logic I know.
Oso Oluwafemi Ebenezer 13-Sep-13 6:16am    
Look at http://msdn.microsoft.com/en-us/library/windows/desktop/dd743834(v=vs.85).aspx Check out waveIn* functions like waveInOpen, waveInStart, etc

1 solution

PortAudio is a free, cross-platform, open-source, audio I/O library. It lets you write simple audio programs in 'C' or C++ that will compile and run on many platforms including Windows, Macintosh OS X, and Unix (OSS/ALSA). It is intended to promote the exchange of audio software between developers on different platforms. Many applications use PortAudio for Audio I/O.PortAudio provides a very simple API for recording and/or playing sound using a simple callback function or a blocking read/write interface. For more information, please look here:http://www.portaudio.com/[^]

The Synthesis ToolKit in C++ (STK) is a set of open source audio signal processing and algorithmic synthesis classes written in the C++ programming language. STK was designed to facilitate rapid development of music synthesis and audio processing software, with an emphasis on cross-platform functionality, realtime control, ease of use, and educational example code. The Synthesis ToolKit is extremely portable (it's mostly platform-independent C and C++ code), and it's completely user-extensible (all source included, no unusual libraries, and no hidden drivers). Have a look a following site, related question too: https://ccrma.stanford.edu/software/stk/[^]

The objective of SPUC (Signal Processing using C++) is to provide the Communications Systems Designer or DSP Algorithm designer with simple, efficient and reusable DSP building block objects. Thus allowing a transition from System design to implementation in either programmable DSP chips or hardwired DSP logic.
This Class Library
1) basic building blocks such as complex data types, Fixed-bit width integer classes, pure-delay blocks, etc.
2) Basic DSP building blocks such as FIR, IIR, Allpass, Running Average, Lagrange interpolation filters, NCO, Cordic rotator.
3) Several communications functions such as timing, phase and frequency discriminators for BPSK/QPSK signals.
4) Other miscellaneous DSP/Communications related functions/classes.
5) Ability to design several types of FIR and IIR filters
6) Various adaptive equalizer classes
7) This library now includes code from IT 3.7.0. Code was modified to work together with SPUC and replace Vector and Matrix classes from TNT.
8) Capitalized and uppercase class names are classes not originally in SPUC

For more information, please look the following site: http://spuc.sourceforge.net/[^]

Let's see here : DirectX.Capture Class Library[^] one other example for your question

Sampling sounds in Windows 32 is relatively simple—once you know how to deal with asynchronous input. Here's you can see how it works:
http://www.relisoft.com/freeware/recorder.html[^]

For the programmer, Windows' Multimedia API functions make it straightforward to record or replay sound samples using your PC's soundcard, and hence opens up many opportunities in digital audio analysis and processing. This page shows you how to get started:
http://www.techmind.org/wave/[^]

In this installment, you can see how to record wave audio using the low-level audio functions of C++ Builder: http://www.bcbjournal.com/articles/vol2/9810/Low-level_wave_audio__part_3.htm[^]


I hope this will help you.
Good luck.

Alex.
 
Share this answer
 
v2
Comments
Joezer BH 15-Sep-13 4:39am    
Great answer Alex!
Volynsky Alex 15-Sep-13 16:02pm    
Thank you very much Canny Brisk
CPallini 4-Apr-17 6:36am    
5.
Volynsky Alex 4-Apr-17 13:56pm    
Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900