Modifying the code that records my radio shows

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
rmcellig
Posts: 965
Joined: Sat 19 Nov 2011, 15:18
Location: Ottawa Ontario Canada
Contact:

Modifying the code that records my radio shows

#1 Post by rmcellig »

This is the code I use to record my weekly radio shows.

Code: Select all

arecord -t wav -f cd -d 8800 /root/radioshows/intransition.wav
The code outputs to intransition.wav

Is there a way for it to output to ITJAN1212.wav

This part would be the date the recording took place. This is the format I use so that my shows play properly on my web site. Right now I have to manually change the name but was wondering if there is an easy way to automate this so that the wav file would be names IT followed by the monthdayyear in the format JAN0212

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#2 Post by SFR »

Try this:

Code: Select all

arecord -t wav -f cd -d 8800 "/root/Name_`date +%F_%T`.wav"
Type date --help in terminal to see more posibilities, but be aware to not use formats with / (slashes), eg. 2012/01/14, because it will be interpreted as subdirectories.

MonthDayYear is:

Code: Select all

date +%b%d%y
Output:
Jan1412
Hope this helps.

Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

User avatar
Dave_G
Posts: 453
Joined: Thu 21 Jul 2011, 13:53

#3 Post by Dave_G »

@rmcellig

As SFR pointed out:

arecord -t wav -f cd -d 8800 "/root/IT`date +%b%d%y`.wav"

I just tried it with Puppy4.3.1 and it works perfectly, it created the file:
ITJan1412.wav in /root.

You mentioned that you post these wav files on your website.
Why not create a script to automatically create the html for you
with links to the wav files?

rmcellig
Posts: 965
Joined: Sat 19 Nov 2011, 15:18
Location: Ottawa Ontario Canada
Contact:

#4 Post by rmcellig »

Actually what I do is record my shows as wav files than I save them as MP3 files that I SFTP to my hosting provider. On my web site, I have links that reference the shows that reside on my hosting providers site.

View the source for this page to see what I have done

http://www.mcran.com/2010-2006showstable.php

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#5 Post by SFR »

BTW, if you'd like to have exact ITMONTHDATEYEAR format (all uppercase), here's small modification:

Code: Select all

arecord -t wav -f cd -d 8800 "/root/radioshows/IT`date +%b%d%y | tr '[:lower:]' '[:upper:]'`.wav"
Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

rmcellig
Posts: 965
Joined: Sat 19 Nov 2011, 15:18
Location: Ottawa Ontario Canada
Contact:

#6 Post by rmcellig »

Thanks!

big_bass
Posts: 1740
Joined: Mon 13 Aug 2007, 12:21

#7 Post by big_bass »

Hey rmcellig

If you would like to save time bandwidth and money
and offer a lite version of your program for mp3 players


you can reduce your 162mb files
to 27mb that's a 6 times reduction
the sound quality is good on a mp3player
here is a sample of what the script produces 27mb mono
http://www.puppy2.org/slaxer/ITJAN0112_mono.mp3


it works best when it is a pure monolog radio program
you could still play with the numbers and get a happy lite version

*I didn't do this for you directly
but I did convert one of your programs so you could see the result

I listen to another audio program (just the audio from a 1/2 hour tv show) that has
70mb files and that is just to big for me
with the code I posted it reduces
the file down to 6mb much better so I thought to share
the code idea


a very nice jazz program by the way :D
thanks

Joe

Code: Select all

#!/bin/bash

#dragNdrop
# conv-mp3-mp3mono

A="$@"
NO_EXT_FILE=`echo "${A//.mp3/}"`
echo $NO_EXT_FILE
TITLE=`basename "$@"`



xterm  -geometry 40x30+150+40 -e lame  -b 32 -m m  $NO_EXT_FILE".mp3"


# rename mp3

mv $NO_EXT_FILE".mp3.mp3" $NO_EXT_FILE"_mono.mp3"




Last edited by big_bass on Wed 25 Jan 2012, 14:06, edited 1 time in total.

rmcellig
Posts: 965
Joined: Sat 19 Nov 2011, 15:18
Location: Ottawa Ontario Canada
Contact:

#8 Post by rmcellig »

This is interesting but how can I convert all the shows I already have uploaded to my site. What I mean is , is there a quick way to convert them? If so, I am more than willing to try this out for all of my shows now and in the future. I'm not that technically mined when it comes to scripts etc...so if there is a quick GUI solution that would be great. All of my shows are saved as Mono formatted MP3 files already.

If I can get the file size down this small while retaining the sound so that it is listenable, that would be fantastic!!

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#9 Post by technosaurus »

Ffconvert or woo-ff should convert them fine

For voice, try speex encoding (.spx)
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

rmcellig
Posts: 965
Joined: Sat 19 Nov 2011, 15:18
Location: Ottawa Ontario Canada
Contact:

#10 Post by rmcellig »

Thanks. When I convert with ffconvert or whatever, what is the exact format I should convert to?

rmcellig
Posts: 965
Joined: Sat 19 Nov 2011, 15:18
Location: Ottawa Ontario Canada
Contact:

#11 Post by rmcellig »

Thanks. When I convert with ffconvert or whatever, what is the exact format I should convert to?

User avatar
vicmz
Posts: 1262
Joined: Sun 15 Jan 2012, 22:47

#12 Post by vicmz »

I think don570's Right-Click 5.4 has a right-click menu option to convert from WAV to MP3, i.e. install it and then you just have to right-click the file or a whole folder to convert them to MP3. In FFConvert you should choose the setting "MP3 audio" or "MP3 audio (mono)" then click the "Load" button, then just click "Convert". You can choose the bitrate (128kbps at minimum for good quality, note that the higher the bitrate, the bigger the file size). Also hover your mouse pointer on the buttons to see what they do.

Post Reply