Hi Måns, thanks for getting back!

On 12/07/19 19:10, Måns Rullgård wrote:
Diemo Schwarz <diemo.schw...@ircam.fr> writes:

Hi all,

is libsox's audio file reading safe and meant to be used in a multi-threaded
situation?
I just replaced libsndfile by libsox in a program that mixes two audio
files, where file reading and buffering is done in two separate threads, and
I'm getting weird behaviour.

Concurrent operations on the same file or effects chain are not supported.

understood. It also seems that separate files in separate threads do work fine (no global data structures in libsox). At least my program is now working nicely with two decoding threads.

Small observation: I found a malloc/free pair in the macro generating the low level read routines sox_read_ ## sign ## type ## _samples. For small sizes, alloca or a preallocated buffer might be slightly more efficient here (but probably not worth the architectural and cross-platform related changes).

All the best...
                                                                ...Diemo

--
Diemo Schwarz, PhD -- http://diemo.concatenative.net
Sound–Music–Movement Interaction Team -- http://ismm.ircam.fr
IRCAM - Centre Pompidou -- 1, place Igor-Stravinsky, 75004 Paris, France
Phone +33-1-4478-4879 -- Fax +33-1-4478-1540


_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel

Reply via email to