Re: Problem about Waveform Audio Functions?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: sajid (sajid_at_discussions.microsoft.com)
Date: 12/10/04


Date: Fri, 10 Dec 2004 15:30:32 +0530

Hi Fred,

If your audio driver supports playing:
- 8/16 bitspersample
- Mono/Stereo
- 11025/22050/44100 Hz
Formats [as exposed by WODM_GETDEVCAPS message] then, if any .wav[PCM data] files is played by media player then wavplay can also play, except that wavplay can handle only small files.

wavplay and media player at last call the same WAV_IOControls down to the audio driver.

Now, if you look into the wavplay sample application, you can observe that, it uses CreateFile api to open wav files and it fails to open files of size morethan or equal to 32MB. [I think this is the WinCE memory architecture limitation]

Moreover, in wavplay.cpp file the function "PlayFile" calculates the playback duration by the following code:
dwDuration = dwBufferSize * 1000 / pwfx->nAvgBytesPerSec;

DWORD cannot accommodate product of (dwBufferSize * 1000) while playing
files with PCM data size of 4294967 bytes i.e., @ format Stereo 16bit 44100 Hz
PCM data size more than 4MB, the product over-runs the 32-bit temporary
register capacity and hence gives wrong duration which TimeOuts much earlier
before the whole PCM data is played.

instead use:
dwDuration = (DWORD)((__int64)dwBufferSize * 1000 / pwfx->nAvgBytesPerSec);

This modification will allow playing 32MB size wav files at max.

regards
sajid

"fred" <fred@discussions.microsoft.com> wrote in message news:791654BF-E785-4C5E-8035-2A8ED3097DCF@microsoft.com...
> Hi,
> Now I am developing a record&play program. I have read the sample codes
> in wince.net 4.2. I can use sample codes wavrec to record a wave file and I
> can use media player to play it. But I can't use wavplay playing it. Does the
> media player not use the Waveform Audio Functions playing it ?
> The wave file information is "wavrec.wav" S16 44100Hz 1764000 bytes
> 10000 ms. It was recorded by wavrec .
> Help!
> Fred
>
>
>
>



Relevant Pages

  • How to stop a sound being played!
    ... Im making a media player using matlab. ... could stop a file im playing out using wavplay? ... alternative to wavplay that allows me to do that! ...
    (comp.soft-sys.matlab)
  • Re: C00D109B error
    ... i have use window media player 8.0 for playing .asf file. ... It's video is playing ok, but audio is giving the above error. ... The audio codec required is G.726 ... > AVI or you have a bad install of the codec. ...
    (microsoft.public.windowsmedia.player)
  • Re: Autosave "Last Played"?
    ... Windows Media Player 11 remembers what you were playing last; ... I remembered in the previous versions of WMP, ...
    (microsoft.public.windowsmedia.player)
  • Re: Problem With Audio
    ... Which Media Player? ... CDs onto my computer and they were playing without problems. ... to uploading CDs and the sound was jumpy (kind of like a scratched ...
    (microsoft.public.windowsxp.general)
  • Re: Aodio Volume copntrol in Control Panel
    ... this may help you when changing volume manually in CPL. ... You will need to tweak you audio driver to lower ... When the volume is increased to maximum from the control panel and the volume is increased to maximum in the media player then the voice starts cracking and sounds as if it is playing from a speaker with torn cone. ...
    (microsoft.public.windowsce.platbuilder)