A Flash Developer Resource Site

Results 1 to 1 of 1

Thread: Common Sound Problems - Read before Posting

  1. #1
    Registered User
    Join Date
    Apr 2001
    Location
    Akron OH, USA
    Posts
    4,841

    Common Sound Problems - Read before Posting

    Why does my loop have a gap in Flash but loops fine in my audio editing software?
    import as wav/aiff not as mp3.

    mp3 encoders tend to add silence to the beginning or end of files. Flash places loop points at beginning and end of file including the silence, which causes the gaps. If you use Flash to encode with mp3 it will preserve original loop points and there will be no gap in the loop.

    You can convert a mp3 to wav and reimport into flash. However, you will still need to re-edit the wav because it contains the gap introduced by mp3 encoding.

    How can I have backing music play across scenes?
    load the sound in an external SWF into a different level using:

    loadMovieNum("urlto.swf", levelnum);

    Attached sounds in external swf do not play?
    use: mysound = new Sound(this);

    sound objects need to be associated with a unique movie clip to work properly. the keyword "this" associates a sound object with the current timeline.

    Why is my sound object controlling volume or pan of all sounds in the movie?
    a sound object without an associated mc is a "global" sound object and controls volume and pan of all loaded sounds.

    to ensure that a sound object controls just one sound pass the target path of a unique movie clip to the sound function.

    myuniquesound = new Sound(target path to unique mc);

    OR

    // dynamically create a mc and associate it with a sound object
    soundobject = new Sound(createEmptyMovieClip("snd",getNextHighestDep th()));

    How can I create a preloader script for linked/attached sounds?
    1. Add the sound to your movie in the FRAME you want it to load.
    2. Set the sound to stop sync to prevent it from playing after it loads.
    3. In linkage dialog, give the sound a linkage ID, click "Export for Actionscript" and uncheck "export in first frame". Flash loads the sound symbol in the frame containing the sound, not the first frame.
    4. call attachSound("linkageID") in a frame AFTER the frame that the sound loads, or else Flash will not connect the sound and sound object.


    Why does my mp3 play at a different pitch or speed when I load into Flash?
    Flash supports the following sample rates for mp3.

    44.1khz
    22.05khz
    11.025khz

    Some mp3 encoders can also export to 32khz, 16khz and 8khz. Flash does not support these sample rates and will play at a higher or lower pitch. Make sure your mp3 encoder always outputs at one of the above 3 sample rates.

    Why does my stream sync sound playback with poor quality?
    The Flash IDE has tended to ignore compression settings in the Sound Properties window for stream sync sounds. Instead, use the Flash tab of the Publish Settings window to set overall compression for all stream sounds, not sound properties window.
    Last edited by hp3; 06-04-2007 at 04:07 PM.

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