sox-users@lists.sourceforge.net unofficial mirror
 help / color / mirror / code / Atom feed
* Recording in chunks using sox
       [not found] <790552421.2332795.1503680652651.ref@mail.yahoo.com>
@ 2017-08-25 17:04 ` Eyob Yirdaw via Sox-users
  2017-08-25 17:20   ` Graff, David E
                     ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Eyob Yirdaw via Sox-users @ 2017-08-25 17:04 UTC (permalink / raw)
  To: sox-users@lists.sourceforge.net; +Cc: Eyob Yirdaw


[-- Attachment #1.1: Type: text/plain, Size: 491 bytes --]

Hi all,
I want to record 24/7 transmission of FM radios using DVB-T dongles.  I want to direct the input audio from some dongle to sox, eg. something like
rtl_fm -f 88.8M -d 0 -M wbfm | sox -r 32k -t s16 - -t ogg device_0.ogg
here am using the rtl_fm terminal program.

Can sox help me save the continuous FM audio that comes from rtl_fm to be saved in some time length chunks, say 10 minute long chunks?It means that sox would write to disc every 10 minutes.

Thanks for any help!

[-- Attachment #1.2: Type: text/html, Size: 1407 bytes --]

[-- Attachment #2: Type: text/plain, Size: 202 bytes --]

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

[-- Attachment #3: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Recording in chunks using sox
  2017-08-25 17:04 ` Recording in chunks using sox Eyob Yirdaw via Sox-users
@ 2017-08-25 17:20   ` Graff, David E
  2017-08-25 18:11   ` Peter P.
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Graff, David E @ 2017-08-25 17:20 UTC (permalink / raw)
  To: Eyob Yirdaw, sox-users@lists.sourceforge.net


[-- Attachment #1.1: Type: text/plain, Size: 1339 bytes --]

My first intuition on this would be to have your continuous a/d process pipe to some custom process (not sox), which simply takes a binary stream on stdin and creates a continuous series of data files on disk of equal length (e.g. 20 minutes worth of samples, or whatever seems like a good interval), using some reasonable template pattern for file names.


Then, there'd be a separate process (running continuously) that scans for new files at regular intervals, and runs sox on each new file, converting it from raw to whatever format you want as a final product.


  Dave Graff

________________________________
From: Eyob Yirdaw via Sox-users <sox-users@lists.sourceforge.net>
Sent: Friday, August 25, 2017 1:04:12 PM
To: sox-users@lists.sourceforge.net
Cc: Eyob Yirdaw
Subject: [SoX-users] Recording in chunks using sox

Hi all,

I want to record 24/7 transmission of FM radios using DVB-T dongles.  I want to direct the input audio from some dongle to sox, eg. something like

rtl_fm -f 88.8M -d 0 -M wbfm | sox -r 32k -t s16 - -t ogg device_0.ogg

here am using the rtl_fm terminal program.

Can sox help me save the continuous FM audio that comes from rtl_fm to be saved in some time length chunks, say 10 minute long chunks?
It means that sox would write to disc every 10 minutes.

Thanks for any help!

[-- Attachment #1.2: Type: text/html, Size: 2911 bytes --]

[-- Attachment #2: Type: text/plain, Size: 202 bytes --]

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

[-- Attachment #3: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Recording in chunks using sox
  2017-08-25 17:04 ` Recording in chunks using sox Eyob Yirdaw via Sox-users
  2017-08-25 17:20   ` Graff, David E
@ 2017-08-25 18:11   ` Peter P.
  2017-08-25 18:18     ` Graff, David E
  2017-08-25 18:12   ` Jan Stary
  2017-08-26 13:54   ` Jeremy Nicoll - ml sox users
  3 siblings, 1 reply; 9+ messages in thread
From: Peter P. @ 2017-08-25 18:11 UTC (permalink / raw)
  To: sox-users

* Eyob Yirdaw via Sox-users <sox-users@lists.sourceforge.net> [2017-08-25 19:08]:
> Hi all,
> I want to record 24/7 transmission of FM radios using DVB-T dongles.  I want to direct the input audio from some dongle to sox, eg. something like
> rtl_fm -f 88.8M -d 0 -M wbfm | sox -r 32k -t s16 - -t ogg device_0.ogg
> here am using the rtl_fm terminal program.
> 
> Can sox help me save the continuous FM audio that comes from rtl_fm to be saved in some time length chunks, say 10 minute long chunks?It means that sox would write to disc every 10 minutes.
Perhaps look at the examples for the commands "newfile" and "restart" in
SoX's manpage.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Recording in chunks using sox
  2017-08-25 17:04 ` Recording in chunks using sox Eyob Yirdaw via Sox-users
  2017-08-25 17:20   ` Graff, David E
  2017-08-25 18:11   ` Peter P.
@ 2017-08-25 18:12   ` Jan Stary
  2017-08-25 18:18     ` Jan Stary
  2017-08-26 13:54   ` Jeremy Nicoll - ml sox users
  3 siblings, 1 reply; 9+ messages in thread
From: Jan Stary @ 2017-08-25 18:12 UTC (permalink / raw)
  To: sox-users

On Aug 25 17:04:12, sox-users@lists.sourceforge.net wrote:
> I want to record 24/7 transmission of FM radios

Why?

> using DVB-T dongles.  I want to direct the input audio
> from some dongle to sox, eg. something like
> rtl_fm -f 88.8M -d 0 -M wbfm | sox -r 32k -t s16 - -t ogg device_0.ogg
> here am using the rtl_fm terminal program.

Why do you want to convert from the original format to ogg?

> Can sox help me save the continuous FM audio that comes from rtl_fm to be saved in some time length chunks, say 10 minute long chunks?

Yes


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Recording in chunks using sox
  2017-08-25 18:12   ` Jan Stary
@ 2017-08-25 18:18     ` Jan Stary
  0 siblings, 0 replies; 9+ messages in thread
From: Jan Stary @ 2017-08-25 18:18 UTC (permalink / raw)
  To: sox-users

On Aug 25 20:12:44, hans@stare.cz wrote:
> > I want to direct the input audio
> > from some dongle to sox, eg. something like
> > rtl_fm -f 88.8M -d 0 -M wbfm | sox -r 32k -t s16 - -t ogg device_0.ogg
> > here am using the rtl_fm terminal program.
> 
> Why do you want to convert from the original format to ogg?

See the attached script and its config.
This is what I call from cron as in 

00 06 * * 6   radio jazz   3600 $RADIO/`date +\%Y\%m\%d`-jazzrock.mp3

to download the radio shows I like. Note that this functionality
has nothing to do with SoX - the stream is just dumped to a file.

	Jan


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Recording in chunks using sox
  2017-08-25 18:11   ` Peter P.
@ 2017-08-25 18:18     ` Graff, David E
  2017-08-26 12:42       ` Eyob Yirdaw via Sox-users
  0 siblings, 1 reply; 9+ messages in thread
From: Graff, David E @ 2017-08-25 18:18 UTC (permalink / raw)
  To: sox-users@lists.sourceforge.net


[-- Attachment #1.1: Type: text/plain, Size: 1342 bytes --]

Note to self: read the man page before acting on the "initial intuition".  Thanks, Peter!


  Dave G.

________________________________
From: Peter P. <peterparker@fastmail.com>
Sent: Friday, August 25, 2017 2:11:14 PM
To: sox-users@lists.sourceforge.net
Subject: Re: [SoX-users] Recording in chunks using sox

* Eyob Yirdaw via Sox-users <sox-users@lists.sourceforge.net> [2017-08-25 19:08]:
> Hi all,
> I want to record 24/7 transmission of FM radios using DVB-T dongles.  I want to direct the input audio from some dongle to sox, eg. something like
> rtl_fm -f 88.8M -d 0 -M wbfm | sox -r 32k -t s16 - -t ogg device_0.ogg
> here am using the rtl_fm terminal program.
>
> Can sox help me save the continuous FM audio that comes from rtl_fm to be saved in some time length chunks, say 10 minute long chunks?It means that sox would write to disc every 10 minutes.
Perhaps look at the examples for the commands "newfile" and "restart" in
SoX's manpage.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

[-- Attachment #1.2: Type: text/html, Size: 2536 bytes --]

[-- Attachment #2: Type: text/plain, Size: 202 bytes --]

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

[-- Attachment #3: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Recording in chunks using sox
  2017-08-25 18:18     ` Graff, David E
@ 2017-08-26 12:42       ` Eyob Yirdaw via Sox-users
  2017-08-27 14:37         ` Jan Stary
  0 siblings, 1 reply; 9+ messages in thread
From: Eyob Yirdaw via Sox-users @ 2017-08-26 12:42 UTC (permalink / raw)
  To: sox-users@lists.sourceforge.net; +Cc: Eyob Yirdaw


[-- Attachment #1.1: Type: text/plain, Size: 2412 bytes --]

Well thanks so much guys! I really love the open source community. You really are so awesome to find the time to help guys in need.

@Peter: i will try ur suggestion. I still have to order the dongle by the way. I just needed to be sure the overall process of recording it in batches.
@David: I think ur idea is excellent too! I ll go with Peter's idea first.
@Jan: Well am not getting any attachment in your message.
 

    On Friday, 25 August 2017, 21:19, "Graff, David E" <graff@ldc.upenn.edu> wrote:
 

 #yiv9726572776 #yiv9726572776 -- .yiv9726572776EmailQuote {margin-left:1pt;padding-left:4pt;border-left:#800000 2px solid;}#yiv9726572776 #yiv9726572776 #yiv9726572776 --p {margin-top:0;margin-bottom:0;}#yiv9726572776 Note to self: read the man page before acting on the "initial intuition".  Thanks, Peter!
  Dave G.From: Peter P. <peterparker@fastmail.com>
Sent: Friday, August 25, 2017 2:11:14 PM
To: sox-users@lists.sourceforge.net
Subject: Re: [SoX-users] Recording in chunks using sox * Eyob Yirdaw via Sox-users <sox-users@lists.sourceforge.net> [2017-08-25 19:08]:
> Hi all,
> I want to record 24/7 transmission of FM radios using DVB-T dongles.  I want to direct the input audio from some dongle to sox, eg. something like
> rtl_fm -f 88.8M -d 0 -M wbfm | sox -r 32k -t s16 - -t ogg device_0.ogg
> here am using the rtl_fm terminal program.
> 
> Can sox help me save the continuous FM audio that comes from rtl_fm to be saved in some time length chunks, say 10 minute long chunks?It means that sox would write to disc every 10 minutes.
Perhaps look at the examples for the commands "newfile" and "restart" in
SoX's manpage.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users


   

[-- Attachment #1.2: Type: text/html, Size: 5283 bytes --]

[-- Attachment #2: Type: text/plain, Size: 202 bytes --]

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

[-- Attachment #3: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Recording in chunks using sox
  2017-08-25 17:04 ` Recording in chunks using sox Eyob Yirdaw via Sox-users
                     ` (2 preceding siblings ...)
  2017-08-25 18:12   ` Jan Stary
@ 2017-08-26 13:54   ` Jeremy Nicoll - ml sox users
  3 siblings, 0 replies; 9+ messages in thread
From: Jeremy Nicoll - ml sox users @ 2017-08-26 13:54 UTC (permalink / raw)
  To: Eyob Yirdaw, sox-users

On 2017-08-25 18:04, Eyob Yirdaw via Sox-users wrote:

> It means that sox would write to disc every 10 minutes.

Does it mean that?  I'd have thought that sox (or perhaps I should
say the underlying file system or OS) would write data more often
than that, but every ten minutes close the current output file and
open a new one.

-- 
Jeremy Nicoll - my opinions are my own

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Recording in chunks using sox
  2017-08-26 12:42       ` Eyob Yirdaw via Sox-users
@ 2017-08-27 14:37         ` Jan Stary
  0 siblings, 0 replies; 9+ messages in thread
From: Jan Stary @ 2017-08-27 14:37 UTC (permalink / raw)
  To: sox-users

[-- Attachment #1: Type: text/plain, Size: 142 bytes --]

On Aug 26 12:42:27, sox-users@lists.sourceforge.net wrote:
> @Jan: Well am not getting any attachment in your message.

sorry, attaching now


[-- Attachment #2: radio --]
[-- Type: text/plain, Size: 836 bytes --]

#!/bin/sh

fatal() {
	echo $@ >&2
	exit 1
}

[ $# -ge 1 ] || fatal "usage: $0 station [length [outfile]]"

STATION=${1}
SECONDS=${2}
OUTFILE=${3}

CONFIG="$HOME/.radiorc"
. $CONFIG || fatal "Config file $CONFIG not found, no stations defined"
grep "^$STATION=" $CONFIG > /dev/null || fatal "Station '$STATION' not defined"
eval URL=\$$STATION

[ -z "$OUTFILE" ] && OUTFILE="$STATION-`date +%Y%m%d%H%M%S`.${URL##*.}"
[ -e "$OUTFILE" ] && fatal "$OUTFILE already exists"

if [ $# -eq 1 ] ; then
	play=`which play` || fatal "play(1) not found"
	$play $URL
else
	ftp -g -p -V -o $OUTFILE $URL >/dev/null 2>&1 &
	PID=$! && [ "$PID" ] && ps -p $PID >/dev/null 2>&1 ||
		fatal "Error downloading $URL"
	sleep $SECONDS && ps -p $PID >/dev/null 2>&1 ||
		fatal "Process $PID downloading $OUTFILE already exited"
	kill -9 $PID >/dev/null 2>&1
fi

[-- Attachment #3: .radiorc --]
[-- Type: text/plain, Size: 433 bytes --]

# Stations recognized by radio(1). This config file is
# sourced directly, so keep it in valid sh(1) syntax.

praha="http://icecast6.play.cz/cro2-128.mp3"
vltava="http://icecast5.play.cz/cro3-128.mp3"
wave="http://icecast5.play.cz/crowave-128.mp3"
ddur="http://icecast5.play.cz/croddur-128.mp3"
jazz="http://icecast1.play.cz/crojazz128.mp3"
radio1="http://icecast1.play.cz/radio1.mp3"
slow="http://icecast1.play.cz/slowradio160.mp3"

[-- Attachment #4: Type: text/plain, Size: 202 bytes --]

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

[-- Attachment #5: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-08-27 14:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <790552421.2332795.1503680652651.ref@mail.yahoo.com>
2017-08-25 17:04 ` Recording in chunks using sox Eyob Yirdaw via Sox-users
2017-08-25 17:20   ` Graff, David E
2017-08-25 18:11   ` Peter P.
2017-08-25 18:18     ` Graff, David E
2017-08-26 12:42       ` Eyob Yirdaw via Sox-users
2017-08-27 14:37         ` Jan Stary
2017-08-25 18:12   ` Jan Stary
2017-08-25 18:18     ` Jan Stary
2017-08-26 13:54   ` Jeremy Nicoll - ml sox users

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/sox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).