Thank you to you for this track.
Effectively, you have to create two bash files named speaker_mute.sh (to stop the sound) and speaker_unmute (to reset the sound).
As a reminder, a bash allows you to launch shell commands as if you were launching them in a console.
So I created a speaker_mute.sh file (to stop the sound) with the nano editor such as:
sudo nano speaker_mute.sh
....
#!/usr/bin/env bash
/usr/bin/amixer -c 1 sset Speaker mute
...
ctrl + o +ENTER +ctrl x
Then I created the executable such as:
And then I started the command:
It's great: the sound has gone out!
Then I created a speaker_unmute.sh file (to resume the sound) with the nano editor such as:
sudo nano speaker_unmute.sh
...
#!/usr/bin/env bash
/usr/bin/amixer -c 1 sset Speaker unmute
...
ctrl + o +ENTER +ctrl x
Then I created the executable such as:
And then I started the command:
It's great: the sound is back!
Now, actually, you will have to integrate these files into doorpi.ini.
For this, I did this in my doorpi.ini (without Piface card):
...
[onboardpins_OutputPins]
16 = IR
...
[onboardpins_InputPins]
11 = sleep: 0
...
[EVENT_OnKeyUp_onboardpins.11]
10 = call:22
...
[EVENT_OnCallStateConnect]
;10 = out:IR,1,0,60
20 = os_execute:/home/pi/speaker_unmute.sh
...
[EVENT_OnCallStateDisconnect]
;10 = out:IR,0
20 = os_execute:/home/pi/speaker_mute.sh
...
Alles anzeigen
And if I now activate the bell button, I have my smartphone that sounds.
Then I pick up: I have the sound.
And then I hang up: the sound cuts.
It's awesome!
Pat