How to make my system tell me if the phone is ringing?

Completely and utterly unrelated.

Moderators: raboof, MattKingUSA, khz

Post Reply
User avatar
unfa
Established Member
Posts: 129
Joined: Tue May 17, 2011 10:43 am
Location: Warsaw, Poland
Has thanked: 1 time
Been thanked: 19 times
Contact:

How to make my system tell me if the phone is ringing?

Post by unfa »

--- THEORY

I use Linux Mint with KX Studio at work. Sometimes I don't hear the wired phone ringing right next to me.

I taped old earbuds to the bottom of the phone chasis. I've connected this to the mic input of my PC and I have audio feed from there (in stereo!).

I'll capture a phone ringing sample and I'd like my system to analyze this audio in realtime and somehow let me know when it detects that my phone is ringing.

I'm thinking about maybe using the recorded sample as an IR and process the sound input through that.

The IR will filter out any frequencies not present in the original sound, so everything else filtered thorugh this should come out much quieter, and oncve all the frequencies match perfectly, the signal level should be the highest. After that using a simple gate can make this signal break though to my headphones, or using an additional sidechain compressor I can make all the other sound attenuate to let me hear the phone ringing - or a combination of both.

I also thought about maybe adding a MIDI trigger and a MIDI-listening Bash script to add a desktop notification pop-up to the system :)

I'll play around and see what I can get.

--- PRACTICE

I've created a Carla setup that does the job.
Carla patchbay screenshot.
Carla patchbay screenshot.
Selection_092.png (115.25 KiB) Viewed 859 times
PhoneListen 04.carxp.tar.gz
Carla project.
(5.53 KiB) Downloaded 90 times
2017-01-18 earbuds IR.wav
Phone alarm sample.
(81.67 KiB) Downloaded 84 times
It feeds the system input to IR convolution reverb processor that uses a phone alarm sample.
Then this runs to a Calf Gate to make sure only the loudest signal gets through.
This is then fed to an AM pitchshifter that shifts this 2 octaves down.
This goes to a plugin called "Onset Trigger - Bassdrum Detection Mono" - the plugin only reacts to lower frequencies, so this is why the pitchshifter is needed.
This sends MIDI notes to ZynAddSubFX, that produces a cool but pleasant "alarm" sound.
Also a Calf Sidechain Compressor is used to attenuate PulseAudio JACK Sink while the phone is ringing. A reverb is put inthe middle to make the attenuation smoother (I could probably just use the SIdechain Compressor Attack/Release).

Slapping the phone chasis very hard with my hand triggers the alarm, but that's not something that happens randomly. And calliong that phone also triggers the alarm. So I guess this works!

One more thing is to make this run with my system.

So I wrote a bash script:

Code: Select all

#! /bin/bash

# run Carla in headless mode
carla -n /data/Projects/PhoneListen/Carla/PhoneListen\ 04.carxp &

# disconnect unneded routing
jack_disconnect "PulseAudio JACK Sink":"front-left" system:playback_1
jack_disconnect "PulseAudio JACK Sink":"front-right" system:playback_2

jack_disconnect "alsa2jack":"capture_1" system:playback_1
jack_disconnect "alsa2jack":"capture_2" system:playback_2
It just needs to run with the system and I won't even notice that it's there until I open some JACK routing program.

Yay!
jonetsu
Established Member
Posts: 2036
Joined: Sat Jun 11, 2016 12:05 am
Has thanked: 10 times
Been thanked: 22 times

Re: How to make my system tell me if the phone is ringing?

Post by jonetsu »

This is a nice way of doing it.
aicram
Established Member
Posts: 135
Joined: Wed Jan 28, 2009 2:24 am
Has thanked: 1 time

Re: How to make my system tell me if the phone is ringing?

Post by aicram »

Very creative and impressive. Will be studying this. Thanks for sharing!

Sincerely,
aicram
User avatar
unfa
Established Member
Posts: 129
Joined: Tue May 17, 2011 10:43 am
Location: Warsaw, Poland
Has thanked: 1 time
Been thanked: 19 times
Contact:

Re: How to make my system tell me if the phone is ringing?

Post by unfa »

Thanks!

I had to tune my gate threshold, because me blowing my nose caused the phone alarm to set off :D

But the IR and Gate for recognizing a sound is working pretty effective, I'm even surprised.
I tried using an EQ approximation with 4 +20dB peak filters, highpass and lowpass - but that wasn't working. It picked up all the different sounds also.

IR is great though.
Post Reply