A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: [F9, AS2] Audio Latency

  1. #1
    [Horse Thief] gotoAndCrash's Avatar
    Join Date
    May 2007
    Location
    NW, USA
    Posts
    576

    [F9, AS2] Audio Latency

    Greetings All,
    I'm working on a project similar to a clone of the old game "Simon" (remember that?!), & I'm having an audio latency issue, which only appears to be present on PCs. Upon keypress I'm attaching a sound from the library, & on PCs the sound is significantly delayed.
    Does anyone have any ideas/methods for eliminating a latency? For this project it's crucial that the sound is prompt.

    Thanks,
    gtc.
    1 Infinite Loop, Cupertino is a portal of Hell.

  2. #2
    Senior Member
    Join Date
    Jan 2008
    Location
    UK
    Posts
    269
    Perhaps you could try creating a movie clip which has the sounds one after the other already set out on the time line. Attach the movie clip before the game starts, and use the gotoAndPlay and gotoAndStop functions to play the desired sounds. Probably a bit of work, but maybe if the movie clip is already added from the library, the latency might go away. Just a thought.

  3. #3
    [Horse Thief] gotoAndCrash's Avatar
    Join Date
    May 2007
    Location
    NW, USA
    Posts
    576
    That's kind of the way that it was before it got to me - it was actually set up with each sound being in it's own movie clip, & then each clip was played as needed. I improved it a bit by attaching sounds to the stage & pushing them into an array, then using constants to access them. It was improved, but is still far easier to play on a Macintosh - & I swear I'm not just being a fanBoy!

    Thanks for replying
    1 Infinite Loop, Cupertino is a portal of Hell.

  4. #4
    Funkalicious TOdorus's Avatar
    Join Date
    Nov 2006
    Location
    Nijmegen, Netherlands
    Posts
    697
    Quote Originally Posted by gotoAndCrash
    Upon keypress I'm attaching a sound from the library
    Everytime the key is pressed??? You only need to attach the sound from the library to one Sound object and tell the sound to play when needed. Saves you the hassle with movieclips too.

  5. #5
    I remember my first Flash
    Join Date
    May 2001
    Location
    Slovak Republic
    Posts
    143
    I have exact the same problem and it is not because of the attachSound. I attach the sounds in class constructor and on release I only call start(). And the latency is really notable. But I have suspicion that it is all because of Vist. Omg I hate Microsoft so much...
    Inks! Minks! The old witch winks, that fat beings to fry! No body home but Jumping Joan, father, mother and I! Sticks! Stocks! Stone Dead! Blind men can't see! Every knave will have a slave, you or I must be he!

    Hostess Judy / Æon Flux.

  6. #6
    [Horse Thief] gotoAndCrash's Avatar
    Join Date
    May 2007
    Location
    NW, USA
    Posts
    576
    Yeah, I ended up doing the attachSound then just playing it later (just like you said TOdorus, though I didn't see this until today!). But I also noticed a latency occurring when there was a lot of action or animation on the screen - or even if there were a lot of complex vector art (like a file imported from Illustrator which creates far too many "art" shapes - which was the case in the file that sparked this post in the first place).

    I hate Microsoft, too!!!
    1 Infinite Loop, Cupertino is a portal of Hell.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center