Re: Directx 9 audio
- From: "Sid Price" <sid@xxxxxxxxxxx>
- Date: Wed, 29 Mar 2006 08:05:01 -0700
Thank you for taking the time to respond again, however unless I am totally
misunderstanding the code you wrote and the documentation your sample code
will only play short files. It uses a static secondary buffer. In order to
play long files (like the several minute files I have) one must use a
streamimg buffer. I was trying to avoid this by using the AudioVideoPlayback
API, it does pretty much what you described with the exception that tere is
the "glitch" I mentioned in my original post.
In the absense of any other input I guess I am going to have to code a
streaming buffer version using the DirectSound API.
Thanks,
Sid.
"Tommi Laukkanen" <TommiLaukkanen@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:40B799B7-AE15-406C-BEB4-6B2DC9B6DEC6@xxxxxxxxxxxxxxxx
You can do something like this if you use DirectSound Managed API:
BufferPlayFlags flags = BufferPlayFlags.Looping;
sound.SecondaryBuffer.SetCurrentPosition(0);
sound.SecondaryBuffer.Play(0, flags);
I am not familiar with AudioVideoPlayback so unfortunately I can not be of
help with it.
best regards,
Tommi Laukkanen
"Sid Price" wrote:
Yes the files are ready for looping and were used previously in a
different
(third party) sequencer that worked very well. I notice, even with a file
just a few seconds long the same delay between end and restart of the
sound
with my AudioVideoPlayback.Audio class implementation.
When using AudioVideoPlayback.Audio there is no auto-looping I think. I
am
responding to the "ending" event and restarting the WAV file.
Sid.
"Tommi Laukkanen" <Tommi Laukkanen@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:1D61B22E-06AB-4EB9-9BF3-36560BD1C0C7@xxxxxxxxxxxxxxxx
Hello Sid,
have you prepared your sound files properly for looping? I think you
need
to
do some mixing magic to get the sound to loop properly even in a wav
editor
application. When they seem to play fine there they should play ok in
the
DirectX too. If I recall correctly you can select whether to loop or
not
if
you use DirectSoundAPI to play your wav files.
best regards,
Tommi
"Sid Price" wrote:
I have an application that sequences WAV files, it is written using VB
.NET
2003. I am using the AudioVideoPlayback Audio class to play the WAV
files
and it does pretty much everything I need in a very simple way. The
only
issue I have is that some of the files need to loop seemlessly and
using
the
"Ending" event and resetting the current position seems to have a
glitch
or
a delay that causes a glitch in the sound played back. I have searched
but
can not find any samples, other than the ones that do exactley what I
am
doing, for avoiding this problem. I think the issue may be that the
files
being looped are quite large (running around 3 minutes) and that this
simple
looping technique is just not fast enough.
Please can someone advise if this approach can be made to work? If not
is
there a good sample of streaming WAV files using managed code
(vb.net).
Many thanks,
Sid.
.
- References:
- Directx 9 audio
- From: Sid Price
- Re: Directx 9 audio
- From: Sid Price
- Re: Directx 9 audio
- From: Tommi Laukkanen
- Directx 9 audio
- Prev by Date: Re: Where is the TextureLoader class?
- Next by Date: Re: X File Problem
- Previous by thread: Re: Directx 9 audio
- Next by thread: Re: Mesh incorrectly loading
- Index(es):
Relevant Pages
|