bugGNU Octave - Bugs: bug #38186, audio package has incorrect...


bug #38186: audio package has incorrect ausave.m on 64-bit platforms...generates unplayable files

Submitted by:  None
Submitted on:  Mon 28 Jan 2013 08:03:10 PM UTC  
Category: Octave Forge PackageSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: NoneAssigned to: None
Originator Name: Steven BraegerOriginator Email: -unavailable-
Open/Closed: OpenRelease: 3.6.2
Operating System: Any

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


Tue 29 Jan 2013 09:33:45 AM UTC, comment #1:

Is the change of the default value for sampleformat intentional?

Carnë Draug <carandraug>
Project Member
Mon 28 Jan 2013 08:03:10 PM UTC, original submission:


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'



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

Attached Files
file #27337:  ausave.m added by None (9kB - text/x-objcsrc)
file #27338:  stuff added by None (2kB - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by None (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 28 Jan 2013 08:03:10 PM UTCNoneAttached File-=>Added ausave.m, #27337
      Attached File-=>Added stuff, #27338

    Back to the top

    Powered by Savane 3.1-cleanup