全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:2406
推到 Plurk!
推到 Facebook!

C語言低階錄音成.WAV檔案範例

 
AB
高階會員


發表:166
回覆:262
積分:125
註冊:2003-08-21

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-11-30 01:16:06 IP:61.64.xxx.xxx 未訂閱
C語言低階錄音成.WAV檔案範例 http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q116/2/93.asp&NoWebContent=1 Direct-to-Disk Recorder with ACM 適用於 This article was previously published under Q116293 SUMMARY DDREC is a sample that shows how to use the low-level multimedia application programming interface (API) to perform direct-to-disk recording of sound using real-time audio compression from an application for Windows written in the C language. MORE INFORMATION The following files are available for download from the Microsoft Download Center: Ddrec.exe For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base: 119591 How to Obtain Microsoft Support Files from Online Services Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file. The Windows MCI commands may be used to record wave audio data from within an application. However, MCI is implemented as a high-level interface. This implementation does not provide extensive control over the recording process, and does not provide easy access to the recorded data. For more control over data access and the recording process, the low-level multimedia API may be used. If you know ahead of time how much memory will be required for the entire recording, and you know that the required amount is available, you may use a simple one-shot recording procedure (ie: memory allocate, open device, record, close device). In the wave audio recording world, huge memory requirements are common and this process may not be applicable. If, however, you do not know the total recording, and/or you want to keep memory requirements to a minimum, a direct-to-disk process may be desirable. This is also known as a double buffer approach, which repeats the process of writing one filled buffer to a disk file while recording another. DDREC uses two buffers of approximately 32K each that are locally allocated at program startup. When the record process is initiated, the wave buffers are added to the input queue and recording begins. When the first buffer is filled, it is written to a temporary file while the second buffer is filled. After the buffer is written the buffer is queued to for wave audio input again. This procedure is repeated for each buffer until the user stops the recording. DDREC shows how to use these same two buffers for playing the audio as well as recording using a similar double buffer approach. It also uses the multimedia input/output (mmio*) procedures for reading and saving the wave data in a .WAV format RIFF file. DDREC also implements the WAVEFORMATEX structure for handling other wave formats besides PCM. It handles compressed formats automatically using function calls to the Audio Compression Manager (ACM The information in this article applies to:
系統時間:2024-05-03 7:29:17
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!