MP3 in VB does not loop seamlessly

  • Thread starter Thread starter casManG
  • Start date Start date
C

casManG

I have tried using both the Windows Media Player control as well as
the mciSendString method for playing an MP3 within my Visual Basic
2003 app. The problem is that when the MP3 is looping there is always
a small bit of silence between when the sound ends and begins again. I
have verified that the sound I am testing with loops perfectly without
any pause or silence at the end of the sound when looping. Does anyone
know how to make it so that I can play an MP3 seemlessly without the
audible pause when looping. (I have done it with a wav file using
winmm.dll successfully without the audible pause between loops)
 
If you want to get rid of this you can use DirectX (not that difficult).
Then you create your first stream, play it and when it gets near the end you
create another stream with next mp3. You can then start the second mp3 at
your own defined time before the end (crossover). The first will end and on
you go.

Lloyd Sheen
 
If you want to get rid of this you can use DirectX (not that difficult).
Then you create your first stream, play it and when it gets near the end you
create another stream with next mp3. You can then start the second mp3 at
your own defined time before the end (crossover). The first will end and on
you go.

A coupld of questions if you don't mind:


1. Does this require me to install the DirectX SDK?

2. Does this require the person running the program to have DirectX
installed, or do most XP and Vista machines have the required DirectX
stuff already to run the app?

3. Is there any way with mciSendString or Windows Media Player control
to do the same thing you suggested above?

Thanks in advance
cas
 
A coupld of questions if you don't mind:


1. Does this require me to install the DirectX SDK?

2. Does this require the person running the program to have DirectX
installed, or do most XP and Vista machines have the required DirectX
stuff already to run the app?

3. Is there any way with mciSendString or Windows Media Player control
to do the same thing you suggested above?

Thanks in advance
cas

Not that I know of. I just installed Vista and when I installed my app it
worked as did the source code so I think the dll is installed.

D:\WINDOWS\Microsoft.NET\DirectX for Managed
Code\1.0.2902.0\Microsoft.DirectX.AudioVideoPlayback.dll

Now that is the dll that I ended up referencing. Did nothing to cause it to
happen on new install so that might be best way.

Lloyd
 
Not that I know of. I just installed Vista and when I installed my app it
worked as did the source code so I think the dll is installed.

D:\WINDOWS\Microsoft.NET\DirectXfor Managed
Code\1.0.2902.0\Microsoft.DirectX.AudioVideoPlayback.dll

Now that is the dll that I ended up referencing. Did nothing to cause it to
happen on new install so that might be best way.

Lloyd



Well, I gave it a try. I used the tutorial here:
http://gpwiki.org/index.php/VBNET:AudioVideoPlayback

But, after all is said and done, and it's working, the music still
doesn't loop seamlessly :( Man, I just don't get it. Anyone have any
other ideas?
 
The other thing to think of is whether the mp3 has any "gap" either at the
end or the beginning which causes the silence.


Yeah, I checked that. Boy, this really is a pain in the rear...thanks
for your help :)

Carl
 
Yeah, I checked that. Boy, this really is a pain in the rear...thanks
for your help :)

Carl

Just thought of something else. If you create the new Audio object after
the previous song ends you will have a lapse for at least the time taken to
read the stream from the mp3. I think to do what you want you must create
the second audion object prior to the first ending. Then the lapse will be
as small as possible. Extending that you could implement a crossover
function as well since you can have many Audio objects "playing" as I found
out when I made an error in the scope of a variable.

Good luck
Lloyd
 
Back
Top