-
Notifications
You must be signed in to change notification settings - Fork 2
PlaySound
Manno edited this page May 8, 2016
·
2 revisions
The PlaySound demo demonstrates the second most basic way to play audio. Next to that it demonstrates conditionals in the project.xml importing assets based on the target platform (here neko or flash).
the most basic way to play a sound would be:
var snd:Sound = Assets.getSound( "path/to/AudioAsset" );
snd.play();
// or condensed into one line:
Assets.getSound( "path/to/AudioAsset" ).play();
This demo however uses the SoundChannel reference returned by the play() method in order to later control the sound. The SoundTransform to set panning and volume is only used with its default values in this demo. Check out the api link for it's use and change the values in the demo to see it work.