Re: too many open files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Peter,

I would suggest to transform all files to a raw format (e.g. without
header) - with identical sample rate, bit rate and number of channels -
and concatenate them via bash and afterwards encode them in your desired
format (e.g. wav). Like so:

for file in inputs/*.wav
do
  sox $file -t raw -
done |
  sox -t raw - output.wav

As mentioned, you might need to specify bit and sample rate and number
of channels manually, though.

cheers,
Erich

On 09.11.2016 10:50, Peter P. wrote:
> Dear Sox list,
> 
> I am stumbling over a (known) problem:
> 
> I am trying to concatenate many audio files with 
> 
> sox "*.wav" out.wav 
> 
> and after some time am getting the error message
> 
> sox FAIL formats: can’t open input file ‘whatever.wav’ : Too many open files
> 
> I have found other people's postings about the same issue, as eg
> http://sox.10957.n7.nabble.com/Sox-Too-many-open-files-concatenating-from-playlists-with-a-large-number-of-entries-td5117.html
> 
> The max number of files to be concatenated this way seems to vary in
> between operating systems. Or does anyone know exact numbers, or how to
> determine the maximum number on a given OS?
> 
> Now I understand that sox is keeping them all opened when concatenating
> them, which might be necessary in other cases, as when trying to
> normalize them all to a common level. Sadly this seems to impose the
> described limit. Or is there another reason why all files have to be
> kept open?
> 
> I tried to work around this by recursively concatenating each input file
> to a common (growing) output file using a simple bash until loop. The
> performance penalty of this is enormous, as the same output file has to
> be opened, read and written each time again.
> 
> I am curious what a possible workaround could be, other than dividing
> above task between multiple calls of sox, each with a reduced number of
> files.
> 
> Thank you for your suggestions and comments,
> Peter
> 
> ------------------------------------------------------------------------------
> Developer Access Program for Intel Xeon Phi Processors
> Access to Intel Xeon Phi processor-based developer platforms.
> With one year of Intel Parallel Studio XE.
> Training and support from Colfax.
> Order your platform today. http://sdm.link/xeonphi
> _______________________________________________
> Sox-users mailing list
> Sox-users@xxxxxxxxxxxxxxxxxxxxx
> https://lists.sourceforge.net/lists/listinfo/sox-users
> 

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Sox-users mailing list
Sox-users@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/sox-users

[Index of Archives]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Photo Sharing]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux