[asterisk-users] How to record and playback at the same time

Motiejus Jakštys desired.mta at gmail.com
Thu Jul 29 09:46:35 CDT 2010


On Thu, Jul 29, 2010 at 2:32 PM, Benny Amorsen <benny+usenet at amorsen.dk> wrote:
> Sherwood McGowan <sherwood.mcgowan at gmail.com> writes:
>
>> I'm going to go ahead and say that while I'm not one of the
>> developers, I think it's safe to say that you cannot record to a file
>> and play it back at the same time. Probably something like file
>> locking (for the record, locks it from access by other processes,
>> etc)...
>
> There is nothing in Unix/Linux which prevents the playback of a file
> while it is being recorded. File locks in Linux are purely advisory; it
> is up to the applications whether they choose to respect them.
>
> The only challenge is whether the header has been written correctly, and
> you should be able to do without that in a pinch. What happens if you
> copy the half-written file to a computer with speakers and try to play
> it through the speakers?
>

Even (incorrect) headers are not a problem if you know the exact file format.
apt-get/yum/pacman/emerge/whatever install/-S/whatever sox
man (sox|play)
Quick grep through sox source did not yield any fcntl functions, IMHO
sox should ignore any "locked" files and you should be able to play
them without problems.

Motiejus



More information about the asterisk-users mailing list