Solved

How do I change to sample rates, for MCI mcirophone

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

911 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now