Custom script - voice keyer

11 posts / 0 new
Last post
sq5ltl
sq5ltl's picture
Custom script - voice keyer

Hi,

Gentlemen.
It would be nice if you could run an additional window with buttons.
Under these buttons we can find the different scripts.
For example, voice keyer.

I wrote something very simple:

#!/bin/bash
rs232 -d /dev/ttyUSB1 --dtr --rts
mpg321 -o alsa -a hw:1 sq5ltl-A.mp3
rs232 -d /dev/ttyUSB1 --dtr

A brief explanation:

command: rs232 info -> http://sjinn.sourceforge.net/index.html

in my RS-232 port DTR i use for CW and RTS for PTT (psk31 and voice :) )

mpg321 command will come with the Ubuntu package

I have USB interface for digitalmodes, CW, CAT

Used switch: -o alsa -a hw:1

In this command you can find audio device for upper switch:

cat /proc/asound/cards

Thanks.

73! Paweł SQ5LTL

sp2mki
Voice keyer

Hi Pawel,
Today ealy morning when I was tyring to mke conatct with TX5K who woked only on SSB I had recollected your idea how to do simple voice keyer.
It took two hours and it works! In my cqrlog when mode is set to SSB the funtion keys sends messages recoded in Fx.mp3 files from .cqrlog/voice_keyer direcory using script based on your idea.
I'm going to ask Petr to add my changes to his global cqrlog project.
Regards
Darek SP2MKI

wc2l
RE: Voice Keyer

I would love to see it key the memories on my radio!! I have a radio with a built in DVK!
Will WC2L

sq5ltl
sq5ltl's picture
Darek, thanks you for

Darek, thanks you for interest.Temporary i resolve this by using Ubuntu os shorctcuts. Go to setting Keyboard -> Shortcut Now you define path to voice keyer scripts + keys (i use Ctrl + .)And all works!

73! Pawel

pd1sr
pd1sr's picture
Great option a simple bash

Great option a simple bash voice keyer
i got my soundcard correctly for me its hw:2 but somehow couse of the use of SCU17 for yaesu 950 it clicks on and off.
Soundfile hardcored /home/user/audio/voice/cq.mp3

It says its transmitting but it actualy already lost ptt i also set 9600 baut and a 2sec wait on rs232.

But i realy love the idea that this is the best option and most simplest for linux users of any distro and any setup.

pd1sr
pd1sr's picture
rigctl

meybe this is an option for it
rigctl --help :D

oh1kh
voice keyer

HI !

This is already default:

When "NewQSO" is in SSB/FM/AM mode and focus is on that window function keys will launch ~.config/cqrlog/voice_keyer/voice_keyer.sh with 1st parameter as function key name (F1 ... F9).

So what do we need more ? Or have I misunderstood something?

Ok , sometimes it annoying that NewQSo must be focused, if not function keys will not work.
Also window CWkeys-window can be used in same way as they work when CW mode is selected.

Then just create the script voice_keyer.sh as you like. It can say something to radio or even make coffee ready for you. It is just up to your script.

You can use console command "nc" to key your rig via hamlib. Or send any other command to hamlib-> rig.

#!/bin/bash
# install sox with all soundformats support
# Use "rec F1.mp3" to record F1 message. End recording with Ctrl-C.
# same with F2.mp3 Etc....
# you may use also mpg123 or what ever terminal mode player you wish

# cqrlog "TRX control"/"Extra command line arguments" add following
# text "-p /dev/ttyXXX -P YYY" (you may all ready have some text there)
# Where XXX os the same device as you have in "TRX control"/"Device"
# and YYY is the line you have connected (via relay or transistor) to
# your rig's PTT (usually DTR or RTS)
# At "TRX control"/"Radio xxx serial parameters set handshake none
# and at least your YYY (DTR or RTS) to "Unset"

if ! ps aux | grep -q '[m]pg123'
then
#ptt via rigctld on
echo 'T1' | nc --send-only -t 127.0.0.1 4532
#select audio card (if more than one)
#export AUDIODEV=hw:1,0
#play F-key message
mpg123 ~/.config/cqrlog/voice_keyer/$1.mp3
#ptt via rigctld off
echo 'T0' | nc --send-only -t 127.0.0.1 4532
else
#halt playing message (if pressed while playing)
killall play
fi

--
Saku
OH1KH

--
Saku
OH1KH

oh1kh
voice keyer , small fix

After reading last post again there could be a small fix added.
If you have very long recording and you halt it with second press of same F-key you might like the PTT to be off also :).
And killing mpg123 would be better than killing play, that is another way to make sound and was left there when I last edited my script.
(As you see halting output does not happen very often as I had not noticed the error in script :D .D :D )

Just fix the order of last lines like:

#play F-key message
mpg123 ~/.config/cqrlog/voice_keyer/$1.mp3

else
#halt playing message (if pressed while playing)
killall mpg123
fi
#ptt via rigctld off
echo 'T0' | nc --send-only -t 127.0.0.1 4532

So that turning PTT off will be last line of scipt. Then PTT will go off regardless of running direct or else.

I also checked the Help files and there is no mention about voice_keying. It has been added very long time ago to program.
And from source code I found that keys work only when mode is SSB. I will fix this to be FM & AM also and make a pull request with fixed help files.

--
Saku
OH1KH

--
Saku
OH1KH

oh1kh
voice keyer , still

Hi!
I was so wrong also with voice keying working from CWkeys-window. (I need more morning coffee).

Anyhow now I have fixed voice messages to work SSB, FM, and AM modes and also from CWkeys-buttons.
Help files also updated so that voice messages chapter is added.

A pull request is done.

For those who can not wait: Source can be found now from my GitHub/cqrlog-devel and x86_64 binaries from my testweb pages (2.1.0-140).

--
Saku
OH1KH

--
Saku
OH1KH

pd1sr
pd1sr's picture
mpg123 or mpg321

yea 2 of them,
mpg321 ~/audio/voice/cq.mp3 -o alsa -a hw:2,0
witch options in mpg123 i cannot find and its playing the message on my speakers rather than my rig.
yes these options exist in mpg123
and i had set it like that but its still playing on audio device 0,0 instead of 2,0
mpg123 ~/audio/voice/cq.mp3 -o alsa -a hw:2,0
and it output plays on hw:0,0
so dont now about others but im using mpg321 rather than mpg123 ???
(dont mind device 1,0 thats hdmi)
now thats set how does this cwdaemon puppy work :D

oh1kh
mpg123 or mpg321

I have used mpg123.
Might be that there is also mpg321 (???)

But if that does not work you could use some other player that can be launched from command line.
One of the simplest is aplay
Could that drive right sound card for you?

--
Saku
OH1KH

--
Saku
OH1KH