Solved

How do I change to sample rates, for MCI mcirophone

Posted on 1997-10-27
1
365 Views
Last Modified: 2013-11-20
Im using MCI to record a 'wav' file using the microphone.
My problem is that I would like to be able to change the sample rate, from the c++ program, and I dont know how to.
Can anyone enlighten me how to do this
Thanks in advance
Yakky
0
Comment
Question by:yakky
1 Comment
 
LVL 23

Accepted Solution

by:
chensu earned 50 total points
ID: 1308879
Use the MCI_SET command with MCI_WAVE_SET_SAMPLESPERSEC flag.

MCIERROR mciSendCommand(MCIDEVICEID wDeviceID, MCI_SET,
    DWORD dwFlags, (DWORD) (LPMCI_SET_PARMS) lpSet);


MCI_WAVE_SET_SAMPLESPERSEC

Sets the samples per second used for playing, recording, and saving to the nSamplesPerSec member of the structure identified by lpSet.

For waveform-audio devices, the lpSet parameter points to an MCI_WAVE_SET_PARMS structure.

Several properties of waveform-audio data are defined when the file to store the data is created. These properties describe how the data is structured within the file and cannot be changed once recording begins. The following list of flags identifies these properties:

¡¤ MCI_WAVE_SET_AVGBYTESPERSEC

¡¤ MCI_WAVE_SET_BITSPERSAMPLE

¡¤ MCI_WAVE_SET_BLOCKALIGN

¡¤ MCI_WAVE_SET_CHANNELS

¡¤ MCI_WAVE_SET_FORMATTAG

¡¤ MCI_WAVE_SET_SAMPLESPERSEC

0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Host to IP 7 78
not able to insert into temp table 68 162
Line meaning 9 86
Sed question 2 85
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question