Wave file playback ends immediately (C ++, Windows)

I have the following situation. By car there is a Fritz ISDN card . There is a process that is responsible for playing a specific wave file on this wave of the device ( ISDN connection is performed at startup and makes it permanent). The script is simple, when necessary, the process calls waveOutWrite()on a previously opened wave device (everything is initialized without any problems), and the callback function expects MM_WOM_DONEmsg to know that playback is finished.

Since in a few days (nothing has changed either in the process or in the car), the message MM_WOM_DONEarrived immediately after the call waveOutWrite(), although the wave lasts a couple of seconds. The error is not reported again, it looks like the file was played back, but had zero length (this is not the case). I am also sure that waveOutReset()it was not triggered by my process (this would also initiate sending the mentioned message). I used to have some strange problems that were solved simply by reinstalling the TAPI drivers . This time, for some reason, it is problematic for me to repeat this, and I'm trying to make a more analytical approach :). Any suggestions that might cause this behavior? Maybe something is on the other end of the ISDN line ?

+3
source share
3 answers

Based on your description, you play asynchronously. Are you sure that the backup memory for the wav file is not cleared during this time?

+3
source

I don’t have time for Google too much for this, but I know that either Larry Osterman or Raymond Chen blogged about a similar situation.

I'll be back later when I have more time to find out if this question is open.

+2
source

What is the return value when sound is not playing? If you receive MMSYSERR_NOERROR, this indicates an incorrect report that the driver was processed by the operating system.

Has the WAV file changed? This blog entry shows that some fairly in-depth validation is being performed on the metadata.

0
source

Source: https://habr.com/ru/post/1696404/


All Articles