Re: Problem about Waveform Audio Functions?
From: sajid (sajid_at_discussions.microsoft.com)
Date: 12/10/04
- Next message: wizard: "How to output NTSC or PAL comopsite signal on GEODE SC1200 ?"
- Previous message: Yu: "ActiveSync through USB in WinCE 5.0 ??"
- In reply to: fred: "Problem about Waveform Audio Functions?"
- Next in thread: fred: "Re: Problem about Waveform Audio Functions?"
- Reply: fred: "Re: Problem about Waveform Audio Functions?"
- Messages sorted by: [ date ] [ thread ]
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
>
>
>
>
- Next message: wizard: "How to output NTSC or PAL comopsite signal on GEODE SC1200 ?"
- Previous message: Yu: "ActiveSync through USB in WinCE 5.0 ??"
- In reply to: fred: "Problem about Waveform Audio Functions?"
- Next in thread: fred: "Re: Problem about Waveform Audio Functions?"
- Reply: fred: "Re: Problem about Waveform Audio Functions?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|