Re: Problem about Waveform Audio Functions? by sajid
sajid
Mon Dec 13 01:20:17 CST 2004
This is a multi-part message in MIME format.
------=_NextPart_000_0012_01C4E112.4C871A80
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: quoted-printable
Hi Fred,
Can you give me little more information about your audio driver:
Is the behavior observed only with stereo or mono too ?
what are the capabilities your audio driver expose in response to =
WODM_GETDEVCAPS?
all the 12 formats ?
Does your driver support volume control ?
Extra support ?
Just try:
- read volume register using waveOutGetVolume just before waveOutWrite =
in wavplay.cpp
- possibly set the volume to max:=20
HWAVEOUT hWave;
waveOutOpen(&hWave,...);
waveOutSetVolume(hWave, 0xFFFFFFFF);
Check, whether any different WAV_IOControl is called by media player in =
comparison with wavplay dumped by DEBUGMSG.
regards
sajid
"fred" <fred@discussions.microsoft.com> wrote in message =
news:D9684643-E3C3-4328-AF6D-61F21C4242DA@microsoft.com...
> Thanks for your reply.
> From debug messages, I find that the wavplay and media player =
both=20
> call the same interfaces in wave device driver.But when I use media =
player to=20
> play the wave file, I can hear the sound from LINE OUT.Though when I =
use the=20
> wavplay to play this file, there is no sound. But the wave device =
driver=20
> works well and the debug message is correct. I don't know why there is =
no=20
> sound.
> My wave device driver is wince.net 4.2's driver for lubbock =
platform. I=20
> guess wether the driver can't play stereo media file and the media =
player has=20
> convert the file from stereo to mono.
>=20
> Fred
>=20
>=20
> "sajid" wrote:
>=20
> > Hi Fred,
> >=20
> > 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.
> >=20
> > wavplay and media player at last call the same WAV_IOControls down =
to the audio driver.
> >=20
> > 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]
> >=20
> > Moreover, in wavplay.cpp file the function "PlayFile" calculates the =
playback duration by the following code:
> > dwDuration =3D dwBufferSize * 1000 / pwfx->nAvgBytesPerSec;
> >=20
> > DWORD cannot accommodate product of (dwBufferSize * 1000) while =
playing=20
> > 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=20
> > register capacity and hence gives wrong duration which TimeOuts much =
earlier
> > before the whole PCM data is played.
> >=20
> >=20
> > instead use:
> > dwDuration =3D (DWORD)((__int64)dwBufferSize * 1000 / =
pwfx->nAvgBytesPerSec);
> >=20
> > This modification will allow playing 32MB size wav files at max.
> >=20
> > regards
> > sajid
> >=20
> > "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=20
> > > in wince.net 4.2. I can use sample codes wavrec to record a wave =
file and I=20
> > > can use media player to play it. But I can't use wavplay playing =
it. Does the=20
> > > media player not use the Waveform Audio Functions playing it ?
> > > The wave file information is "wavrec.wav" S16 44100Hz 1764000 =
bytes=20
> > > 10000 ms. It was recorded by wavrec .
> > > Help!
> > > Fred
> > >=20
> > >=20
> > >=20
> > >
------=_NextPart_000_0012_01C4E112.4C871A80
Content-Type: text/html;
charset="Utf-8"
Content-Transfer-Encoding: quoted-printable
=EF=BB=BF<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dutf-8">
<META content=3D"MSHTML 6.00.2800.1479" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DVerdana size=3D2>Hi Fred,</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT> </DIV>
<DIV><FONT face=3DVerdana size=3D2>Can you give me little more =
information about=20
your audio driver:</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>Is the behavior observed only with =
stereo or mono=20
too ?</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>what are the capabilities your audio =
driver=20
expose in response to WODM_GETDEVCAPS?</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>all the 12 formats ?</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>Does your driver support volume =
control=20
?</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>Extra support ?</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT> </DIV>
<DIV><FONT face=3DVerdana size=3D2>Just try:</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>- read volume register using=20
waveOutGetVolume just before waveOutWrite in wavplay.cpp</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>- possibly set the volume to=20
max: </FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>HWAVEOUT hWave;</FONT></DIV>
<DIV><FONT face=3DVerdana =
size=3D2>waveOutOpen(&hWave,...);</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>waveOutSetVolume(hWave, =
0xFFFFFFFF);</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT> </DIV>
<DIV><FONT face=3DVerdana size=3D2>Check, whether any different =
WAV_IOControl is=20
called by media player in comparison with wavplay dumped=20
by DEBUGMSG.</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT> </DIV>
<DIV><FONT face=3DVerdana size=3D2>regards</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>sajid</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT> </DIV>
<DIV><FONT face=3DVerdana size=3D2>"fred" <</FONT><A=20
href=3D"mailto:fred@discussions.microsoft.com"><FONT face=3DVerdana=20
size=3D2>fred@discussions.microsoft.com</FONT></A><FONT face=3DVerdana =
size=3D2>>=20
wrote in message </FONT><A=20
href=3D"news:D9684643-E3C3-4328-AF6D-61F21C4242DA@microsoft.com"><FONT=20
face=3DVerdana=20
size=3D2>news:D9684643-E3C3-4328-AF6D-61F21C4242DA@microsoft.com</FONT></=
A><FONT=20
face=3DVerdana size=3D2>...</FONT></DIV><FONT face=3DVerdana =
size=3D2>> Thanks for=20
your reply.<BR>> From debug messages, =
I find=20
that the wavplay and media player both <BR>> call the same interfaces =
in wave=20
device driver.But when I use media player to <BR>> play the wave =
file, I can=20
hear the sound from LINE OUT.Though when I use the <BR>> wavplay to =
play this=20
file, there is no sound. But the wave device driver <BR>> works well =
and the=20
debug message is correct. I don't know why there is no <BR>> =
sound.<BR>>=20
My wave device driver is wince.net 4.2's driver for =
lubbock=20
platform. I <BR>> guess wether the driver can't play stereo media =
file and=20
the media player has <BR>> convert the file from stereo to =
mono.<BR>>=20
<BR>> Fred<BR>> <BR>> <BR>> "sajid" wrote:<BR>> <BR>> =
> Hi=20
Fred,<BR>> > <BR>> > If your audio driver supports =
playing:<BR>>=20
> - 8/16 bitspersample<BR>> > - Mono/Stereo<BR>> > -=20
11025/22050/44100 Hz<BR>> > Formats [as exposed by WODM_GETDEVCAPS =
message] then, if any .wav[PCM data] files is played by media player =
then=20
wavplay can also play, except that wavplay can handle only small =
files.<BR>>=20
> <BR>> > wavplay and media player at last call the same =
WAV_IOControls=20
down to the audio driver.<BR>> > <BR>> > Now, if you look =
into the=20
wavplay sample application, you can observe that, it uses CreateFile api =
to open=20
wav files and it fails to open files of size morethan or equal to 32MB. =
[I think=20
this is the WinCE memory architecture limitation]<BR>> > <BR>> =
>=20
Moreover, in wavplay.cpp file the function "PlayFile" calculates the =
playback=20
duration by the following code:<BR>> > dwDuration =3D dwBufferSize =
* 1000 /=20
pwfx->nAvgBytesPerSec;<BR>> > <BR>> > DWORD cannot =
accommodate=20
product of (dwBufferSize * 1000) while playing <BR>> > files with =
PCM data=20
size of 4294967 bytes i.e., @ format Stereo 16bit 44100 Hz<BR>> > =
PCM data=20
size more than 4MB, the product over-runs the 32-bit temporary <BR>> =
>=20
register capacity and hence gives wrong duration which TimeOuts much=20
earlier<BR>> > before the whole PCM data is played.<BR>> > =
<BR>>=20
> <BR>> > instead use:<BR>> > dwDuration =3D=20
(DWORD)((__int64)dwBufferSize * 1000 / =
pwfx->nAvgBytesPerSec);<BR>> >=20
<BR>> > This modification will allow playing 32MB size wav files =
at=20
max.<BR>> > <BR>> > regards<BR>> > sajid<BR>> > =
<BR>>=20
> "fred" <</FONT><A =
href=3D"mailto:fred@discussions.microsoft.com"><FONT=20
face=3DVerdana size=3D2>fred@discussions.microsoft.com</FONT></A><FONT =
face=3DVerdana=20
size=3D2>> wrote in message </FONT><A=20
href=3D"news:791654BF-E785-4C5E-8035-2A8ED3097DCF@microsoft.com"><FONT=20
face=3DVerdana=20
size=3D2>news:791654BF-E785-4C5E-8035-2A8ED3097DCF@microsoft.com</FONT></=
A><FONT=20
face=3DVerdana size=3D2>...<BR>> > > Hi,<BR>> >=20
> Now I am developing a record&play program. I =
have=20
read the sample codes <BR>> > > in wince.net 4.2. I can use =
sample=20
codes wavrec to record a wave file and I <BR>> > > can =
use media=20
player to play it. But I can't use wavplay playing it. Does the <BR>> =
>=20
> media player not use the Waveform Audio Functions playing it =
?<BR>> >=20
> The wave file information is "wavrec.wav" =
S16=20
44100Hz 1764000 bytes <BR>> > > 10000 ms. It was recorded by =
wavrec=20
.<BR>> > > Help!<BR>> > > =
Fred<BR>>=20
> > <BR>> > > <BR>> > > <BR>> >=20
></FONT></BODY></HTML>
------=_NextPart_000_0012_01C4E112.4C871A80--