Multimedia and Data Adquisition (namespace Mm)


Adc: Captures data from the (audio) analog to digital converters. To use this control please uncomment the #define WIN_DAC_ADC_SUPPORT line in the stdafx.h file Do not close the program while recording
Adc(void)
bool IsEvent(Win::Event& e, int notification)
bool IsFormatSupported(unsigned int samplesPerSec, unsigned int numbChannels, unsigned int bitsResolution)
samplesPerSec: 192000, 96000, 48000, 44100, 22050, 11025, ... numbChannels: 1, 2, ... bitsResolution: 8, 16, 24, ...
bool IsRecording()
bool Stop()
const wchar_t* Start(unsigned int deviceID, unsigned int samplesPerSec, unsigned int numbChannels, unsigned int bitsResolution, unsigned int bufferSize, Mm::IAudioIn* iaudioIn)
deviceID: 0, 1, 2, 3, ... samplesPerSec: 192000, 96000, 48000, 44100, 22050, 11025, ... numbChannels: 1, 2, ... bitsResolution: 8, 16, 24, ... bufferSize: 4096, 8192, 16384, ... If iAudioIs is not NULL, it will call the functions in the iAudioIn interface If iAudioIn is NULL, you must derive this class overiding the AudioIn functions of this class
double GetBufferDuration()
int GetNumberOfDevices()
It returns the number of waveform-audio input devices present in the system  Google Microsoft
static void GetDevices(vector<WAVEINCAPS >& out_waveInCaps)
It returns a vector with the capatilities of waveform-audio input devices
virtual ~ Adc(void)
void DeleteBuffers(void)

Assistant
static bool IsSignDifferent(int x, int y)
static const wchar_t* ConvertToMono(const wchar_t* in_filename, const wchar_t* out_filename)
It converts a stereo wave file to a mono wave file (one channel)
static const wchar_t* GetErrorText(MMRESULT mmresult)
static const wchar_t* MixWaveFiles(const wchar_t* in_filenameA, const wchar_t* in_filenameB, __int16 rateA, const wchar_t* out_filename)
It mixes two wave files rate from 0 to 100. rate = 50 to use the sample amplitude in both files
static const wchar_t* NormalizeVolume(const wchar_t* in_filename, const wchar_t* out_filename)
It auto adjust the volume of the wave file
static const wchar_t* RemoveOffset(const wchar_t* in_filename, const wchar_t* out_filename)
It removes the offset of a wave file so that the DC level is zero
static const wchar_t* SmoothEndsFile(const wchar_t* in_filename, const wchar_t* out_filename)
It adss a smooth start and a smooth end to the wave file
static void GetFrequency(LPARAM lParam, unsigned int numbChannels, unsigned int bitsResolution, double& out_channel_1, double& out_channel_2)
static void GetFrequency(LPSTR buffer, unsigned int bufferSize, unsigned int numbChannels, unsigned int bitsResolution, double& out_channel_1, double& out_channel_2)
static void GetMaxLevel(LPARAM lParam, unsigned int numbChannels, unsigned int bitsResolution, int& out_channel_1, int& out_channel_2)
8 bits -> level [0, 127], 16 bits -> level[0 32767]
static void GetMaxLevel(LPSTR buffer, unsigned int bufferSize, unsigned int numbChannels, unsigned int bitsResolution, int& out_channel_1, int& out_channel_2)
8 bits -> level [0, 127], 16 bits -> level[0 32767]
static void GetMaxLevelFast(LPSTR buffer, unsigned int bufferSize, unsigned int numbChannels, unsigned int bitsResolution, int& out_channel_1, int& out_channel_2)
8 bits -> level [0, 127], 16 bits -> level[0 32767]
static void GetPhaseDifference(LPARAM lParam, unsigned int bitsResolution, int& out_differenceCount)
It returns the phase difference between channel 1 and channel 2
static void GetPhaseDifference(LPSTR buffer, unsigned int bufferSize, unsigned int bitsResolution, int& out_differenceCount)
It returns the phase difference between channel 1 and channel 2
static void GetRmsLevel(LPARAM lParam, unsigned int numbChannels, unsigned int bitsResolution, double& out_channel_1, double& out_channel_2)
static void GetRmsLevel(LPSTR buffer, unsigned int bufferSize, unsigned int numbChannels, unsigned int bitsResolution, double& out_channel_1, double& out_channel_2)
static void GetZeroCrossings(LPARAM lParam, unsigned int numbChannels, unsigned int bitsResolution, int& out_channel_1, int& out_channel_2)
static void GetZeroCrossings(LPSTR buffer, unsigned int bufferSize, unsigned int numbChannels, unsigned int bitsResolution, int& out_channel_1, int& out_channel_2)

Dac: It sends data to the(audio) digital to analog converters To use this control please uncomment the #define WIN_DAC_ADC_SUPPORT line in the stdafx.h file
Dac(void)
bool IsEvent(Win::Event& e, int notification)
bool IsFormatSupported(unsigned int samplesPerSec, unsigned int numbChannels, unsigned int bitsResolution)
samplesPerSec: 192000, 96000, 48000, 44100, 22050, 11025, ... numbChannels: 1, 2, ... bitsResolution: 8, 16, 24, ...
bool IsPlaying()
bool Stop()
const wchar_t* Start(unsigned int deviceID, unsigned int samplesPerSec, unsigned int numbChannels, unsigned int bitsResolution, unsigned int bufferSize, Mm::IAudioOut* iAudioOut)
deviceID: 0, 1, 2, 3, ... samplesPerSec: 192000, 96000, 48000, 44100, 22050, 11025, ... numbChannels: 1, 2, ... bitsResolution: 8, 16, 24, ... bufferSize: 4096, 8192, 16384, ... If iAudioOut is not NULL, it will call the functions in the iAudioIn interface If iAudioOut is NULL, you must derive this class overiding the AudioOut functions of this class
int GetNumberOfDevices()
It returns the number of waveform-audio input devices present in the system  Google Microsoft
static void GetDevices(vector<WAVEOUTCAPS >& out_waveOutCaps)
It returns a vector with the capatilities of waveform-audio input devices
virtual ~ Dac(void)
void DeleteBuffers(void)

FmDemodulator: It recovers a signal that is frequency modulated
FmDemodulator(void)
bool Create(unsigned int bufferSize, bool isStereo, bool is16Bits)
int Demodulate(LPARAM lParam)
int Demodulate(LPSTR buffer, unsigned int bytesRecorded)
int* GetLeft(void)
int* GetRight(void)
virtual ~ FmDemodulator(void)

IAudioIn: An object that implements this interface can interact with the Analog to Digital Converter using the Mm::Adc class
virtual void AudioInData(unsigned int samplesPerSec, unsigned int numbChannels, unsigned int bitsResolution, WAVEHDR* waveHdr)= 0
virtual void AudioInStarted(unsigned int samplesPerSec, unsigned int numbChannels, unsigned int bitsResolution)= 0
virtual void AudioInStopped() = 0

IAudioOut: An object that implements this interface can interact with the Digital to Analog Converter using the Mm::Dac class
virtual void AudioOutData(unsigned int samplesPerSec, unsigned int numbChannels, unsigned int bitsResolution, WAVEHDR* waveHdr)= 0
virtual void AudioOutStarted(unsigned int samplesPerSec, unsigned int numbChannels, unsigned int bitsResolution)= 0
virtual void AudioOutStopped() = 0

MidiOut: It produces sounds using MIDI
MMRESULT Close(void)
MMRESULT Open(UINT uDeviceID)
MMRESULT Reset(void)
MMRESULT ShortMessage(int status, int channel, int data1, int data2)
MidiOut(void)
void Play(int tempo)
void PlayNote(int channel, int note, int octave)
void StopNote(int channel, int note, int octave)
void StopSong()
~ MidiOut(void)

Mixer: It provides support to handle the sound mixer
Mixer()
void Close(void)
wchar_t* Get_Main_Volume(DWORD& level)
wchar_t* Get_Src_Line(DWORD& level)
wchar_t* Get_Src_Mic(DWORD& level)
wchar_t* Get_Src_Waveout(DWORD& level)
wchar_t* Open(void)
wchar_t* Set_Main_Volume(DWORD level)
wchar_t* Set_Src_Line(DWORD level)
wchar_t* Set_Src_Mic(DWORD level)
wchar_t* Set_Src_Waveout(DWORD level)
~ Mixer()

SoundResource
SoundResource(void)
bool Play(const wchar_t* name, HINSTANCE hInstance)
virtual ~ SoundResource(void)
void Delete()
void Stop()

WaveBuffer: It provides functionability to move a digital signal
WaveBuffer(void)
bool Create(unsigned int nBufferSize)
bool CreateUsingExternalBuffer(char* pData, unsigned int nBufferSize)
char* GetBuffer()
operator WAVEHDR*()
operator char*()
unsigned int GetBufferSize()
unsigned int GetString(wchar_t* pszBuffer, int nBufferSize)
virtual ~ WaveBuffer(void)
void Destroy()
void SetValue(unsigned int index, char value)

WaveFile
WaveFile(void)
const wchar_t* Close(void)
const wchar_t* OpenForReading(const wchar_t* fileName)
const wchar_t* OpenForWritting(unsigned int samplesPerSec, unsigned int numbChannels, unsigned int bitsResolution, const wchar_t* fileName)
double ConvertSizeToSeconds(unsigned int bufferSize)
It returns the number of seconds that can be stored in the given buffer size
double GetFileDurationInSeconds()
double GetRemainingSeconds()
int GetBitsResolution()
int GetNumChannels()
int GetSamplesInBuffer(unsigned int bufferSize)
int GetSamplesPerSecond()
long ReadData(char* buffer, unsigned int bufferSize)
The it reads a specified number of bytes from a file opened by using the mmioOpen function It returns the number of bytes actually read. If the end of the file has been reached and no more bytes can be read, the return value is 0. If there is an error reading from the file, the return value is –1.  Google Microsoft
long ReadLoopData(char* buffer, unsigned int bufferSize)
The it reads a specified number of bytes from a file opened by using the mmioOpen function It returns the number of bytes actually read. If the end of the file has been reached it loops the file to begining of file. If there is an error reading from the file, the return value is –1.  Google Microsoft
long Seek(long offset, int origin)
It changes the current file position in a file opened by using the mmioOpen function offset to change the file position. origin: SEEK_CUR (Seeks to offset bytes from the current file position), SEEK_END (Seeks to offset bytes from the end of the file), SEEK_SET (Seeks to offset bytes from the beginning of the file)  Google Microsoft
long WriteData(const char* buffer, unsigned int bufferSize)
static const wchar_t* GetFileDuration(const wchar_t* fileName, double& durationSeconds)
unsigned int ConvertSecondsToSize(double seconds)
It returns the buffer size to store a given number of seconds
unsigned int GetByteCount()
It returs the number of bytes of the file
unsigned int GetRemainingByteCount(void)
virtual ~ WaveFile(void)
void GetInfo(unsigned int& bitsResolution, DWORD& samplesPerSec, unsigned short& numbChannels)

WaveIn: It provides support to handle the analog to digital converters (ADCs) included in the audio card
HWAVEIN GetHandle()
MMRESULT AddBuffer(LPWAVEHDR pwh)
It sends an input buffer to the given waveform-audio input device. When the buffer is filled, the application is notified.  Google Microsoft
MMRESULT AddBuffer(Mm::WaveBuffer& waveBuffer)
It sends an input buffer to the given waveform-audio input device. When the buffer is filled, the application is notified.  Google Microsoft
MMRESULT Close()
It closes the given waveform-audio input device. A MM_WIM_CLOSE message will be sent  Google Microsoft
MMRESULT Open(unsigned int uDeviceID, LPCWAVEFORMATEX pwfx, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen)
It opens the given waveform-audio input device for recording, a MM_WIM_OPEN message will be sent  Google Microsoft
MMRESULT OpenPCM(HWND hWndParent, unsigned int samplesPerSec, unsigned int numbChannels, unsigned int bitsResolution)
It opens the given waveform-audio input device for recording, a MM_WIM_OPEN message will be generated samplesPerSec: 44100, 22050, 11025, ... numbChannels: 1, 2, ... bitsResolution: 8, 16, 24, ... Google Microsoft
MMRESULT OpenPCM(unsigned int deviceID, HWND hWndParent, unsigned int samplesPerSec, unsigned int numbChannels, unsigned int bitsResolution)
It opens the given waveform-audio input device for recording, a MM_WIM_OPEN message will be generated samplesPerSec: 44100, 22050, 11025, ... numbChannels: 1, 2, ... bitsResolution: 8, 16, 24, ... Google Microsoft
MMRESULT PrepareHeader(LPWAVEHDR pwh)
It prepares a buffer for waveform-audio input  Google Microsoft
MMRESULT PrepareHeader(Mm::WaveBuffer& waveBuffer)
It prepares a buffer for waveform-audio input  Google Microsoft
MMRESULT Reset()
It stops input on the given waveform-audio input device and resets the current position to zero. All pending buffers are marked as done and returned to the application.  Google Microsoft
MMRESULT Start()
It starts input on the given waveform-audio input device. A MM_WIM_DATA message will be sent  Google Microsoft
MMRESULT UnprepareHeader(LPWAVEHDR pwh)
It cleans up the preparation performed by the waveInPrepareHeader function. This function must be called after the device driver fills a buffer and returns it to the application. You must call this function before freeing the buffer.  Google Microsoft
WaveIn(void)
bool GetDevCap(WAVEINCAPS& out_waveInCaps)
It retrieves the capabilities of a given waveform-audio input device  Google Microsoft
bool IsOpen()
const wchar_t* GetErrorDescr(MMRESULT mmresult)
virtual ~ WaveIn(void)
void ClearHandle()
void ListLineControls()

WaveOut: It provides support to handle the digital to analog converters (DACs) included in the audio card
MMRESULT Close()
It closes the given waveform-audio output device. A MM_WOM_CLOSE message will be sent  Google Microsoft
MMRESULT GetVolume(LPDWORD pdwVolume)
It retrieves the current volume level of the specified waveform-audio output device.  Google Microsoft
MMRESULT Open(unsigned int uDeviceID, LPCWAVEFORMATEX pwfx, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen)
It opens the given waveform-audio output device for playback Google Microsoft
MMRESULT OpenPCM(HWND hWndParent, unsigned int samplesPerSec, unsigned int numbChannels, unsigned int bitsResolution)
It opens the given waveform-audio output device for playback samplesPerSec: 44100, 22050, 11025, ... numbChannels: 1, 2, ... bitsResolution: 8, 16, 24, ... Google Microsoft
MMRESULT OpenPCM(unsigned int deviceID, HWND hWndParent, unsigned int samplesPerSec, unsigned int numbChannels, unsigned int bitsResolution)
It opens the given waveform-audio output device for playback samplesPerSec: 44100, 22050, 11025, ... numbChannels: 1, 2, ... bitsResolution: 8, 16, 24, ... Google Microsoft
MMRESULT PrepareHeader(LPWAVEHDR pwh)
It prepares a waveform-audio data block for playback  Google Microsoft
MMRESULT PrepareHeader(Mm::WaveBuffer& waveBuffer)
It prepares a waveform-audio data block for playback  Google Microsoft
MMRESULT Reset()
It stops playback on the given waveform-audio output device and resets the current position to zero. All pending playback buffers are marked as done (WHDR_DONE) and returned to the application.  Google Microsoft
MMRESULT SetVolume(DWORD dwVolume)
It sets the volume level of the specified waveform-audio output device.  Google Microsoft
MMRESULT UnprepareHeader(LPWAVEHDR pwh)
It cleans up the preparation performed by the waveOutPrepareHeader function. This function must be called after the device driver is finished with a data block. You must call this function before freeing the buffer.  Google Microsoft
MMRESULT Write(LPWAVEHDR pwh)
It sends a data block to the given waveform-audio output device.  Google Microsoft
MMRESULT Write(Mm::WaveBuffer& wb)
It sends a data block to the given waveform-audio output device.  Google Microsoft
WaveOut(void)
bool GetDevCap(WAVEOUTCAPS& out_waveOutCaps)
It retrieves the capabilities of a given waveform-audio output device  Google Microsoft
bool IsOpen()
const wchar_t* GetErrorDescr(MMRESULT mmresult)
virtual ~ WaveOut(void)
void ClearHandle()
© Copyright 2000-2019 selo. All Rights Reserved. Sep 05 2019.