PDA

View Full Version : Choppy Sound in CS3



bmorrise
March 26th, 2008, 12:57 PM
I'm building a audio/video player and I'm having trouble getting some mp3 files to play without being choppy.

Basically, here's what I'm doing:

var snd:Sound = new Sound();
snd.load(new URLRequest("sound.mp3");
snd.play();

It plays the sound, but every second or so the sound cuts out for a split second. I've tried buffering the entire file as well and it still doesn't work. The strange thing is that it only happens on certain files. The Flash 8 version of the audio player plays these files just fine.

Any ideas?

Thanks,

bmorrise

findAll
March 27th, 2008, 09:10 PM
I'm just wondering, shouldn't your code be more like

var snd:Sound = new Sound();
snd.loadSound("sound.mp3",this);

However, it would be better to create an empty movieclip for the sound, your entire code for the particular sound being

_global.base=this;
base.createEmptyMovieClip("snd_mc",base.getNextHighestDepth());
var snd:Sound = new Sound(snd_mc);
snd.loadSound("sound.mp3",this);

Anogar
March 28th, 2008, 04:03 AM
Is it just on your server, or locally too?

bmorrise
April 15th, 2008, 08:03 PM
I'm just wondering, shouldn't your code be more like

var snd:Sound = new Sound();
snd.loadSound("sound.mp3",this);

However, it would be better to create an empty movieclip for the sound, your entire code for the particular sound being

_global.base=this;
base.createEmptyMovieClip("snd_mc",base.getNextHighestDepth());
var snd:Sound = new Sound(snd_mc);
snd.loadSound("sound.mp3",this);

This would be so if I was using ActionScript 2 and not ActionScript 3. I did however figure the problem out. It turns out there was a problem with the actual audio file. The strange thing was that it played fine in ActionScript 2.