http://bugs.winehq.org/show_bug.cgi?id=15060
Summary: MCI_WAVE_SET_SAMPLESPERSEC not implimented, patch (needs cleanup) Product: Wine Version: CVS/GIT Platform: PC OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P3 Component: winmm&mci AssignedTo: wine-bugs@winehq.org ReportedBy: nospam@thenerdshow.com
I compiled the following using mingw32: http://msdn.microsoft.com/en-us/library/ms713226(VS.85).aspx
Description, From MSDN: "Uses the MCI_OPEN, MCI_RECORD, and MCI_SAVE commands to record and save a waveform-audio file."
Test Results: It builds with no errors and records a wav file! The resulting wav file, however is in the wrong format (44000 Hz), a rate which I can't see is defined anywhere. (winecfg is set at 48000 Hz) and can't be played back with MCI_PLAY. Nor can it be played back with aplay, totem or xine.
However, I converted the wav file into an mp3 and found that it is in fact correctly recorded, albeit in the wrong format, so I modified the example code and tried to set different parameters like so:
dwReturn = mciSendCommand( (MCIDEVICEID) &wDeviceID, // the above device ID MCI_WAVE_SET_SAMPLESPERSEC, // command to send MCI_SET | MCI_WAIT, // method of sending 22000 ); // set sample rate to 22000
Result: Again, it builds with no errors but the wav file is still being recorded at 44000 Hz! A look at the terminal output reveals an interesting discovery:
fixme:mci:MCI_MapMsgAtoW Message MCI_<<40000>> needs translation fixme:mci:mciSendCommandA message 40000 mapping failed
Looking at the wine source, 40000 mapping equates to this function: $ grep MCI_WAVE_SET_SAMPLESPERSEC /usr/include/wine/windows/mm*
#define MCI_WAVE_SET_SAMPLESPERSEC 0x00040000L
So you see, I can't proceed to change the recording format of my program except in windows.
So before I started fixing wine I asked google to see if I was just duplicating effort and got this patch (and possibly the related links), submitted in 2001 that provides this functionality, but it needs cleaned up:
http://www.winehq.org/pipermail/wine-patches/2001-April/000267.html
I will try to make this patch work and get it into the right format over the course of the next month, but I am on a very limited budget and need to spend time looking for work so if anyone else who has more time to devote to it, please do so.