ActionScript 3.0 :: Making A Flash App - Sound Play Delay?

Apr 3, 2004

I am trying to develop my first flash app. The application emulates a "karaoke" service. It plays a background sound and at the same time records the sound coming from the mic. I use the "sound" class to play the sound (s.play() ) and the "netStream" class to record the mic sound (ns.publish("mysound", "record") ). In the same app, I then try to play these two sounds together. The problem is that I cannot synchronize them. My tests drove me to a conclusion which I am not certain for. The conclusion is that the method s.play() has a delay about 500ms until the sound starts playing. The result is that recording starts 500ms earlier than playback. When, then, I playback both of them the recording sound is 500ms after the backround sound. Is that delay for sure true?

View 12 Replies


Similar Posts:


Actionscript 3 :: Play Sound Without Delay?

Jun 16, 2011

I've got a couple of classes.

My document class (Main.as) instantiates the class player and Soundsloader.
In the player class when the player picks up an item in the game, i want to play a short sound. I do this with the following code: MovieClip(this.main_object.sound_loader).playPickUp();

In my document class i also instantiate the SoundsLoader which basically should load all the sounds. (just one in my sample code below)

package {
import flash.display.MovieClip;
public class SoundsLoader extends MovieClip{

[Code]...

However when i use the methods my swf file freezes for a moment, plays the sound and then continues. So what's the best way of doing this ? (i'm using a .wav sound)

View 1 Replies

ActionScript 3.0 :: Making Sound Only Play Once?

Sep 22, 2010

the site i'm currently helping out with has an audio clip that gets loaded in through xml, I want this to only play once and then halt, but if the user wanted to click on the volume button it could start on up again without a hassle.

View 4 Replies

ActionScript 3.0 :: Making Sound Play Through All Scenes?

Aug 26, 2010

I have only two days to get this working and handed in. My class did not teach actionscript, the code for keeping sounds playing through multiple scenes was provided for us :

var mySound:Sound = new soundtrack();
mySound.play();

Unfortunately this doesn't seem to work in actionscript 3..... and my entire movie is actionscript three. It won't let me save down or convert it or anything.... and I can't get my stuff into another file without screwing it all up.

View 4 Replies

ActionScript 3.0 :: Making A Sound Play Once Then Stop?

Dec 14, 2009

When my avatar bug makes contact with another type of bug, he eats it. Both bugs are movie clips; when the avatar gets into the collision detect zone of the edible bug, it triggers a quick animation in the "edible" bug: he becomes a blur for one frame then disappears (as though eaten).

The problem is the sound effect - a quick "whoosh". It needs to play once then stop. What happens now is that it's triggered repeatedly - a problem if the avatar passes over the edible bug slowly. If the avatar later passes over the spot where the edible bug was, the sound is triggered multiple times again. So I need the sound to play only once, then stop. There will be several copies of the edible bug's movie clip that need to behave the same way, so once the sound stops playing it needs to be available again for the next collision.

Here's what it looks like now:

private var sfx_edible:Sound = new eat();
function detectCollision(myevent:Event):void {
if (avatar_mc.hitTestPoint(edible_a.x, edible_a.y, false)==true) {

[code]....

View 1 Replies

ActionScript 3.0 :: Making A Sound Play At Exact Millisecond?

Jan 9, 2011

I'm having trouble making a sound play at an exact millisecond sinde framerate and timers are not 100% precise. First I tried creating a timer and playing the sound every second. But this causes delay. I can't think of any other way... I'm trying to create a game that marks the rythm precisely by playing small sound clips every specific amount of milliseconds.

View 3 Replies

ActionScript 3.0 :: Making External Sound Files Play Instantly?

Feb 27, 2011

I could create a program for him in flash which would be able to play sounds corresponding to keys on the keyboard, but split in to 3 groups, and only 1 sound from each group can be playing at a time. I don't know that much about as3, and I told him this but said I would try anyway. The first thing I came up with was this:[code]In there, there's nothing to stop the sounds overlapping or looping like in my other solution, also it's obviously a lot less compact, but I sent it to my friend like that to see if it would at least play instantly. The response I got was that, although the lag was noticeably less, it was still present.

View 3 Replies

Professional :: Flash Sound Delay - No Synchronization

Jan 26, 2010

I've been suffering the fliction of making sounds playing synchronized in Flash, I load 4 mp3 files externally and once all of the 4 mp3 loaded completely, let them play, but they starts not at the same time, the files starts unsynchronized with a random manner, some times file a starts first, some times file c starts first, there are always files delay about 500ms, the wierd thing is, O only see it's running sync in one computer, in firefox browser, in IE not. Same problem like, we always experience the case that, when we click a music player button, the sound not starts immediately or click a stop button, the sound not end immediately.

View 2 Replies

Flash Movie Play - Processing A Delay

Feb 15, 2010

I'm working on a Flash intro for a site. After the Flash movie plays I want it to wait three seconds and then send them to the index page. Currently I'm using the action script:

[Code]....

I've got that keyed to the last frame. The issue is at the end of the Flash movie it displays the company logo image. Well with that script added to the last frame it just quickly blips up the logo then takes you to the main page so fast you don't even get to really see the logo. I want the viewer to have a couple seconds to take it in, but then move them along to the main site without them having to look for a button to press.

View 3 Replies

ActionScript 2.0 :: Sound Then Go To URL After Delay

Aug 17, 2009

What I have is a landing page on my customers site, I want to hold it there until the user clicks a button in the flash file it then plays a short sound, 2 seconds and redirects the page. I have tried setinterval and cannot get it to work. What I have loads the flash file and after the set time plays the file then redirects, cutting off the sound.

On Frame1

Code:
var sndMusic = new Sound();
sndMusic.attachSound("mySound");
var duration:Number = 5000; // set the call delay

[Code].....

View 1 Replies

ActionScript 2.0 :: Dependant Sound Delay?

Apr 20, 2010

I've done the getting the time right bit and the ticking bit, but big problem arises with the background music. It's different every second, and what I want is that is it's launched at, say 19:00:00 the music will start at 00 seconds, if it's launched at 19:00:22 - at 22 seconds, at 19:00:45 - at 45 seconds etc. So far I have no idea how to do it, I am a total newbie in Flash..

View 3 Replies

ActionScript 3.0 :: 60 Millisecond Sound Delay?

Nov 8, 2010

The first time around, the sound play's exactly on time, After that it has about a 30-60 millisecond delay to re play it again. if i wait about 20 seconds it will be able to play exactly on time again...? Im new to the sound class, but i don't think i have done anything wrong...my sound is imported to the library, exported for actionscript,i have tried:

Code:
var myAudio:Sound= new myCustomSound();
myAudio.play(0,1);

[code]....

simply put the sound on the timeline of a movieClip its all the same, in the play() method, i have tried start time of 0 or 1 or not at all, same with # of loops. i have tried to re-create the sound object each time its called, or have other sounds in the background, or create longer sounds. ive used mp3s,wavs, the audio file has no silence at the beginning of it.

this happens in the flash ide, or the published swf or on my phone using air for android settings, problem is on the phone its a larger delay i would say 60 to 150 milliseconds, otherwise it probably wouldn't be a problem. on my phone, using mrDoobs stats class i can actually see the frame rate drop from 30 to 25 back to 30 once that estimated 20 seconds is up and its "ready" to play on time again. Something happens after that 20 seconds that it clears up and it will play on time again. I dont know what to think

I re-created it in a regular non air/android swf and its the same issue, i attached it if anyone want to take a look. so hard to see the delay on a regular cpu as the response is good, but its there. click to make a noise, do it again once on the balls on the platform and you will see that tiny audio delay as the ball jumps. however wait 20 sec and it will be exact again.

View 14 Replies

ActionScript 2.0 :: Play Sound Like "stop All Sound" Option In Flash?

May 17, 2003

I want to use a sound loop in my flash movie. The movie has many scenes. And the problem is that when I go to next scene or different scene I hear the sound repeating twice. I mean sound does not stop from first scene and begins from the different scenes.Is there any way to play sound like "stop all sound" option in Flash.

View 6 Replies

ActionScript 3.0 :: Sound Delay After Button Push?

Jan 2, 2009

I have made this little thing, its more or less just to try out some basic scripting, its a button that you would push and when you do so it would play a random sound out of six different sounds, and it does all that, but it delays the sound, so it has a short delay, does anyone know how to fix this? Here is a link to the page where the button is (test page).[URL]...

View 24 Replies

ActionScript 3.0 :: Start Sound - Delay In Loaded MP3 Playing

Feb 2, 2009

I have recently updated to Flash CS4 and AS3 from Flash 8 - apart from one issue I have with the Sound Object. There seems to be a delay in the loaded MP3 playing when told to. This means that I am unable to add SFX to the game I am developing for a client, because the sound plays about 1-2 seconds after it is told to play. How to tee the Sound up, so that it plays immediately?

The process I am using is this:
Class defined to load all game assets defined in XML

All Sounds are loaded into their own Sound Object and a reference to each is held in an array and passed to the relevant Class (i.e. Player). The relevant Class tells the reference to the Sound to play - it plays, but 2 seconds after the collision detection Event has told the sound to play.

View 4 Replies

ActionScript 3.0 :: External Audio X Animation - Sound Delay

Feb 8, 2011

I have a few animations that run on different scenes each time a scene is loaded the external audio should start with it. Well here is the thing the animation always starts before my audio files and each scene gets bugged. I need to create an action that only allows my scene to start with the audio and also starts loading the next audio so it wont be dellayed.

On the first scene I have the following code:
scene 1 frame 1
var autoPlay:Boolean;
if(!autoPlay){
stop();}
scene 1 frame 2 animation starts and audio 1 loads
import flash.media.Sound;
[Code] .....

View 3 Replies

Delay (2 Seconds) A Video To Play In A Flash Video Player?

Jan 18, 2010

I was wondering how I can delay (2 seconds) a video to play in a Flash Video Player? I know one way is for me to add blank frames but I would like to know some other options.

View 2 Replies

ActionScript 3.0 :: Slight Delay In Button Sounds During Sound Stream?

Jan 30, 2009

I have some sounds on buttons:

Code:
var mySound:Sound = new myLibrarySound();
myButton.addEventListener(MouseEvent.CLICK, playSound);
function playSound(e:Event):void

[code]....

... and that works fine. I then have some streaming music:

Code:
var myStream:Sound = new Sound();
myStream.load(new URLRequest("myPath.mp3"));
myStream.play(0);

... and that works fine too. Now, however, the initial button sounds have a slight delay -- I'd estimate about 150-250 ms. It's enough that rollover click noises happen about the time you click, and click noises happen about the time you release, etc. Now, here's the KICKER. It only happens in FIREFOX. CURSE FIREFOX. Seriously. I've been having so many Flash issues in FF3, it just drives me nuts. Firefox and wmode is a pain, Firefox and sound is a pain, Firefox has been crap for Flash development lately.

View 2 Replies

ActionScript 2.0 :: Delay Before The Frames Play Again?

Jan 23, 2010

This is what i want to do I have a pause button i want it when the picture clicks on the pause button once it stops the frames when they click on it again it starts the framrs again what code can i use to do this. I also have a back and forward button when that is clicked i want a delay set when they click on the back and forward button and release it I want a delay before the frames play again.

View 2 Replies

ActionScript 3.0 :: Create Dynamic Sound To Play Sound-file?

Oct 14, 2009

It's possible to play a sound file through AS, either by loading it from a folder or import it to flash. It's also possible to play a dynamic tone with flash.media.Sound + writeFloat.

But... is it possible to play a sound file with flash.media.Sound + writeFloat in some way? I want to play a sound file without having to deal with any files except the .swf!

View 9 Replies

ActionScript 2.0 :: Play Sound/stop Sound Button?

Feb 13, 2007

i want to make a single button to play a sound, and if pressed again, stop the sound. and if pressed again, play the sound, and so on...
i know it has to be made with a boolean variable, true/false, but i just can't figure out how.

View 13 Replies

ActionScript 2.0 :: Play Sound In Flash?

Feb 25, 2009

are there any possibilities to play sound in flash (actionscript 2), which is defined by a mathematical function like f(t) = 0.5*sin(2*Math.pi*16/27*440*t) ?

View 2 Replies

Play Sound When Flash Is Loaded?

Jul 17, 2009

I have buttons with sound attached in over state and that works just fine, but this means that you are going to hear sounds only when you move cursor over button, how can i make some background sound to play from the moment flash is loaded, even when buttons are inactive, my background image looks like some electrical equipment and and i want to make it sound realistic (sound clip must to be set to loop) and must to start at the moment flash is loaded?

View 3 Replies

Flash Sound Doesn't Play

Dec 16, 2009

I have sound playing in my flash file. My index file is a html file which calls the flash file, and when i run the html file, the sound doesn't play. Does anyone know how I can rectify this?

View 5 Replies

Flash Sound To Play On An IPad?

Apr 5, 2010

Years ago, when I was designing a game site, it was recommended to me to do what you pretty much suggested in your answer to a question about Flash sound: put my sound effects as Flash elements. This works great on every platform except the iPad.

View 2 Replies

Flash :: How To Play Sound From Library In AS3

Apr 23, 2010

In Flash 10/AS3, I added some sound and it seems to be working alright, but I think I'm doing it wrong. I imported the sound into the library, but I believe that it's reloading it from the folder with the swf/sound. I'm loading them like so:

[Code]...

View 1 Replies

Mp4 Video Will Only Play Sound In Flash Cs4?

Sep 17, 2010

I'm using a flvplayback component in flash cs4. The sound from the mp4 video plays fine, but the video doesn't play. I don't know how to check the specific encoding of the mp4. I'm publishing to flash player 10 at 24fps.

View 2 Replies

Actionscript 3 :: Play A Sound Once In Flash?

Jul 19, 2011

I built a Flash site that is being used as a teaching tool. The client would now like to add voiceovers to sections. Is there a way to play a sound once on a movie clip, and if the viewer comes back to that clip then the sound won't play again?

View 3 Replies

Flash :: Play A Sound File Via URL?

Jul 25, 2011

Here is my code

onFrame (1) {
mySound = new Sound();
mySound.loadSound("http://www.mysite.com/spot_mixdown.mp3 ");
mySound.start(0, 0);
}

that play .mp3 file from my website at the first frame. It's work for me!

But when I update spot_mixdown.mp3 (change sound inside but use same filename) on my website and then reload webpage, a sound is not change.

View 2 Replies

ActionScript 2.0 :: Flash To Play A Sound?

Feb 9, 2004

how do i code flash to play a sound? i read the tutorioal and it doesn't seem to work in flash MX . . .

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved