JUCE icon indicating copy to clipboard operation
JUCE copied to clipboard

Adapt the audio-channel capacity of AudioFormatWriter::writeFromFloatArrays

Open j-bresson opened this issue 3 years ago • 0 comments

Saving an audio file with many audio channels hits a limit (and asserts) at 255.

https://github.com/juce-framework/JUCE/blob/9055820a30770479e30994c9a91029474cf60f7d/modules/juce_audio_formats/format/juce_AudioFormatWriter.cpp#L160

After a quick glance at the git history: it seems like chans was formerly a C-array (hence the static limit), and then was converted to a vector of the same fixed size in 31a7c62bafe87626578e0cda7db138c78d10d9db.

It doesn't seem like there's anything on the way of making its size adapted to the incoming audio buffer (numSourceChannels + 1). This will also spare the creation of unused channels with buffers of less than 255 channels.

j-bresson avatar Jan 16 '22 01:01 j-bresson