You are not logged in.

#1 2016-01-30 14:03

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,989

Custom voice messages

Hi all, I thought I would post here a quick explanation of how I get custom voice messages on my computer.

To explain a little you may use bash scripts to do something and you would like it to tell you when it is finished, one way to do this could be a kdialog message box, but as I am not always looking at the screen running the script I wanted an audible notification.

So I went back to a script I created to make my pc talk to my grandchildren which uses a small program called pico2wave

SCRIPT:- /home/dai/bin/say

#!/bin/bash
pico2wave --lang=en-GB -w=/tmp/test.wav "$1"
aplay /tmp/test.wav >/dev/null 2>&1
rm /tmp/test.wav

This script simply says what you type, for example if you type

say "Hello this is your computer talking to you"

It will speak the text you entered

In a script you could use it inside if conditions to notify of the direction a script is going, or pretty much anything really.

I adapted the script a little to save the output to a wav file for use with the sound notifications

SCRIPT:-/home/dai/bin/saytofile

#!/bin/bash
pico2wave --lang=en-GB -w=/home/dai/Documents/Music/Sounds/test.wav "$1"
aplay /home/dai/Documents/Music/Sounds/test.wav >/dev/null 2>&1

This will save the file as test.wav and play it back to you to confirm it sounds ok. What I do is rename the file to something relevant afterwards and then I can use it in system notifications as a greeting or logout or any other sound.

To install pico2wave either use synaptic or from the command line enter

sudo apt-get install libttspico-utils

this will install all that is required to run these scripts as  aplay should already be installed.

I hope some of you might find this useful.

Dai

Offline

#2 2016-01-30 15:25

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 4,222
Website

Re: Custom voice messages

Very nice, thanks you for well arranged tips Dai.

Offline

#3 2016-01-30 15:29

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,989

Re: Custom voice messages

Thank you, and you are welcome
smile

Offline

#4 2016-01-30 16:09

JimW
Member
Registered: 2015-12-08
Posts: 400

Re: Custom voice messages

Dia -
I kept missing my ham net meetings on Tuesday night at 8:15PM. So I made a .wav file and set up cron to play the file, using aplay, about 10 min before the net meeting. Works out pretty well for me! smile

Offline

#5 2016-01-30 17:26

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,989

Re: Custom voice messages

Excellent use for cron Jim. There are so many things you can do with q4os (and linux in general) to make life easier.

Dai

Offline

#6 2016-04-01 22:23

RichardPr
Member
From: Morocco
Registered: 2016-03-30
Posts: 3
Website

Re: Custom voice messages

Are there tags that correspond to custom questions that would allow me to embed the answers into a confirmation email to either the registrant and/or the coordinator if that module is installed?

JF

Offline

#7 2016-04-01 22:50

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,989

Re: Custom voice messages

I don't understand what you want to know, do you want to be able to email someone if you install something?

Offline

Board footer

Powered by FluxBB