sox-users@lists.sourceforge.net unofficial mirror
 help / color / mirror / code / Atom feed
* Duration of recorded file is longer than recording time using SoX
@ 2019-12-16  2:39 George S. Williams
  2019-12-16 16:14 ` Jeremy Nicoll - ml sox users
  0 siblings, 1 reply; 6+ messages in thread
From: George S. Williams @ 2019-12-16  2:39 UTC (permalink / raw)
  To: sox-users


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

I'm using SoX on Centos 7 to record the audio output from GQRX, a SDR 
application. I've selected Monitor of Built-in Audio Analog Stereo from 
the Recording Tab of the Pulseaudio Volume Control. I'm trying to save a 
.wav file with a sample rate of 6k. I'm using the command

|sox -t pulseaudio 2 --rate 6k --channels 1 test.wav |

This works and my test.wav is what I expect except that the duration of 
the file is about a third longer than the actual recording time. 3 hours 
and 15 minutes of recording time results in a file with a duration of 4 
hours and 21 minutes.

I couldn't find anything online or in the SoX documentation concerning 
this. Is there something else I can try to make the wave the actual 
length of the recording?


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

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



[-- 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] 6+ messages in thread

* Re: Duration of recorded file is longer than recording time using SoX
  2019-12-16  2:39 Duration of recorded file is longer than recording time using SoX George S. Williams
@ 2019-12-16 16:14 ` Jeremy Nicoll - ml sox users
       [not found]   ` <f1382121-d632-9252-17a8-e7baed8913f2@websterling.com>
  0 siblings, 1 reply; 6+ messages in thread
From: Jeremy Nicoll - ml sox users @ 2019-12-16 16:14 UTC (permalink / raw)
  To: sox-users

On 2019-12-16 02:39, George S. Williams wrote:
> I'm using SoX on Centos 7 to record the audio output from GQRX, a SDR
> application. I've selected Monitor of Built-in Audio Analog Stereo
> from the Recording Tab of the Pulseaudio Volume Control. I'm trying to
> save a .wav file with a sample rate of 6k. I'm using the command
> 
> |sox -t pulseaudio 2 --rate 6k --channels 1 test.wav |

Does the presence of the 'pipe' character before "sox" mean that audio
was being generated by a previous command?

If so, although you may think you terminated the recording after a
certain time, maybe that program still sent data to sox?  Or maybe
sent data before you though you started the recording?

In your "too long" wave file, does it start with 1h 6m of something
else, or end with 1h 6m of something else?  Or what?


-- 
Jeremy Nicoll - my opinions are my own


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

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

* Re: Duration of recorded file is longer than recording time using SoX
       [not found]   ` <f1382121-d632-9252-17a8-e7baed8913f2@websterling.com>
@ 2019-12-16 20:53     ` Jeremy Nicoll - ml sox users
  2019-12-25 21:23       ` Jan Stary
  0 siblings, 1 reply; 6+ messages in thread
From: Jeremy Nicoll - ml sox users @ 2019-12-16 20:53 UTC (permalink / raw)
  To: ML - sox-users

On 2019-12-16 16:44, George S. Williams wrote:
> On 12/16/2019 11:14 AM, Jeremy Nicoll - ml sox users wrote:
>> On 2019-12-16 02:39, George S. Williams wrote:
>>> I'm using SoX on Centos 7 to record the audio output from GQRX, a SDR
>>> application. I've selected Monitor of Built-in Audio Analog Stereo
>>> from the Recording Tab of the Pulseaudio Volume Control. I'm trying 
>>> to
>>> save a .wav file with a sample rate of 6k. I'm using the command
>>> 
>>> |sox -t pulseaudio 2 --rate 6k --channels 1 test.wav |

>> Does the presence of the 'pipe' character before "sox" mean that audio
>> was being generated by a previous command?
>> 
>> If so, although you may think you terminated the recording after a
>> certain time, maybe that program still sent data to sox?  Or maybe
>> sent data before you though you started the recording?
>> 
>> In your "too long" wave file, does it start with 1h 6m of something
>> else, or end with 1h 6m of something else?  Or what?

> The command is run by itself- the pipe characters are a consequence of
> copying and pasting that I didn't catch.
> 
> The wave file contains what was recorded, nothing extra. It is
> 'stretched' to the longer duration.

George's reply to me was, it seems, off-list.  Don't know why.  I'm
replying on-list.

What does  soxi  say about the wave file?

Does the file have the file-size you'd expect for the single channel,
unknown (to us anyway) bit depth, 6000 samples per second?

Is what's in the file a recording of something (music, speech?) that
sounds 'sensible' to a human, or is it some sort of scientific data
that one can't tell about (by ear)?

Does the header info in the wav file contain the right descriptive
info for the data?


-- 
Jeremy Nicoll - my opinions are my own


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

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

* Re: Duration of recorded file is longer than recording time using SoX
  2019-12-16 20:53     ` Jeremy Nicoll - ml sox users
@ 2019-12-25 21:23       ` Jan Stary
  2019-12-26  1:02         ` George S. Williams
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Stary @ 2019-12-25 21:23 UTC (permalink / raw)
  To: sox-users

> > > > I'm using SoX on Centos 7 to record the audio output from GQRX, a SDR
> > > > application. I've selected Monitor of Built-in Audio Analog Stereo
> > > > from the Recording Tab of the Pulseaudio Volume Control. I'm
> > > > trying to
> > > > save a .wav file with a sample rate of 6k. I'm using the command
> > > > 
> > > > |sox -t pulseaudio 2 --rate 6k --channels 1 test.wav |
> > > Does the presence of the 'pipe' character before "sox" mean that audio
> > > was being generated by a previous command?
> > The command is run by itself- the pipe characters are a consequence of
> > copying and pasting that I didn't catch.

OK, sou you start

	sox -t pulseaudio 2 --rate 6k --channels 1 test.wav

at a terminal, and then start GQRX (whatever that is) to produce its
output, and have PulseAudio (the system audio framwork) monitor
the GQRX output as a recording. So that's what SoX gets. Right?

But that is not a valid SoX command line. In SoX SYNOPSIS parlance,
what is the "infile"? And what is "pulseaudio 2"? The "-t pulseaudio"
specifies the type (-t); what is the "2"?

Can you please post the output of your actual command line
with sox -V3 (for verbosity)?

Also, a command line like that will not stop recording its input
just because the other side has stopped producing output
(as opposed to reading a file as input). So how exactly
is the above SoX process terminated?

> > > In your "too long" wave file, does it start with 1h 6m of something
> > > else, or end with 1h 6m of something else?  Or what?
> > 
> > The wave file contains what was recorded, nothing extra. It is
> > 'stretched' to the longer duration.

How can it "contain what was recorded, nothing extra"
and at the same time be of different length? Is it the
rate change? That is, are you recording a 6kHz channel
at the specified rate of 6kHz?

Jan



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

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

* Re: Duration of recorded file is longer than recording time using SoX
  2019-12-25 21:23       ` Jan Stary
@ 2019-12-26  1:02         ` George S. Williams
  2019-12-28 15:52           ` Jan Stary
  0 siblings, 1 reply; 6+ messages in thread
From: George S. Williams @ 2019-12-26  1:02 UTC (permalink / raw)
  To: sox-users



On 12/25/2019 4:23 PM, Jan Stary wrote:
>>>>> I'm using SoX on Centos 7 to record the audio output from GQRX, a SDR
>>>>> application. I've selected Monitor of Built-in Audio Analog Stereo
>>>>> from the Recording Tab of the Pulseaudio Volume Control. I'm
>>>>> trying to
>>>>> save a .wav file with a sample rate of 6k. I'm using the command
>>>>>
>>>>> |sox -t pulseaudio 2 --rate 6k --channels 1 test.wav |
>>>> Does the presence of the 'pipe' character before "sox" mean that audio
>>>> was being generated by a previous command?
>>> The command is run by itself- the pipe characters are a consequence of
>>> copying and pasting that I didn't catch.
> OK, sou you start
>
> 	sox -t pulseaudio 2 --rate 6k --channels 1 test.wav
>
> at a terminal, and then start GQRX (whatever that is) to produce its
> output, and have PulseAudio (the system audio framwork) monitor
> the GQRX output as a recording. So that's what SoX gets. Right?
>
> But that is not a valid SoX command line. In SoX SYNOPSIS parlance,
> what is the "infile"? And what is "pulseaudio 2"? The "-t pulseaudio"
> specifies the type (-t); what is the "2"?
GQRX is a SDR (Software Defined Radio) application, as was mentioned in 
the OP

pulseaudio is a AUDIO DEVICE DRIVER, 2 is the device being monitored
See, for example, 'sox -h'

> Can you please post the output of your actual command line
> with sox -V3 (for verbosity)?
>
> Also, a command line like that will not stop recording its input
> just because the other side has stopped producing output
> (as opposed to reading a file as input). So how exactly
> is the above SoX process terminated?
SoX is terrminated with Ctrl-C
>>>> In your "too long" wave file, does it start with 1h 6m of something
>>>> else, or end with 1h 6m of something else?  Or what?
>>> The wave file contains what was recorded, nothing extra. It is
>>> 'stretched' to the longer duration.
> How can it "contain what was recorded, nothing extra"
> and at the same time be of different length? Is it the
> rate change? That is, are you recording a 6kHz channel
> at the specified rate of 6kHz?
The problem seems to be either with GQRX or Pulseaudio- probably not 
SoX. Using a different SDR and piping its output to SoX works fine, so 
I'm no longer working on this problem.

Thanks for the reply, but why the attitude?

George


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



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

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

* Re: Duration of recorded file is longer than recording time using SoX
  2019-12-26  1:02         ` George S. Williams
@ 2019-12-28 15:52           ` Jan Stary
  0 siblings, 0 replies; 6+ messages in thread
From: Jan Stary @ 2019-12-28 15:52 UTC (permalink / raw)
  To: sox-users

> > Also, a command line like that will not stop recording its input
> > just because the other side has stopped producing output
> > (as opposed to reading a file as input). So how exactly
> > is the above SoX process terminated?
> SoX is terrminated with Ctrl-C

In that case, the sox recording will be as long
as the time between start and the ctrl-c termination
(give or take a buffer or two).

> > > > > In your "too long" wave file, does it start with 1h 6m of something
> > > > > else, or end with 1h 6m of something else?  Or what?
> > > > The wave file contains what was recorded, nothing extra. It is
> > > > 'stretched' to the longer duration.

What do you mean by that. Does it play slower?
Then I would suspect a sample rate mismatch
- hard to tell without actual soxi  or sox -V output.

> > How can it "contain what was recorded, nothing extra"
> > and at the same time be of different length? Is it the
> > rate change? That is, are you recording a 6kHz channel
> > at the specified rate of 6kHz?

Jan



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

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

end of thread, other threads:[~2019-12-28 15:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-16  2:39 Duration of recorded file is longer than recording time using SoX George S. Williams
2019-12-16 16:14 ` Jeremy Nicoll - ml sox users
     [not found]   ` <f1382121-d632-9252-17a8-e7baed8913f2@websterling.com>
2019-12-16 20:53     ` Jeremy Nicoll - ml sox users
2019-12-25 21:23       ` Jan Stary
2019-12-26  1:02         ` George S. Williams
2019-12-28 15:52           ` Jan Stary

sox-users@lists.sourceforge.net unofficial mirror

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/sox-users

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 sox-users sox-users/ https://public-inbox.org/sox-users \
		sox-users@lists.sourceforge.net
	public-inbox-index sox-users

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.audio.sox
	nntp://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/inbox.comp.audio.sox
	nntp://news.gmane.io/gmane.comp.audio.sox
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for project(s) associated with this inbox:

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

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git