Simple audio recording program
来源:互联网 发布:win10动态壁纸软件 编辑:程序博客网 时间:2024/05/29 17:58
- Download source files - 22.3 Kb
Introduction
This sample program make use of waveInxxxx functions to read from an audio input device like a sound card and write it to a .wav file using mmioxxx functions. It is one of the simplest way to record sound with all the format capabilities supported by the hardware deviceInitially, by using waveInGetNumDevs, we can find all the devices and then by using waveInGetDevCaps, we can find the formats it is supported.
To start recording, first select a device and then open the device with waveInOpen API call with the specified format (i.e. 16 bit etc). The output file is also prepared with all the headers filled in properly. Here i am using only PCM format which is easy. If you have more codecs installed on your PC, you can change that one also. But be sure that you supplied the proper values in the WAVEFORMATEX structure.
waveIn needs buffers to start recording. It is better to give more buffers for buffering to avoid any delays. I have used 3 here, but you can add more if your PC needs more time in writing to the HDD and thus causing the delay. Once the buffers are added in the queue, waveInStart will start recording. For each data chunk, the callback function specified in the waveinOpen will get the buffers. Just write it to the file and mark the buffer again for recording by calling the same addbuffer fn.
Once done with recording, adjust the chunk headers using the mmioascend APIs. Thats it.
License
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
About the Author
SaneeshI am from the beautiful sea side town called Kochi ( cochin), Kerala, South India.
Occupation: Software Developer (Senior) Location: United States
- Simple audio recording program
- Audio Recording
- Managing Waveform-Audio Recording
- Recording with a Waveform-Audio Device
- recording and play using Waveform audio interface
- Core Audio I/O File Recording
- Voice Recording/Playing back using simple classes
- A Simple Java Program
- A simple XDR program
- Some simple c program
- Recording
- recording
- Recording audio to WAV with WASAPI in Windows Store apps
- [java] a simple Applet program
- Writing a simple C++ Program
- C++ - A Simple Calculator Program
- A simple libpng example program
- 1357 [Ba1000] Simple C++ Program
- 什么是NDIS?
- Voice Recording/Playing back using simple classes
- 如何判断电脑电源是否烧坏!不用替换的情况下!
- 去掉flash载入时的虚线框
- Sound recording and encoding in MP3 format.
- Simple audio recording program
- 网络驱动程序接口规范NDIS
- CSS文本样式
- recording and play using Waveform audio interface
- StretchBlt用法
- How to play and record sounds
- 海南英语111——Part 5: Sentences about Language 谈论语言
- NetBeans vs Eclipse 之性能参数对比
- SUSE10.3安装总结