|
From: Jan S. <ha...@st...> - 2015-12-09 08:44:52
|
On Dec 08 14:21:55, isi...@ho... wrote:
> so far, I fixed that problem. (I had to use trim to cut the microphone
> signal). But still couldn't figure out how to make it go on forever.
> while true; do sox -m --input-buffer 512 --single-threaded -r 48000 -t alsa
> hw:1,0 /media/NASDRIVE2/bow.wav -t alsa hw:0,0 trim 0 362 delay 3 0 ; sudo
> killall -9 sox; sleep 4; done
Please explain first what you are trying to achieve.
You are mixing (-m) the input from hw:1,0 and bow.wav
into hw:0,0 - why? And why do you delay the hw:1,0 input?
Then after 362 seconds you trim,
kill everybody's running sox processes for no reason,
and repeat. What is the ultimate purpose of this?
> It stops after few hours ( I let it run at night,
> in the morning it is already had stopped)
You mean the infinite loop has stopped?
> I get alsa under-run errors repeatedly, could that be the reason that it
> stops? Could the buffersize might be the reason if this?
Whatever happens _inside_ the infinite
while true; do WHATEVER; done
loop is not a reason for the loop to exit,
except for a specific break of the loop.
Anyway, the alsa underruns are most probably related to the buffer size.
Whay aer you setting it to 512? (And why are you setting it at all?)
> And what do you mean by output of sox with script(1) ?
> Do you mean this ?
Yes.
> hw:1,0: (alsa)
>
> Encoding: Signed PCM
> Channels: 2 @ 16-bit
> Samplerate: 48000Hz
> Replaygain: off
> Duration: unknown
>
>
> /media/NASDRIVE2/bow.wav:
>
> File Size: 69.9M Bit Rate: 1.54M
> Encoding: Signed PCM
> Channels: 2 @ 16-bit
> Samplerate: 48000Hz
> Replaygain: off
> Duration: 00:06:04.00
^^^^^^^^^^^
Ah, so this is why you are trimming at 362 seconds?
You might want to use the "newfile" pseudo-effect,
in particular "newfile : restart"
> In:0.05% 00:00:00.17 [00:06:03.83] Out:4.10k [ |= ] Clip:0
> sox WARN alsa: under-run
> In:2.63% 00:00:09.56 [00:05:54.44] Out:455k [ -=|== ] Clip:0
> sox WARN alsa: under-run
> In:5.81% 00:00:21.16 [00:05:42.84] Out:1.01M [ -==|== ] Clip:0
> Aborted.
> sox: no process found
> ^C
Shell question: did the ^C kill just the running sox process
(and so killall has nothing to kill, hence the error message),
or did it kill the while loop?
More importantly, how does the end look like
when the infinite loop "has stopped" by itself,
as you say?
Jan
|