Solved

How do I change to sample rates, for MCI mcirophone

Posted on 1997-10-27
1
372 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Separate files macro - Errors on larger data set 18 73
Change owner from userA to server Local Administrators 7 66
Sed question 2 102
Problem to event 3 103
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

829 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