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

RE: Problem about Waveform Audio Functions? by fred

fred
Fri Dec 10 02:35:03 CST 2004

Do the Waveform Audio Functions just can play mono wave file?

Fred

"fred" wrote:

> 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
>
>
>
>

Re: Problem about Waveform Audio Functions? by bytekeeper

bytekeeper
Fri Dec 10 02:52:06 CST 2004

I think there are no problems with Waveform functions. They are
working ok. The problem should be in Your waveform audio
driver? Does it support S16 44100Hz format? Turn on debug messages
to see what really happens here.


"fred" <fred@discussions.microsoft.com> wrote in message
news:E806721B-94A6-456C-AD7C-4016E4E0E4D1@microsoft.com...
> Do the Waveform Audio Functions just can play mono wave file?
>
> Fred
>
> "fred" wrote:
>
> > 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
> >
> >
> >
> >



Re: Problem about Waveform Audio Functions? by sajid

sajid
Fri Dec 10 04:00:32 CST 2004

This is a multi-part message in MIME format.

------=_NextPart_000_000E_01C4DECD.306872F0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: quoted-printable

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 =3D dwBufferSize * 1000 / pwfx->nAvgBytesPerSec;

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.


instead use:
dwDuration =3D (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=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_000E_01C4DECD.306872F0
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></FONT><FONT face=3DVerdana =
size=3D2>Hi=20
Fred,</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>If your audio driver supports=20
playing:</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>- 8/16 bitspersample</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>- Mono/Stereo</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>- 11025/22050/44100 Hz</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>Formats [as exposed by =
WODM_GETDEVCAPS message]=20
then, if any .wav[PCM data] files is played by media player then wavplay =
can=20
also play, except that wavplay can handle only small files.</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>wavplay and media player at last call =
the same=20
WAV_IOControls down to the audio driver.</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>Now, if you look into the wavplay =
sample=20
application, you can observe that, it uses CreateFile api to open wav =
files and=20
it fails to open files of size morethan or equal to 32MB. [I think this =
is the=20
WinCE memory architecture limitation]</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>Moreover, in wavplay.cpp file the =
function=20
"PlayFile" calculates the playback duration by the following =
code:</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>dwDuration =3D dwBufferSize * 1000 /=20
pwfx-&gt;nAvgBytesPerSec;</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>DWORD cannot accommodate product of =
(dwBufferSize=20
* 1000) while playing <BR>files with PCM data size of 4294967 bytes =
i.e., @=20
format Stereo 16bit 44100 Hz<BR>PCM data size more than 4MB, the product =

over-runs the 32-bit temporary <BR>register capacity and hence gives =
wrong=20
duration which TimeOuts much earlier<BR>before the whole PCM data is=20
played.<BR></DIV>
<DIV></FONT><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>instead use:</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>dwDuration =3D =
(DWORD)((__int64)dwBufferSize * 1000=20
/ pwfx-&gt;nAvgBytesPerSec);</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>This modification will allow playing =
32MB size=20
wav files at max.</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>"fred" &lt;</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>&gt;=20
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>...</FONT></DIV><FONT face=3DVerdana =
size=3D2>&gt; Hi,<BR>&gt;=20
&nbsp;&nbsp; Now I am developing a record&amp;play program. I have read =
the=20
sample codes <BR>&gt; in wince.net 4.2. I can use sample codes =
wavrec&nbsp; to=20
record a wave file and I <BR>&gt; can use media player to play it. But I =
can't=20
use wavplay playing it. Does the <BR>&gt; media player not use the =
Waveform=20
Audio Functions playing it ?<BR>&gt; &nbsp;&nbsp; The wave file =
information=20
is&nbsp; "wavrec.wav" S16 44100Hz 1764000 bytes <BR>&gt; 10000 ms. It =
was=20
recorded by wavrec .<BR>&gt; &nbsp;&nbsp;&nbsp; Help!<BR>&gt; =
Fred<BR>&gt;=20
<BR>&gt; <BR>&gt; <BR>&gt; </FONT></BODY></HTML>

------=_NextPart_000_000E_01C4DECD.306872F0--


Re: Problem about Waveform Audio Functions? by fred

fred
Mon Dec 13 00:29:02 CST 2004

Thanks for your reply.
From debug messages, I find that the wavplay and media player both
call the same interfaces in wave device driver.But when I use media player to
play the wave file, I can hear the sound from LINE OUT.Though when I use the
wavplay to play this file, there is no sound. But the wave device driver
works well and the debug message is correct. I don't know why there is no
sound.
My wave device driver is wince.net 4.2's driver for lubbock platform. I
guess wether the driver can't play stereo media file and the media player has
convert the file from stereo to mono.

Fred


"sajid" wrote:

> 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
> >
> >
> >
> >

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>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>Just try:</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>-&nbsp;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:&nbsp;</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>HWAVEOUT hWave;</FONT></DIV>
<DIV><FONT face=3DVerdana =
size=3D2>waveOutOpen(&amp;hWave,...);</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>waveOutSetVolume(hWave, =
0xFFFFFFFF);</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>Check, whether any different =
WAV_IOControl is=20
called by media player in comparison with wavplay&nbsp;dumped=20
by&nbsp;DEBUGMSG.</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>"fred" &lt;</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>&gt;=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>&gt; Thanks for=20
your reply.<BR>&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; From debug messages, =
I find=20
that the wavplay and media player both <BR>&gt; call the same interfaces =
in wave=20
device driver.But when I use media player to <BR>&gt; play the wave =
file, I can=20
hear the sound from LINE OUT.Though when I use the <BR>&gt; wavplay to =
play this=20
file, there is no sound. But the wave device driver <BR>&gt; works well =
and the=20
debug message is correct. I don't know why there is no <BR>&gt; =
sound.<BR>&gt;=20
&nbsp;&nbsp;&nbsp; My wave device driver is wince.net 4.2's driver for =
lubbock=20
platform. I <BR>&gt; guess wether the driver can't play stereo media =
file and=20
the media player has <BR>&gt; convert the file from stereo to =
mono.<BR>&gt;=20
<BR>&gt; Fred<BR>&gt; <BR>&gt; <BR>&gt; "sajid" wrote:<BR>&gt; <BR>&gt; =
&gt; Hi=20
Fred,<BR>&gt; &gt; <BR>&gt; &gt; If your audio driver supports =
playing:<BR>&gt;=20
&gt; - 8/16 bitspersample<BR>&gt; &gt; - Mono/Stereo<BR>&gt; &gt; -=20
11025/22050/44100 Hz<BR>&gt; &gt; 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>&gt;=20
&gt; <BR>&gt; &gt; wavplay and media player at last call the same =
WAV_IOControls=20
down to the audio driver.<BR>&gt; &gt; <BR>&gt; &gt; 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>&gt; &gt; <BR>&gt; =
&gt;=20
Moreover, in wavplay.cpp file the function "PlayFile" calculates the =
playback=20
duration by the following code:<BR>&gt; &gt; dwDuration =3D dwBufferSize =
* 1000 /=20
pwfx-&gt;nAvgBytesPerSec;<BR>&gt; &gt; <BR>&gt; &gt; DWORD cannot =
accommodate=20
product of (dwBufferSize * 1000) while playing <BR>&gt; &gt; files with =
PCM data=20
size of 4294967 bytes i.e., @ format Stereo 16bit 44100 Hz<BR>&gt; &gt; =
PCM data=20
size more than 4MB, the product over-runs the 32-bit temporary <BR>&gt; =
&gt;=20
register capacity and hence gives wrong duration which TimeOuts much=20
earlier<BR>&gt; &gt; before the whole PCM data is played.<BR>&gt; &gt; =
<BR>&gt;=20
&gt; <BR>&gt; &gt; instead use:<BR>&gt; &gt; dwDuration =3D=20
(DWORD)((__int64)dwBufferSize * 1000 / =
pwfx-&gt;nAvgBytesPerSec);<BR>&gt; &gt;=20
<BR>&gt; &gt; This modification will allow playing 32MB size wav files =
at=20
max.<BR>&gt; &gt; <BR>&gt; &gt; regards<BR>&gt; &gt; sajid<BR>&gt; &gt; =
<BR>&gt;=20
&gt; "fred" &lt;</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>&gt; 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>&gt; &gt; &gt; Hi,<BR>&gt; &gt;=20
&gt;&nbsp;&nbsp;&nbsp; Now I am developing a record&amp;play program. I =
have=20
read the sample codes <BR>&gt; &gt; &gt; in wince.net 4.2. I can use =
sample=20
codes wavrec&nbsp; to record a wave file and I <BR>&gt; &gt; &gt; can =
use media=20
player to play it. But I can't use wavplay playing it. Does the <BR>&gt; =
&gt;=20
&gt; media player not use the Waveform Audio Functions playing it =
?<BR>&gt; &gt;=20
&gt;&nbsp;&nbsp;&nbsp; The wave file information is&nbsp; "wavrec.wav" =
S16=20
44100Hz 1764000 bytes <BR>&gt; &gt; &gt; 10000 ms. It was recorded by =
wavrec=20
.<BR>&gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; Help!<BR>&gt; &gt; &gt; =
Fred<BR>&gt;=20
&gt; &gt; <BR>&gt; &gt; &gt; <BR>&gt; &gt; &gt; <BR>&gt; &gt;=20
&gt;</FONT></BODY></HTML>

------=_NextPart_000_0012_01C4E112.4C871A80--


RE: Problem about Waveform Audio Functions? by andyraf

andyraf
Mon Dec 13 15:48:03 CST 2004

Does playback work for a smaller file? The wavrec and wavplay samples are
somewhat simple in that they allocate a single buffer to hold all the audio
data. If you're low on memory, they will very possibly fail. Can you verify
whether your initial buffer allocation is succeeding?

MediaPlayer streams the data from the filesystem in smaller buffers
as-needed, so it doesn't have that issue.

-Andy


Re: Problem about Waveform Audio Functions? by fred

fred
Tue Dec 14 03:15:03 CST 2004

hi, sajid

My audio driver supports all the 12 capabilities.
May be I should try some othe methods.

Thanks.
Fred


"sajid" wrote:

> 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:
> 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
> > call the same interfaces in wave device driver.But when I use media player to
> > play the wave file, I can hear the sound from LINE OUT.Though when I use the
> > wavplay to play this file, there is no sound. But the wave device driver
> > works well and the debug message is correct. I don't know why there is no
> > sound.
> > My wave device driver is wince.net 4.2's driver for lubbock platform. I
> > guess wether the driver can't play stereo media file and the media player has
> > convert the file from stereo to mono.
> >
> > Fred
> >
> >
> > "sajid" wrote:
> >
> > > 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
> > > >
> > > >
> > > >
> > > >