Recording incoming reception

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Recording incoming reception

Tim Miller WB0RXX
Good day fellow svxlink users,

I would like to share something that Josh Housey, AB9FT originally came
up with.  I made a few minor changes to his original code to suit my system.

The code goes in either the Simplex.tcl or Repeater.tcl modules, right
below the squelch_open process.  It is so simple that I did not bother
with a diff -u :-)

----------------------------------------------------------------------

#
# Executed each time the squelch is opened or closed
#
proc squelch_open {rx_id is_open} {
   global active_module;

   Logic::squelch_open $rx_id $is_open;
   set activity /var/spool/svxlink/activity/[clock format [clock scan
now] -format {%s}]-rx1.raw;

   if { $active_module != "TclVoiceMail" } {
     if { $is_open } {
        recordStart $activity;
     } else {
       recordStop;
     }
   }
}

----------------------------------------------------------------------

I am running the latest CVS version of svxlink, so the older code does
not have the "rx_id" variable.  Feel free to ignore it.

This change will write a raw audio file to /var/spool/svxlink/activity
with each opening of the squelch.  The file name is derived from the
epoch seconds, which makes sorting a lot easier.  In my case, I append
the receiver number to the end, as there are two receivers with my system.

Unfortunately, only one "recordStart" function can be called at a time.
  The TclVoiceMail module uses this function, so the above addition is
disabled when someone is using voice mail.

Each night at 2359, I run the following script from cron:

----------------------------------------------------------------------

#!/bin/sh
#
DATE=`date +%F`
cd /var/spool/svxlink/activity

cat *-rx1.raw > $DATE-rx1.raw && \
sox -sw -r8000 $DATE-rx1.raw $DATE-rx1.wav && \
rm -rf *-rx1.raw

cat *-rx2.raw > $DATE-rx2.raw && \
sox -sw -r8000 $DATE-rx2.raw $DATE-rx2.wav && \
rm -rf *-rx2.raw

----------------------------------------------------------------------

This appends the daily voice captures from both receivers into a wav
file named YYYY-MM-DD-rx[1|2].wav.  You may wish to watch your free disk
space, as these files can quickly grow rather large.

Thanks again to Josh and of course, Tobias, for the great software!

73 de Tim

--
Tim Miller WB0RXX [EN24dw]
SvxLink v0.8.0rc8 (May 18 2006)/Slackware 10.1/P200 MHz/64 MB
http://MontevideoComputers.com/ham/projects.html#svxlink

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Svxlink-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/svxlink-devel