Hallo,
I added an additional command-line option to define the number of output channels. So the CHANNELS macro was removed, as this option replaces it.
Some statically defined arrays and structures are now defined dynamically, based on the number of channels specified, for example:
output_ports: Initialized by jack_init(), freed by jack_shutdown().
delays: Initialized by audio_init(), freed by audio_close(), which is called by atexit() on program exit.
sound.vcf, sound.formant_history: Initialized by new_sound(), freed also by new_sound() just before replacing old sound in sounds array, and by audio_close().
I checked with Valgrind for memory leaks or invalid reads. Also fixed an old leak related to sndfile and sample data allocation (there was an old TODO comment :)
Hallo, I added an additional command-line option to define the number of output channels. So the
CHANNELS
macro was removed, as this option replaces it.Some statically defined arrays and structures are now defined dynamically, based on the number of channels specified, for example:
output_ports
: Initialized byjack_init()
, freed byjack_shutdown()
.delays
: Initialized byaudio_init()
, freed byaudio_close()
, which is called byatexit()
on program exit.sound.vcf
,sound.formant_history
: Initialized bynew_sound()
, freed also bynew_sound()
just before replacing old sound insounds
array, and byaudio_close()
.I checked with Valgrind for memory leaks or invalid reads. Also fixed an old leak related to sndfile and sample data allocation (there was an old TODO comment :)