[linux-audio-user] audio record/upload box

joke joke at apo33.org
Sun Jan 7 16:49:27 EST 2007


Hi Rene,
we wrote a bash script for APODIO http://www.apodio.org
you could use jackd & record straight with this script/ecasound in ogg 
on your HD... it's quite useful when you have big files to record and to 
put it straight on the web

cheers


joke



#!/bin/bash
# simple jack ogg recorder with ecasound
 
# bretzel at apo33.org
# copyright (C) 2005 $apo33
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#


title="ecasound recorder / 1 Ctrl-C to stop and 2nd Ctrc-C to exit"
ask_chnl="nbr of channel ex :2"
ask_quality="Ogg/Vorbis compression quality (1)"
ask_buff="working buffer"
ask_resample="Ogg/Vorbis bitrate ? "
ask_repertoire="directory?"
ask_name="name in the stream file ?"
ask_go="GO !  or Exit "
ask_ices="Yes     = new client
Last    = reload the last one
killOne = kill an old one
KillAll = kill all ices client
Exit    = ... exit"
nodir_msg="no directory or not writable, we use /tmp"
warning_gogo="Select the command zone before !"

case $LANG in
    fr*)
    title="Enregistreur simple en Ogg/vorbis pour jack"
    title="ecasound enregistreur/1 Ctrl-C stop et 2eme Ctrc-C sortir"
    ask_chnl="nbr de canaux ex :2"
    ask_quality="Qualite de compression Ogg/Vorbis (1)"
    ask_resample="Bitrate pour un resample Ogg/Vorbis ? "
    ask_buff="bffer de travail "
    ask_repertoire="repertoirei?"
    ask_name="nom du fichier Ogg ?"
    ask_go="GO ! ou Sortir "
    ask_ices="Yes     = Nouveau client
Last    = Relancer le dernier
killOne = Tuer un clients ices
killAll = Tuer tout les clients ices
Exit    = Sortir"
    nodir_msg="pas de repertoire ou non autorise on prend /tmp"
    warning_gogo="Selectionez la zone de commande!"
    ;;
esac


PATH_NAME=`pwd`
path_name=`zenity --entry --entry-text="$PATH_NAME" --title="$title" 
--text="$ask_repertoire"`
if [ ! -d "$path_name" ] || [ ! -w "$path_name" ];then
    path_name="/tmp"
    zenity --info --text="$nodir_msg"   
fi
cd $path_name
FINAME=`date "+%F_%k%M"`.ogg
name=`zenity --entry --entry-text="$FINAME" --title="$title" 
--text="$ask_name"`

if [ -z "$name" ] ;then name=`date "+%F_%k%M_$$"`.ogg;fi
touch $name
if [ -f $name ];then FINAME=$name;fi
if [ ! -f $name ];then
    REP=`ls -d .`
    zenity --info --text="$nodir_msg $REP"
fi

channels=`zenity --title="$title" --list --radiolist --column="Nbr" 
--column="$ask_chnl" FALSE "1" TRUE "2" FALSE "3" FALSE "4" `

buffer=`zenity --title="$title" --list --radiolist --column="Nbr" 
--column="$ask_buff" FALSE "64" FALSE "128" TRUE "512" FALSE "1024" 
FALSE "4096"`

quality=`zenity --height=300 --title="$title" --list --radiolist 
--column="" --column="$ask_quality" FALSE "u8" FALSE "s16_le" TRUE 
"s16_be" FALSE "s24_le" FALSE "s24_be" FALSE "s32_le" FALSE "s32_be" 
FALSE "f32_le" FALSE "f32_be" `

resample=`zenity --height=250 --title="$title" --list --radiolist 
--column="" --column="$ask_resample" FALSE "11025" FALSE "22050" TRUE 
"44100" FALSE "44800" `

if [ -z "$buffer" ] ;then buffer=512 ;fi
if [ -z "$quality" ] ;then quality=s16 ;fi
if [ -z "$channels" ] ;then channels=2  ;fi
if [ -z "$resample" ] ;then resample=44100  ;fi
 
##########################
usage="
ecasound -b:buffer -i jack_alsa -f:quality,channel,sample -o Filename
"

script="cd $path_name;
ecasound -b:"$buffer" -i jack_alsa -f:"$quality","$channels","$resample" 
-o "$FINAME

gogo=`zenity --list --editable --text "$usage" --column="streaming 
script" "$script"`

if [ ! "$gogo" ] ; then zenity --warning --text "$warning_gogo";exit 1 ; fi
echo "$gogo" > /tmp/gogo$$
echo "read bidon" >> /tmp/gogo$$
/usr/X11R6/bin/rxvt -e "sh /tmp/gogo$$"

rm -rf /tmp/gogo$$

----------------------------------------------------------------------------------------------------------------------------------------------
> greetings,
>
> got a peculiar problem for the list...
>
> we're trying to set up a website to record and upload roughly hour 
> long audio to for streaming. we'd be interested in any ready to go 
> solutions if anyone can recommmend any but if we need to build our own 
> we'd prefer to use linux.
>
> what we'd need is a linux box with a really simple interface to 
> start/stop recording, then maybe automatically trim silence off the 
> end of the file and upload it to a web server in a format ready for 
> streaming.
>
> any advice on ways to go about this would be greatly appreciated.
>
> what we'd most likely do is have a web-interface for some perl scripts 
> which would then control some command line apps like ecasound.
>
> any advice greatly appreciated,
> rene.
>




More information about the Linux-audio-user mailing list