Compo
Posts: 4
Joined: Sun Sep 28, 2014 12:42 pm

Phone to Audio clip player?

Sun Sep 28, 2014 12:49 pm

-Please excuse my total ignorance of all things Raspberry at this time and please feel free to correct any misconceptions or terminology errors in the text below. I’m not as young as I used to be and finding the mere idea of all this stuff scares me senseless. This post is the very start of my journey into YOUR world!-

Here’s what I need to achieve:

I want to be able to use and old dial phone (this would be pulse dial but we can easily convert this to tone dial if needed).
When the receiver is lifted and a combination of numbers are dialled (can be 2,3 or whatever is possible and easiest?) I need the Raspberry? To recognise which numbers have been dialled and, depending on which set of pre-determined numbers it recognises, create a “contact closure” event (output).

This output would be connected to a triggered audio clip player* (that we already own) and a specific audio track would playout.** A different clip depending on the dialled umber. Somewhere between 8-32 different clips could be programmed.

*perhaps it would be possible to store these clips in the Raspberries memory??
**Playout of the audio would be routed to the connected phones earpiece. We could easily hard wire from the separate audio player. ...or Perhaps there would be a way to pass it out of the Raspberry if the audio clips were on-board??

So basically I’m trying to create a miniature telephone exchange that can trigger audio clips.
I would be most grateful if anyone could tell me if this is actually possible using the Raspberry Board and what other components I might need?

Phew! Thanks

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 13142
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Phone to Audio clip player?

Sun Sep 28, 2014 1:09 pm

for detecting a POTS pulse dial, you will need a current sense reed relay, put in series with the phone line. Pulse dialing consist of a repetitive disconnection of the line current, in a 10 Hz rhythm, with 1 pulse for the "1" digit, 2 for the "2" digit etc, and 10 pulses for the "0". Tone dialing uses two tones each out of a group of four high and a group of four low tones, (DTMF) to reliable decode these you need a specific tone detection IC, like the MT8870 DTMF decoder. details here:
http://www.siongboon.com/projects/2005- ... _circuits/. You cannot directly connect the DTMF signal to the IC, but must use a telephone transformer, with a DC blocking capacitor. like the P1200. http://nl.farnell.com/etal/p1200/transf ... dp/1130832

You can also use such a transformer to inject your music onto the phone line.

Compo
Posts: 4
Joined: Sun Sep 28, 2014 12:42 pm

Re: Phone to Audio clip player?

Mon Sep 29, 2014 1:13 pm

Thanks mahjogg.

That answers one question. I need a DC blocking capacitor in order to input the DTMF tones to the Raspberry IC.
Am I correct?

Am I to assume by this that it will also be possible to then program the Raspberry to complete the tasks listed in my email and give me an option to use contact closure outputs?
I'm told its a N/O 3.3v to ground trigger - whatever that is?

Any chance of a kit list of the stuff I might need?

PiGraham
Posts: 3971
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Phone to Audio clip player?

Mon Sep 29, 2014 1:29 pm

Is this is a phone that is not connected to a phone line?
[ETA]
If you want to use the phone audio circuit you may need to provide power to the phone.

http://en.wikipedia.org/wiki/Plain_old_ ... ne_service

This may help with the connections on the phone
http://en.wikipedia.org/wiki/British_telephone_sockets

Do you want the sounds to play through the phone handset or a loudspeaker?
Last edited by PiGraham on Mon Sep 29, 2014 2:03 pm, edited 1 time in total.

User avatar
Douglas6
Posts: 4874
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Phone to Audio clip player?

Mon Sep 29, 2014 1:38 pm

See if this guide from SparkFun on hacking on old (US) rotary phone is helpful: https://www.sparkfun.com/tutorials/51. Decoding the dialer could be done with a small microcontroller, and you could use Adafruit's audio FX board to to trigger up to 11 clips. Or the Pi can certainly do it all.

PiGraham
Posts: 3971
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Phone to Audio clip player?

Mon Sep 29, 2014 2:02 pm

Good find Douglas.

Of course the dial is just switches, so if the requirement is only to use the dial as a controller then hack just the switches direct to gpio.

Pi can do the whole thing, with as many audio clips as you like.

Compo
Posts: 4
Joined: Sun Sep 28, 2014 12:42 pm

Re: Phone to Audio clip player?

Mon Sep 29, 2014 2:27 pm

Is this is a phone that is not connected to a phone line?
[ETA]
If you want to use the phone audio circuit you may need to provide power to the phone.Do you want the sounds to play through the phone handset or a loudspeaker?
I am fine with all the audio and power stuff. I currently convert old phones to play clips through its own earpiece when the receiver is lifted using an audio clip player. http://www.ebay.co.uk/itm/191350974654? ... 1555.l2649 and http://www.ebay.co.uk/itm/191350978343? ... 1555.l2649
No real phone lines involved!

I'm also fine with converting the phones from Pulse to tone dial etc.

What I'm trying to establish is IF the Raspberry can then be used as an input (like a mini telephone exchange) and be programmed to recognise the different numbers/switchings inputted to it and then to tell a corresponding output to act as a contact closure and close (or switch).
i.e. If I dial 123 contact closure (output) switch A will trigger enabling me to trigger one of the audio clips via the audio player unit.
If I dial 124 then a different output would switch and be connected to a different audio clip and so on.

Can it be programmed to do this?
And do I need anything other than the standard board? ...or additional hardware (apart from the blocking capacitor mentioned in the first reply).


This being my first attempt at anything Raspberry, and not actually owning any of the stuff at the moment could anyone give me a vague kit list of components required to complete my task?
I'm sure if I know it can be done and have the stuff in front of me I can almost muddle through and perhaps future questions here would be more precise in nature.

Compo
Posts: 4
Joined: Sun Sep 28, 2014 12:42 pm

Re: Phone to Audio clip player?

Mon Sep 29, 2014 2:29 pm

Douglas6 wrote:See if this guide from SparkFun on hacking on old (US) rotary phone is helpful: https://www.sparkfun.com/tutorials/51. Decoding the dialer could be done with a small microcontroller, and you could use Adafruit's audio FX board to to trigger up to 11 clips. Or the Pi can certainly do it all.
This looks like the right direction - Thanks!

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 13142
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Phone to Audio clip player?

Tue Sep 30, 2014 10:03 pm

Compo wrote:Thanks mahjogg.

That answers one question. I need a DC blocking capacitor in order to input the DTMF tones to the Raspberry IC.
Am I correct?
The raspberry IC? No! First the PI itself (The "raspberry IC") doesn't have an audio input into which you can input (DTMF) audio, secondly decoding DTMF audio signals in code isn't trivial. you can send the DTMF signal to the dedicated DTMF decoder IC I mentioned, then interface the IC to the PI's GPIO,s.
But as I understand the "telephone" isn't actually connected to a telephone line, it will not receive any power thus its DTMF generator won't work. In which case it will be much easier to use the pulse dial contact in a rotary dial telephone. Its just a switch,and can be interfaced to the PI like any other switch/button.

Unimatrix01
Posts: 2
Joined: Wed Feb 04, 2015 7:47 pm

Re: Phone to Audio clip player?

Wed Feb 04, 2015 8:13 pm

Hi all,
I am new here and stumbled across this post via Google. I've known about the Pi since it was first released but I never got to the point where I needed one until now. This is exactly what I am wanting to do myself but haven't a clue how to do it .I am wanting to use an old rotary dial phone to play back a series of mp3's depending on what numbe is dialled. I don't want you to think that I am hijacking this post as it's exactly what I'm looking for myself . As I am a 100% noob to this I ws wondering if there is a tutorial forthis at all ? A step by step guide or youtube vid would be vey much appreciated. Thans, Craig

Return to “Beginners”