SoundLoop

Kind of class: public class
Package:
Inherits from:
  • none
Version: 7 Mar 2010
Author: John Polacek, john@johnpolacek.com
Classpath: com.johnpolacek.media.SoundLoop
File last modified: Tuesday, 01 March 2011, 16:12:31
Loads audio files and plays them in a loop. Sound playback begins automatically.
Example
  • import com.johnpolacek.sound.SoundLoop;
    var soundLoop:SoundLoop = new SoundLoop("sample1.mp3", "sample2.mp3", "sample3.mp3");
    

Summary

Constructor
Instance properties
  • currentSound : int
    • Index of the current sound playing in the loop
  • numSounds : int
    • Number of sounds in the loop
Instance methods
  • play () : void
    • Begins playback
  • stop () : void
    • Stops playback
  • fade (seconds:Number = 5) : void
    • Fades out audio

Constructor

SoundLoop

function SoundLoop(...urls)
Parameters
urls:Audio file urls

Instance properties

currentSound

currentSound:int(read,write)

Index of the current sound playing in the loop

numSounds

numSounds:int(read,write)

Number of sounds in the loop

Instance methods

fade

function fade(seconds:Number = 5) : void

Fades out audio

Parameters
seconds:Length of the audio fade out (in seconds)

play

function play() : void

Begins playback

stop

function stop() : void

Stops playback