Reply
Thread Tools
nicholes's Avatar
Posts: 1,103 | Thanked: 368 times | Joined on Oct 2010 @ india, indore
#11
Originally Posted by knobby View Post
one thing i wanna ask...y u wanna have recording of 1 hr only...i mean the call can be longer or shorter than it... ??
i want to record last one hrs activity. (i am not talking about a phone call) whatever is happning around me there should be voice rec. of last one hrs only or user defined
__________________
N900 gave me a reason to live in this cruel world

get your smooth live wallpaper today
My YouTube videos
 
Posts: 19 | Thanked: 14 times | Joined on Apr 2010
#12
I have used gst-launch-0.10 to record mu-law files:

/usr/bin/gst-launch-0.10 pulsesrc ! mulawenc ! audio/x-mulaw,channels=1,rate=8000 ! filesink location = /home/user/MyDocs/Recordings/`/bin/date +%H%M_%d%m%Y.ul`

The recording will be named according to the HourMinute_DayMonthYear it was recorded. I chose the mu-law format because it doesn't take up much space and it can be used with SoX, which can do neat things like delete portions of silence.

If you want to record for a specified length of time, use fcron. There are instructions in the wiki for setting this program up. If the above script were name mu2file.sh and located in /bin/scripts/ and you wanted to record from 9:15AM to 10:15AM, the fcron would look something like this:

15 9 * * * /bin/scripts/mu2file.sh
15 10 * * * /usr/bin/killall gst-launch-0.10


If you want to make a keyboard shortcut to activate this script whenever you feel like without opening up fcron, Matan's modified-hildon-desktop and dbus-scripts should allow you to do this.

Last edited by ILikeMaemo; 2011-09-22 at 19:26.
 

The Following 2 Users Say Thank You to ILikeMaemo For This Useful Post:
nicholes's Avatar
Posts: 1,103 | Thanked: 368 times | Joined on Oct 2010 @ india, indore
#13
@ILikeMaemo

thanks for the reply, but i want to rec. last 1hrs voice rec. not one or two hrs
fixed rec.

i want to rec whatever has happened in the last one hrs. for example if voice recorder is running for 1:30 min so it should keep record of last 1 hrs only the rest 30 min rec. should not be saved

as far as i understand your methode it will rec. whatever time user defines better to say it will shadule the recorder
__________________
N900 gave me a reason to live in this cruel world

get your smooth live wallpaper today
My YouTube videos
 
Posts: 19 | Thanked: 14 times | Joined on Apr 2010
#14
What file format does the Voice Recorder output? If it is something common, the SoX program I mentioned should be able to do it.

Syntax : sox old.wav new.wav trim [SECOND TO START] [SECONDS DURATION]

For a 90 minute recording:

sox old.wav new.wav trim 1800 3600

EDIT: For the sake of clarity, I have to mention that you would use this command AFTER you have already recorded with your voice recorder app. I'm assuming you would have your voice recorder app running constantly. After you stop recording you would use the sox command I described with the audio file produced by your voice recorder app. The example I used was for a 90 minute recording, but if you have a file of indeterminate length, "Sox [filename] -e stat" will give you the length of the filename in seconds. This number in seconds minus 3600 seconds is your first parameter after "trim" in the command above. And since you want one hour, the last parameter is 3600. So if the length of the audio file were 4689 seconds the last hour of audio would start at the 1089 second mark. So the command would be

sox [output file from voice recorder app] new.wav trim 1089 3600.

Hope that is clear.

Last edited by ILikeMaemo; 2011-09-23 at 00:03. Reason: Clarity
 

The Following User Says Thank You to ILikeMaemo For This Useful Post:
Daneel's Avatar
Posts: 549 | Thanked: 698 times | Joined on Apr 2010
#15
Just record all and use some sound editing application to delete everything but the last hour
 
Posts: 45 | Thanked: 17 times | Joined on Mar 2010
#16
Hmm, maybe a cron script with SoX would do as the OP wanted. At the hour concatenate all the audio files into one using SoX and then zip up for storage?
 
shallimus's Avatar
Posts: 568 | Thanked: 969 times | Joined on Dec 2009 @ Toronto
#17
Originally Posted by Sonny_Jim View Post
Hmm, maybe a cron script with SoX would do as the OP wanted. At the hour concatenate all the audio files into one using SoX and then zip up for storage?
I don't think any of the responders have yet quite understood exactly what's wanted here, although to be fair to other responders, nicholes maybe could have done a better job explaining the requirement.

I'm going to steal ILikeMaemo and Sonny_jim's ideas and change them very slightly: you could use a cronjob which records one minute of sound every minute on the minute and dumps the results into a tmp folder.

That cronjob also deletes any file in the tmp folder older than one hour. To then extract the last hour at any point (to within the nearest minute) you then run a script which uses SoX (or whatever) to concatenate the audio files on demand, rather than croning it to run every hour (the result of which doesn't fulfill the requirements being asked for) or every minute (which would probably mutilate your battery charge pretty quickly).

You could also have the script wait until the next tmp file is written (so, when the next minute is up) so you get exactly one hour and don't miss the recording of the time between when the previous minute file was written and when you decided to listen to the last hour's recording...

Of course, this is low-tech hack stuff, but it's easily done. Anything clever with a true rolling 3600 second recording is beyond me (and - again - I can't help wondering what that would do to your battery life).

Edit: Actually, I wonder what constantly recording sound will do to your battery life anyway...
__________________
tinfoilhat.dll: Trojan horse detected
Sailfish want list: calendar bugfixes, glanceable agenda, Swype or similar
Evolution continues (but we're still pre-Cambrian)


Last edited by shallimus; 2011-09-22 at 21:30.
 

The Following User Says Thank You to shallimus For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 11:59.