BoxSymbol Clock.png
This is an archive.
See the new ClickWiki at https://clickwiki.github.io. This version is just an archive for the purposes of migrating content to the new structure.


Jump to: navigation, search

Sound Object


Icon SoundObject.png
Author Official extension or is supported by Clickteam.
Status Released
Release Date 1998
Last Updated 2006
Available for Multimedia Fusion 1.5 The Games Factory 2 Multimedia Fusion 2 Standard Multimedia Fusion Developer 2 Clickteam Fusion 2.5 Free Edition Clickteam Fusion 2.5 Standard Clickteam Fusion 2.5 Developer
Supported Runtimes Windows Runtime Compatible with the Mac Runtime Flash Runtime iOS Runtime Android Runtime HTML5 Runtime XNA Runtime (now deprecated) UWP Runtime
License Free
Attributes {{{Attributes}}}
Download
Includes Examples No
Includes Help Files Yes
Links Included with Fusion.
Alternates DirectShow, Sound Player

The Sound object plays different sound files in your Clickteam Fusion 2.5 applications. The formats supported depend on your version of Clickteam Fusion 2.5 and on the sound filters installed. All the versions of Clickteam Fusion 2.5 support at least .WAV, .MOD and .MID files. Samples and music can be started, stopped, and looped using this object. The Sound object can also detect if a sound or music is not playing, should you want to trigger an action at the end of a particular sound effect. It is always available so you don't need to add an object to a frame to play sounds.

The sounds played by the Play Sample and Play Music actions of the Sound object are integrated into the application's file, you do not need to redistribute them with your application. The sounds played by the Play Sample File and Play Music File actions are not embedded into your application and should be redistributed with your stand-alone application.

The Sound object is a system object: it is only available in the event editor.


Formats Supported

File Extension Description Compatibility with Exporter
Windows Runtime Compatible with the Mac Runtime Flash Runtime iOS Runtime Android Runtime HTML5 Runtime XNA Runtime (now deprecated) Java Runtime (now deprecated) UWP Runtime
Samples
.wav Microsoft Wave Sound Yes ? ? ? ? ? ? ? ?
.ogg OGG Vorbis Yes ? ? ? Yes Yes ? ? ?
.aif / .aiff Audio Interchange File Format Yes ? ? ? ? ? ? ? ?
.mod / .it / .s3m / .xm Amiga Music Module File Yes ? ? ? ? ? ? ? ?
.mp3 MPEG-2 Audio Layer III No ? ? ? ? Yes ? ? ?
Music
.mid / .rmi MIDI Sequencer Files Yes No No No ? No No No ?


Internal vs External

Depending on the platform you are building for, you will have to face a choice of whether you want your audio to be internal to your application, or as external files elsewhere on the system.

Internal

Files that are internal are saved within the application itself. This is the case with many mobile runtimes (such as iOS and Android). For the Windows runtime, this packs the audio inside the executable itself, making it difficult for hackers to steal assets.

External

External files are stored outside of the application, so it is important that you check they exist prior to trying to play such file (otherwise nothing will play with no error). These files could be relative to the application's working directory (by using 'Apppath ) or played based on the user's system (for instance, they have selected their own audio file in a Fusion-built media player)


Features

The Fusion runtime can use up to 32 channels for samples as well as offer additional features for its playback. Do note that some of these features are not available in all exporters.

  • Loop samples a number of times or forever.
  • Pause and resume specific samples or channels.
  • Stop a specific sample or channel altogether.
  • Pan (set the position with stereo speakers) of specific samples or channels.
  • Rearrange the position of a specific sample or channel.
  • Set the frequency of a specific sample or channel.
  • Lock and unlock channels.

Conditions

Samples

The Samples conditions test for sound samples being played or paused. The Samples conditions are

Is a sample not playing?

Tests to see if any sound sample is not playing.

Is a specific sample not playing?

Tests to see if a specific sound sample is not playing.

Is a specific channel not playing?

Tests to see if a specific channel is not playing.

Is a specific sample paused?

Test to see if a specific sound sample is paused.

Is a specific channel paused?

Test to see if a specific sound channel is paused.

Music

The Music conditions test for MIDI music files not being played. The Music conditions are

Is music not playing?

Tests to see if any MIDI music file is not playing.

Is music paused?

Tests to see if a music is currently paused.

Is specific music not playing?

Tests to see if a specific MIDI music file is not playing.

Has music just finished?

Tests to see if any MIDI music file has finished playing.

Actions

Samples

Play Sample

The Play Sample action plays a specific sound sample.

Play sample on a specific channel

Plays a sound on one of the 32 different sound channels available.

Play sample file on a specific channel

Plays an external sample file on one of the 32 different sound channels available.

Play And Loop Sample

The Play And Loop Sample action plays a sound sample and replays the sample the number of times you specify. If the number of loops is equal to 0, the sample will continuously loop.

Play and loop sample on a specific channel

Plays a sound on one of the 32 different sound channels available and replays the sample the number of times you specify. If the number of loops is equal to 0, the sample will continuously loop.

Play and loop sample file on a specific channel

Plays an external sample file on one of the 32 different sound channels available and replays the sample the number of times you specify. If the number of loops is equal to 0, the sample will continuously loop.

Pause sample

Interrupts the sound being played.

Pause channel

Interrupts the sound played on a specific channel only (1-32). All other channels will continue to play.

Pause all sounds

Interrupts all the sounds being played.

Resume sample

Resumes a paused sample.

Resume channel

Resumes the playing of a specific channel (1-32). Does not interfere with the other channels.

Resume all sounds

Resumes all the paused samples.

Stop a specific sample

Stops a sound being played at the moment.

Stop Channel

Stops the sound being played on a specific channel (1-32). Does not interfere with the other channels.

Stop any sample playing

Stop any sound sample playing.

Set main volume

Changes the main volume level. The volume is indicated by a number from 0 (quiet) to 100 (loud).

Set sample volume

Changes the volume level of a specific sample. The volume is indicated by a number from 0 (quiet) to 100 (loud).

Set channel volume

Changes the volume level on a specific channel (1-32). The volume is indicated by a number from 0 (quiet) to 100 (loud).

Set main pan

Sets the main pan. The pan is indicated by a number from -100 (all the sound on the left, no sound on the right) to 100 (all the sound on the right, no sound on the left), 0 being in the middle.

Set sample pan

Sets the pan of a specific sample. The pan is indicated by a number from -100 (all the sound on the left, no sound on the right) to 100 (all the sound on the right, no sound on the left), 0 being in the middle.

Set channel pan

Sets the pan of a specific channel (1-32). The pan is indicated by a number from -100 (all the sound on the left, no sound on the right) to 100 (all the sound on the right, no sound on the left), 0 being in the middle.

Set sample position

This action changes the position in the sample. It asks for the name of the sample to change, and the index to start playing at, in milliseconds.

Set channel position

Same action as above, but for a specific channel (1-32).

Set sample frequency

Changes the frequency of a specific sample. 0 to use the original frequency of the sound.

Set channel frequency

Changes the frequency of a specific channel (1-32). 0 to use the original frequency of the sounds played on this channel.

Lock Channel

Locks a channel. Locked channels are ignored by the Play Sample action when it looks for an available channel to play a sound on.

Unlock Channel

Unlocks a channel.

Music

Play Music

This action plays a specific MIDI music file.

Play Music File

This action plays an external MIDI music file.

Play And Loop Music

This action plays a MIDI music file and replays the music file the number of times you specify. If the number of loops is equal to 0, the music will continuously loop.

Play And Loop Music File

This action plays a MIDI music file and replays the music file the number of times you specify. If the number of loops is equal to 0, the music will continuously loop.

Pause music

Temporary stops the music.

Resume music

Resumes a paused music.

Stop any music playing

Stops the music playing.


Tips & Tricks

Play different samples one after the other

There is no condition to check when a specific sample has finished playing, therefore, this can be worked around by using a form of counter. In this example, we will be using a global variable.



Special Conditions Sound Object Storyboard Object
1 • Start of Frame
2 • No sample is playing

• Global Variable A = 0

3 • No sample is playing

• Global Variable A = 1

4 • No sample is playing

• Global Variable A = 2

5 • New condition



Contributors to this page

Advaith (53.0%), Lh37 (47.0%)