sox_open_mem_write() only creates the file; it doesn't write anything into it. You'll find out how much is written from the subsequent calls to sox_write().
Eight years on... You're welcome & thanks for confirming it works OK https://codeberg.org/sox_ng/sox_ng/issues/203
sox_ng from 14.5.0 on reads APE files (and dozens of others) using ffmpeg.
Hi! I've had another look at this, and the problem may be that the code calls sox_memstream_write(), writes a load of stuff into it and then calls sox_read on the same sox_format_t that was opened for writing, whereas what it should do is sox_close() the output and then read the data directly from the memory buffer pointer and length that are updated only by stdio when the file is flushed or closed. I suspect that it "works" when using a disk file because either SoX or stdio has separate read and...
Hi! I've had a look at this and it seems that the reason is that "speed" changes the sample rate but the call to sox_open_write() specifies the sample rate of the output file as a copy of that of the input file. It is sox.c, which is "just" another client of libsox, that automatically inserts effects in the chain to adapt the sample rate at the end, make the number of channels match, not libsox, which is why it works from the command line as you expected. If you add a "rate 48000" (or whatever the...
Hi! I've had a look at this and it seems that the reason is that "speed" changes the sample rate but the call to sox_open_write() specifies the sample rate of the output file as a copy of that of the input file. It is sox.c, which is "just" another client of libsox, that automatically inserts effects in the chain to adapt the sample rate at the end, make the number of channels match, not libsox, which is why it works from the command line as you expected. If you add a "rate 48000" (or whatever the...
Found and fixed an out-by-one error when the window size in samples is exactly the same as the file length. https://codeberg.org/sox_ng/sox_ng/issues/561 Thanks for reporting this
Greetings! Pythagorean tuning just went into sox_ng as a synth -p option like -j but I'm boggling at the number of alternative 12-tone exact-octave tunings like Werckmeister I, II and III, not to mention non-exact-octave and Gamelan or 53-tone scales. https://codeberg.org/sox_ng/sox_ng/issues/729 I have the distinct sensation that I don't know what I'm doing. Can you advise how to proceed? M