WaveFormat.nBlockAlign = waveFormat.nChannels * (waveFormat.wBitsPerSample/8) * Initialize the WAVEFORMATEX for 16-bit, 44KHz, stereo */ To open the preferred Digital Audio Output device, then use a Device ID of WAVE_MAPPER with waveOutOpen() as so: "preferred" Digital Audio Input device and Digital Audio Output device respectively. Pass the value WAVE_MAPPER as the Device ID to open the Recall that Windows maintains separate lists of the devices which are capable of recording Digital Audio data, and theĭevices capable of playing Digital Audio data. Take, depending upon how fancy and flexible you want your program to be. How does your program choose a Digital Audio device for input or output? There are several different approaches you can You open it, you read or write to it, and then you close it.Įasy way to choose a Digital Audio device for input or output Think of a Digital Audio device like a file. Youįill in the fields of this structure (prior to calling waveInOpen) to tell the device such things what sample rate andīit resolution to use when recording the digital audio data, as well as whether to record in Mono (1 channel) or stereo (2 channels).Īfter you're done recording or playing Digital Audio on a device (and have no further use for it), you must close that device. One of the other parameters you pass is a pointer to a WAVEFORMATEX structure. Then, Windows will subsequently pass your program blocks of incomingĭigital Audio from that device's ADC. Passing it the Device ID of that desired device. In order to read incoming Digital Audio data from a particular device's ADC, you need to first call waveInOpen() once, In the fields of this structure (prior to calling waveOutOpen) to tell the device such things as the sample rate andīit resolution of the digital audio data you intend to play, as well as whether it is Mono (1 channel) or stereo (2 channels). Then, you can subsequently call a function to send blocks of DigitalĪudio data to that device's DAC. In order to write out Digital Audio data to a particular device's DAC, you need to first call waveOutOpen() once, Using the Low level Digital Audio API, you need to first call waveOutOpen() or waveInOpen() to open some Digital Audioĭevice for output (use its Digital to Analog Converter to play audio) or input (use its Analog to Digital Converter to
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |