Sound recording in .net
Discussion
Can you still get the Win32Api in there?
Actually it seems as though it's the multimedia API, so it might just be the same for .NET.
As far as I remember you prepare a group of buffers, and pass them to the interface, the callback is called each time a buffer is filled, you empty out the buffer, and pass it back to the interface.
Wav file format is just 16bit audio data with the left and right channels interleaved on 16bit boundaries. The data is at 44KHz rate. The file has about ten bytes at the top to specify the format. You can do others, but everyting will recognise that format.
typedef struct [grr
WORD wFormatTag;
WORD nChannels;
DWORD nSamplesPerSec;
DWORD nAvgBytesPerSec;
WORD nBlockAlign;
WORD wBitsPerSample;
WORD cbSize;
]grr WAVEFORMATEX;
void CALLBACK waveInProc(
HWAVEIN hwi,
UINT uMsg,
DWORD_PTR dwInstance,
DWORD_PTR dwParam1,
DWORD_PTR dwParam2
);
MMRESULT waveInOpen(
LPHWAVEIN phwi,
UINT_PTR uDeviceID,
LPWAVEFORMATEX pwfx,
DWORD_PTR dwCallback,
DWORD_PTR dwCallbackInstance,
DWORD fdwOpen
);
MMRESULT waveInStart(
HWAVEIN hwi
);
MMRESULT waveInStop(
HWAVEIN hwi
);
MMRESULT waveInClose(
HWAVEIN hwi
);
Actually it seems as though it's the multimedia API, so it might just be the same for .NET.
As far as I remember you prepare a group of buffers, and pass them to the interface, the callback is called each time a buffer is filled, you empty out the buffer, and pass it back to the interface.
Wav file format is just 16bit audio data with the left and right channels interleaved on 16bit boundaries. The data is at 44KHz rate. The file has about ten bytes at the top to specify the format. You can do others, but everyting will recognise that format.
Edited by dilbert on Tuesday 6th November 18:13
Gassing Station | Computers, Gadgets & Stuff | Top of Page | What's New | My Stuff



