The Following 4 Users Say Thank You to pichlo For This Useful Post: | ||
![]() |
2013-09-26
, 14:03
|
Community Council |
Posts: 4,920 |
Thanked: 12,867 times |
Joined on May 2012
@ Southerrn Finland
|
#2
|
Okay, I admit that this is a crazy idea but...
For a one-off application, I want "something" to continuously monitor an audio line-in (mono would do just fine), detect audio over a certain threshold level, record it until it drops back below the threshold, wait for a given period, play it back, go back to monitoring. And I want it to run unattended.
Detecting the threshold should be easy as the input line is squelched, so the level should be at zero (bar the input electronic's own noise) most of the time.
I did an online search and found at least one parrot program for Windows, but not that flexible (you need to press a button to record, it plays back randomly...). Then I had the brilliant idea to harness my spare N900 to do something like that.
My experience with Linux audio programming equals exactly zero. I suppose I could rip Recaller, myDicto or Orecchiette to shreds and learn something in the process, but I thought I'd ask first. Perhaps what I want could be done with a script? It sounds crazy, but having seen what people can do with a simple command line (like streaming video to a PC), my confidence in what Linux can do for someone who knows how to ask has no limits
The Following User Says Thank You to juiceme For This Useful Post: | ||
![]() |
2013-09-26
, 14:44
|
|
Posts: 6,453 |
Thanked: 20,983 times |
Joined on Sep 2012
@ UK
|
#3
|
The Following User Says Thank You to pichlo For This Useful Post: | ||
![]() |
2013-09-26
, 19:02
|
Community Council |
Posts: 4,920 |
Thanked: 12,867 times |
Joined on May 2012
@ Southerrn Finland
|
#5
|
I was even thinking about two daemons, one continuously recording audio in, let's say, one-second chunks, the other one picking up those chunks, analyzing them and deleting if found to contain silence. Definitely a battery - and possibly eMMC - killer but I only want to run it for one day and on a charger. (And stream to a disposable SD card.)
The Following User Says Thank You to juiceme For This Useful Post: | ||
![]() |
2013-10-02
, 20:52
|
|
Posts: 6,453 |
Thanked: 20,983 times |
Joined on Sep 2012
@ UK
|
#6
|
#!/bin/bash # A simple script to record some sound, wait a bit # and play it back. Like a talking parrot. # Takes two command-line parameters: # $1 ... how long to record # $2 ... how long to wait before playback # Work out the file name based on current date/time fpath=/home/user/MyDocs/.sounds/Recordings fflag=$fpath/Parrot-in-use fname=$fpath/Parrot-`date +%Y%m%d-%H%M%S`.raw # Prevent multiple parallel instances if [ -e "$fflag" ] ; then exit 0 fi touch $fflag # Display notification banner banner() { o=org f=freedesktop n=Notifications dbus-send --type=method_call --dest=$o.$f.$n \ /$o/$f/$n $o.$f.$n.SystemNoteInfoprint \ string:"Parrot $1..." } # Record... banner "recording" parec $fname & sleep $1 killall parec # ...wait a bit... banner "waiting" sleep $2 # ...and play it back banner "playing" pacat $fname rm $fflag
![]() |
2014-06-02
, 11:18
|
Posts: 19 |
Thanked: 24 times |
Joined on May 2014
|
#7
|
![]() |
2014-06-02
, 19:49
|
|
Posts: 6,453 |
Thanked: 20,983 times |
Joined on Sep 2012
@ UK
|
#8
|
The Following 3 Users Say Thank You to pichlo For This Useful Post: | ||
![]() |
2014-06-02
, 20:26
|
|
Posts: 25 |
Thanked: 59 times |
Joined on Jun 2014
@ Poland
|
#9
|
![]() |
2014-06-02
, 23:57
|
Posts: 445 |
Thanked: 367 times |
Joined on Nov 2010
@ Italy
|
#10
|
The Following 2 Users Say Thank You to gianko For This Useful Post: | ||
![]() |
Tags |
kill me now, nokia n900, parrot |
|
Okay, I admit that this is a crazy idea but...
For a one-off application, I want "something" to continuously monitor an audio line-in (mono would do just fine), detect audio over a certain threshold level, record it until it drops back below the threshold, wait for a given period, play it back, go back to monitoring. And I want it to run unattended.
Detecting the threshold should be easy as the input line is squelched, so the level should be at zero (bar the input electronic's own noise) most of the time.
I did an online search and found at least one parrot program for Windows, but not that flexible (you need to press a button to record, it plays back randomly...). Then I had the brilliant idea to harness my spare N900 to do something like that.
My experience with Linux audio programming equals exactly zero. I suppose I could rip Recaller, myDicto or Orecchiette to shreds and learn something in the process, but I thought I'd ask first. Perhaps what I want could be done with a script? It sounds crazy, but having seen what people can do with a simple command line (like streaming video to a PC), my confidence in what Linux can do for someone who knows how to ask has no limits
Last edited by pichlo; 2013-10-02 at 20:58. Reason: Solution found