Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Looping sound gap

Status
Not open for further replies.

Elcafe

Programmer
Apr 27, 2004
5
CA
theres a gap when i try to loop a beat sample, heres the code :

var myBeat = new Sound();
myBeat.loadSound("beat2.mp3",false);
myBeat.start(0,50);

Thanx
Korivo
 
Mp3 loops are never as seamless as .wav loops.

You can allways try to alter the secondOffset parameter, but it doesn't allways work...

myBeat.start(secondOffset,50);

Thus...

myBeat.start(1,50);

Or maybe even smaller...

myBeat.start(.5,50);


 
Thanx for the reply,
i tried it and it still doesnt do it quite right, beside,the quality of the loop using a .wav is pretty bad...

Would it be the same procedure for a .wav?
Any other work around?

 
...loop using a .wav is pretty bad...

Did you mean .mp3?

Is this a short loop? A good short .wav could be set to loop in the sounds properties. It would be re-compressed as a .mp3 anyways by Flash. You could even re-compress it further, to cut down on it's size...
 
yeah, its a fairly short loop, about 20 sec.

Im trying to play the .wav the same way as i did with the mp3, but it doesnt play at all.

Is there a different way with a .wav?
 
Just drag your .wav on the stage or in a movie clip. Select the frame, and in the sound's properties make sure the Sync box is set to "event", and set 50 in the Loop box.
 
hehe ok, i thought it was in action script!

Ok i converte the mp3 in .wav, and drag it on the secene bla....

and i still hear that gap

Im clueless

 
Well then the gap is most probably in the loop itself.
You may have to re-edit the loop, to eliminate it!

Do you have a link to this loop?
 
yeah, the trouble was in the loop
thanx a bunch!

So it is some what impossible to do a loop with a mp3,
beacause the way the mp3 compress, leaving a little blank at the beginning and the end?
 
It may be acceptable in some cases and the secondOffset does sometimes work, but it's usually better to use .wav files.


In any case, the Flash output is a mp3, as if you right-click the file in the Library, you can re-compress it even further, until in fact you find the quality acceptable.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top