Tone stream

From FreeSWITCH Wiki

(Redirected from Mod tone stream)
Jump to: navigation, search

tone_stream://[L=x;]%(<on-duration>, <off-duration>, <freq-1> [, freq-2] [, freq-3] [, freq-n] [;loops=x])

  • Durations are specified in milliseconds
  • Frequencies are specified in Hz

L=x; or ;loops=x ... loops x times, use ;loops=-1 for endless loop (L=-1; doesn't seem to work though)

Examples

Adds a repeating (loop) 800Hz tone for 100ms with a 15 second pause to a session:

 <action application="displace_session" data="tone_stream://%(100,15000,800);loops=-1" />

Plays a stutter-like tone for 100 times:

 <action application="playback" data="tone_stream://L=100;%(100,100,350,440)" />

The frequencies specified are all additive. For example, %(4000,0,350,440) will simply play a four second of 350 Hz with 440 Hz overlaid. To mimic frequency modulation, ring modulation theory can be used. Ring modulation works by taking the frequencies output by two oscillators, and both adding and subtracting them, producing "sum and difference" frequencies. For example, the ringback tone of Romania is 450 Hz modulated by 25 Hz, for 1.85s on and 4.15s off. So frequency 1 should be 450 + 25 = 475 Hz, and frequency 2 should be 450 - 25 = 425 Hz:

 <action application="playback" data="tone_stream://%(1850,4150,475,425);loops=-1" />

See TGML for more information.

Worldwide Frequencies and Cadences Listed by ITU-T

Various tones used in national networks (According to ITU-T Recommendation E.180) Updated 1st May 2010.

Personal tools

Community
Support FreeSWITCH