NAME

SWF::Builder::Character::Sound - SWF Sound character

SYNOPSIS

my $sound = $mc->new_sound( 'ring.mp3' );
$sound->play;

DESCRIPTION

This module creates SWF sound characters from MP3 or raw Microsoft WAV files.

$sound = $mc->new_sound( $filename )

loads a sound file and returns a new sound character. It supports only MP3 now.

$sound->play( [ %options ] )

plays the sound.

Options:

MovieClip => $mc, Frame => $frame

'MovieClip'(MC) is a parent movie clip on which the sound is played. If MC is not set, the sound is played on the movie clip in which it is defined. 'Frame' is the frame number on which the sound is played.

Multiple => 0/1

avoids/allows multiple playing. If 0, don't start the sound if already playing.

Loop => $count

sets the loop count.

In => $in_msec, Out => $out_msec

'In' sets the beginning point of the sound and 'Out' sets the last in milliseconds.

Envelope => [ $msec1, $volumelevel1, $msec2, $volumelevel2, ... ]

sets the sound envelope. Volume level is set to $volumelevel1 at $msec1, and $volumelevel2 at $msec2, ... Volume level can take a number from 0 to 32768, or a reference to the array of volume levels of left and right channels.

$sound->stop( [ MovieClip => $mc, Frame => $frame ] )

stops playing the sound. It can take 'MovieClip' and 'Frame' options as same as the 'play' method.

$sound->start_streaming( [ MovieClip => $mc, Frame => $frame ] )

starts the streaming sound, which synchronizes with the movie timeline. It can take 'MovieClip' and 'Frame' options as same as the 'play' method.

$sound->Latency( $msec )

sets the sound latency in milliseconds.

COPYRIGHT

Copyright 2003- Yasuhiro Sasama (ySas), <ysas@nmt.ne.jp>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.