Misc. Dialplan Tools playback
From FreeSWITCH Wiki
Plays a sound file on the current channel.
Contents |
Example
<!--default terminator is *. Keyword 'none' disables on-key termination /--> <action application="set" data="playback_terminators=none"/> <action application="playback" data="sounds/soundfile.wav"/>
The terminator used is available in channel variable "playback_terminator_used"
Example for specific playback variables
<action application="playback" data="sounds/soundfile.wav{var1=val1,var2=val2}"/>
The extra suffix "{var1=val1,var2=val2}" adds specific vars that will be sent in PLAYBACK_START and PLAYBACK_STOP events, this is expecially handy when build ESL applications. In the events the variables will be named "playback_var1" and "playback_var2".
Playback from remote server
<action application="playback" data="${http_get(http://myserver.yo/media/hello_world.wav)}"/>
Supported File Types
FreeSWITCH has an abstraction layer for file formats. Anyone can write a format module which allows file formats to be utilized from any of the places that would deal with them.
Most formats support both reading and writing, the ones that do not are identified below.
mod_sndfile
mod_sndfile libsndfile and therefore supports any format usable by libsndfile. As of libsndfile-1.0.17, the supported formats are:
- AIFF (Apple/SGI) (extension "aiff")
- AU (Sun/NeXT) (extension "au")
- AVR (Audio Visual Research) (extension "avr")
- CAF (Apple Core Audio File) (extension "caf")
- HTK (HMM Tool Kit) (extension "htk")
- IFF (Amiga IFF/SVX8/SV16) (extension "iff")
- MAT4 (GNU Octave 2.0 / Matlab 4.2) (extension "mat")
- MAT5 (GNU Octave 2.1 / Matlab 5.0) (extension "mat")
- PAF (Ensoniq PARIS) (extension "paf")
- PVF (Portable Voice Format) (extension "pvf")
- RAW (header-less) (extension "raw" or "r8" )
- SD2 (Sound Designer II) (extension "sd2")
- SDS (Midi Sample Dump Standard) (extension "sds")
- SF (Berkeley/IRCAM/CARL) (extension "sf")
- VOC (Creative Labs) (extension "voc")
- W64 (SoundFoundry WAVE 64) (extension "w64")
- WAV (Microsoft) (extension "wav")
- WAV (NIST Sphere) (extension "wav")
- WAVEX (Microsoft) (extension "wav")
- XI (FastTracker 2) (extension "xi")
mod_shout
Additionally, mod_shout supplies MP3 support for files and shoutcast streams
See Also
- The sound_prefix channel variable.
- Misc._Dialplan_Tools_displace_session - allows you to mix audio
- mod_sndfile
- mod_shout
- mod_local_stream
- mod_native_file
- mod_file_string
- mod_tone_stream

