Mon 28 Jan 2013 08:03:10 PM UTC, original submission:
/usr/share/octave/packages/audio-1.1.4/ausave.m
contains code to save data in various uncompressed audio formats. These formats contain header printing code like:
(along with other code that performs similarly).
However, files output by this code on 64-bit platforms cannot be read by other music programs. The reason is this...'long' on a 32-bit platform creates a 32-bit number, but a 64-bit number on a 64-bit platform, making improper file offsets. Here is a hex dump of the first 32 bytes of a correct aiff file.
However, here is the first 32 bytes output from ausave of that same file on 64-bit octave on linux.
This file does not play in any player, reporting 'error in header, cannot play form 0' on most of them.
The fix is to change all instances of 'long' in the fwrite() calls to 'uint32' or 'int32' as appropriate..and also to do the same with the other data types 'short' and 'char' as well. I have attached a patched version of the file.
While you are at it, you should fix the following bug in the help string. It reads ' Format is one of ulaw, alaw, char,
## short, long, float, double' is in the
This is not the case, as 'char' is not supported. The correct argument should be 'uchar'
|