0

I use the WAVE api to generate and receive audio data for a psk program I have written. The audio generation and playback .exe works fine when compiled in Vis C++ v6 on both XP and Win 8 platforms (compilation on XP machine). However, when compiled in VS2010 on Win 8, the audio seems to be incorrectly buffered, so that a pure tone now sounds intermittent, and received data has glitches in continuity.

I set the timing using the receive buffer and MM_WM_DATA message to call a method at the correct baud rate to decode one bit of data etc. and winmm.lib.

Should I be setting anything specific in the project properties, that was default in v6? It seems that the compiled .exe is using the system differently when built using VS2010.

Any advice appreciated.

Thanks,

Greg

  • From VC6 to VS 2010, the VC++ compiler changes a lot. This post compares VC6 with VS2008, it should be helpful. http://stackoverflow.com/questions/62389/what-are-the-differences-between-visual-c-6-0-and-visual-c-2008 – Matt Nov 28 '13 at 22:02
  • Once I migrate one project from VC6 to VC2005, I also encounter memory problems, I doubt you can fix your problem by changing the compiler options. – Matt Nov 28 '13 at 22:04

1 Answers1

0

Audio with glitches in continuity can happen if the audio driver runs out of buffers. When it notifies you that it has finished with a buffer (MM_W?M_DATA) it is too late for you to provide another buffer. You should send it at least two or more buffers before starting playback or recording. Then when you get the first buffer-done notification it will already be working on the second buffer, and you provide a third buffer while the second buffer is being played/recorded.

I don't know what this could have to do with switching compilers, but obviously if you were not queueing multiple buffers then you were lucky if it worked OK.

ScottMcP-MVP
  • 10,337
  • 2
  • 15
  • 15