SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2006
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Flash Player 9 and sound.start(time)

    Hi,

    I've been using Flash to deliver audio clips on a work-related eLearning project I've put together.

    The Flash loads in an mp3 (constant bitrate @ 32kbps) file and then plays a clip from that file using sound.start(startTime) and polling the sound.position property to stop the file when the clip has been played.

    This all works fine with Flash Player 8 installed, but as soon as I install Flash Player 9, the audio clip doesn't start playing from the given position.

    I've even created a little fla that just loads in one of my audio files and plays it from 10 seconds in - still going pear-shaped!

    Code:
    var mySound:Sound=new Sound();
    mySound.onLoad=function(){
    	mySound.start(10,0);
    }
    mySound.loadSound("audio/ChildProtection_00.mp3");
    Instead it's playing from about 15 seconds into the file!

    Anyone got any thoughts on what might be going on here?

    Any help gratefully received - I'm pulling my hair out here.

    Cheers,

    NickJ

  2. #2
    RTFM ashleyk's Avatar
    Join Date
    Dec 2005
    Location
    Rochester, New York
    Posts
    435
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i used your code snippet and can't repeat your problem, though i'm testing it locally.

    I did have some other weirdness that might contribute to your problem, perhaps this modified code might help you?

    Code Actionscript:
    var my_sound:Sound = new Sound();
    my_sound.onLoad = function(success:Boolean) {
    	if (success) {
    		this.start(19);
    	}
    };
     
    my_sound.loadSound("opr0006P.mp3", true);
    my_sound.stop();
    ---------------------------------------
    Ashley Kennedy
    ---------------------------------------
    how does a designer get roped into writing code?

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2006
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for looking at this. Actually, it looks like it was a problem with the MP3 files that FP9 was having a problem with. I've re-exported the audio files using a later version of Audacity and things are working smoothly in FP8 and FP9 now.

    Bizarre!

    Cheers,

    NickJ

  4. #4
    SitePoint Member
    Join Date
    Jul 2008
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm running into this same problem. I'm using LAME to compress MP3s. When I compress at 32kbps Sound.start() seems to start the audio a little after the specified offset. When compressed at 64kbps, it starts a little before the offset. Do you know what compressor/settings you used that worked well in Flash 9?

    Thanks!

    ~E

  5. #5
    SitePoint Enthusiast
    Join Date
    Mar 2006
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think I re-encoded at 64kbps at 44Khz. Can't quite remember though.

    Could be worth trying a different version of the LAME encoder. I did read about some problems with LAME when I was looking at DIVXing movies.

    NickJ


Bookmarks

Posting Permissions

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