sox-devel@lists.sourceforge.net unofficial mirror
 help / color / mirror / code / Atom feed
From: Jan Stary <hans@stare.cz>
To: sox-devel@lists.sourceforge.net
Subject: Re: Adjusting write buffer for recording
Date: Mon, 12 Aug 2013 19:11:45 +0200	[thread overview]
Message-ID: <20130812171142.GA25084@www.stare.cz> (raw)
In-Reply-To: <CACB3T6H3a+Lz2qftGiGYEE5WHuuo5=SSNBx1v6QE+WeFqtLS8g@mail.gmail.com>

On Aug 12 09:16:32, shane.blaser@callfire.com wrote:
> > On Aug 12 07:31:24, shane.blaser@callfire.com wrote:
> > > Yes i am calling stat,
> >
> > Wouldn't it be easire to just write to a pipe,
> > and have your application read from that pipe?
> >
> Maybe not sure the file seems to work.

No doubt, but you have to call stat() in a loop
to find out whether the file has grown; with a pipe,
you would just be read()ing and getting the data (or not).

> > > 1. rec listening with silence detection
> > > 2. Call comes in and recording starts.
> > > 3. Caller id is between 1st and second ring.
> > > (ok this is were the issue comes in)
> > > after the first ring I get the first part of the caller id signal written
> > > to disk (call it 1/2 of the caller id signal).
> >
> > Let me understand this: in the phone calls you are recording,
> > there is a piece of _audio_ signal, comming between the
> > first and second ring, which carries the caller's ID.
> > Is that right? Can you please elaborate? I never knew
> > there is something like that coming on a phone line.
> >
> yes it is audible and it sounds like a fax machine or modem ..

> > > But not until after the second ring
> > > do I get the audio for the rest of the caller id written to disk.
> > > Can I have rec write silence to the file after the recording starts?
> >
> > Of course: just rec(1) everything,
> > without using the 'silence' effect.
> 
> > What you are doing now is the exact opposite:
> > you are telling rec(1) _not_ to write until
> > a certain treshold of 'silence' is surpassed.
> >
> > I am too lazy now to look up your exact 'silence' parameters,
> > but could it be that the caller ID audio signal contains
> > enough 'silence' so that rec(1) pauses?
> >
> After the caller id signal there is a silence until the next ring ...
> 
> Do you see any way for me to adjust the write buffers, if I can make them
> smaller I think this issue will fall away ...?

This has nothing to do with buffers.

You are running rec(1) with the silence effect.
That makes rec(1) pause when it sees the silence.
Just run rec(1) without the silence effect - that
way, rec will just write everything, without pausing
at the 'silent' moments.

The writing will of course be buffered, and you can play
with --buffer to make the continuous writing more smooth.
But that's not your problem now: rec waits with writing
because you are telling it to wait (for a non-silence).

	Jan


------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk

  reply	other threads:[~2013-08-12 17:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-09 21:05 Adjusting write buffer for recording Shane Blaser
2013-08-11 17:10 ` Jan Stary
2013-08-12  5:11   ` Shane Blaser
2013-08-12  6:09     ` Jan Stary
2013-08-12 14:31       ` Shane Blaser
2013-08-12 16:03         ` Jan Stary
2013-08-12 16:16           ` Shane Blaser
2013-08-12 17:11             ` Jan Stary [this message]
2013-08-12 17:28               ` Shane Blaser
2013-08-12 17:48                 ` Jan Stary

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.sourceforge.net/lists/listinfo/sox-devel

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130812171142.GA25084@www.stare.cz \
    --to=sox-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).