Function Repository Resource:

PlayTouchTone

Source Notebook

Generate a sound representing the dialing of a touch-tone phone

Contributed by: Jan Mangaldan

ResourceFunction["PlayTouchTone"][num]

generates a Sound object representing the sounds made when dialing the phone number num on a touch-tone phone.

ResourceFunction["PlayTouchTone"][num,"Audio"]

generates an Audio object.

Details

The touch-tone or dual-tone multi-frequency (DTMF) system is a telecommunication signaling system that uses a set of audio frequencies transmitted in pairs over telephone lines using the voice-frequency band.
ResourceFunction["PlayTouchTone"] accepts a string representing a valid telephone number, or a list of digits from 0–9.
Letters are interpreted according to their positions in the following keypad:

Examples

Basic Examples (2) 

Dial the Wolfram Research phone number:

In[1]:=
ResourceFunction["PlayTouchTone"]["1\[Dash]800\[Dash]WOLFRAM"]
Out[1]=

Return an Audio object representing the touch-tone:

In[2]:=
ResourceFunction[
 "PlayTouchTone"]["1\[Dash]800\[Dash]WOLFRAM", "Audio"]
Out[2]=

Scope (3) 

Give a phone number as a list of digits:

In[3]:=
ResourceFunction["PlayTouchTone"][{1, 2, 1, 7, 3, 9, 8, 0, 7, 0, 0}]
Out[3]=

Only characters that can be interpreted for a valid phone number are taken from a string:

In[4]:=
ResourceFunction["PlayTouchTone"]["867-5309"]
Out[4]=

Dial a USSD code:

In[5]:=
ResourceFunction["PlayTouchTone"]["*139#"]
Out[5]=

Requirements

Wolfram Language 12.3 (May 2021) or above

Version History

  • 1.1.0 – 20 November 2023
  • 1.0.0 – 23 August 2021

License Information