bugGNU Octave - Bugs: bug #64388, audiowrite of mp3s fails

 
 

bug #64388: audiowrite of mp3s fails

Submitter:  John Donoghue <lostbard>
Submitted:  Thu 06 Jul 2023 03:56:04 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Fixed Assigned to:  None
Originator Name:  lostbard Open/Closed:  * Closed
Release:  * dev Release: 
Operating System:  * Any Fixed Release:  9.1.0
Planned Release:  9.1.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Fri 13 Oct 2023 07:15:03 PM UTC, comment #6: 

No problems reported in 3 months. Closing as fixed.

Does this need a BIST as described in comment #5? I'm not familiar enough with the mechanics of MP3 encoding with its psychoacoustic models to say whether we ought to get the same wave form back or only something that sounds the same to the human ear.

Arun Giridhar <arungiridhar>
Group Member
Sat 15 Jul 2023 10:01:09 AM UTC, comment #5: 

Thanks for your patch.

I understand that the identifiers that are checked in the configure test are enum values (not preprocessor macros). That means that a configure test is required. I also understand that we need a new preprocessor macro if we don't want to impose stricter requirements to the sndfile library that we link to.

Afaict, the requirement for ogg file support in the sndfile library is in place since at least 2015:
https://hg.savannah.gnu.org/hgweb/octave/rev/3b3579ad7e46
There's probably little point to make it optional now.

Given that, I pushed your patch (with some minor changes) to the default branch of Octave:
https://hg.savannah.gnu.org/hgweb/octave/rev/9cb43336c3b3

Would it make sense to also add a BIST for that? Maybe, writing a sine to a .mp3 file and reading it back?

Marking as ready for test.

Markus Mützel <mmuetzel>
Group administrator
Thu 06 Jul 2023 06:54:52 PM UTC, comment #4: 

Looking at the current configure, we already do a test to see if ogg support is available (Test is 'whether sndfile library is modern enough') which if I didnt miss anything in the code is just so we dont have to #if the ogg support ?

John Donoghue <lostbard>
Group Member
Thu 06 Jul 2023 06:25:59 PM UTC, comment #3: 

the macros are enums rather than defines so cant be #if defined

John Donoghue <lostbard>
Group Member
Thu 06 Jul 2023 04:50:19 PM UTC, comment #2: 

Do we need the configure check?  Couldn't we just check whether the necessary macros are defined in the source file itself?

John W. Eaton <jwe>
Group administrator
Thu 06 Jul 2023 03:57:27 PM UTC, comment #1: 

Possible patch added

(file #54911)

John Donoghue <lostbard>
Group Member
Thu 06 Jul 2023 03:56:04 PM UTC, original submission:  

Newer versions of libsndfile support writing mp3 files and octave audioread will read the files correctly

However audiowrite does not work as the file extension has not been added to octave


octave:1> s = rand(8000,1);
octave:2> audiowrite("test2.mp3", s, 8000)
error: audiowrite: failed to open output file 'test2.mp3': Error : major format is 0.
octave:3>


John Donoghue <lostbard>
Group Member

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #54911:  mp3_1.patch added by lostbard (3KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by arungiridhar (Posted a comment)
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by lostbard (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-10-13 arungiridhar StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2023-07-15 mmuetzel StatusNone Ready For Test
        Releasestable dev
        Fixed ReleaseNone 9.1.0
        Planned ReleaseNone 9.1.0
    2023-07-06 lostbard Attached File- Added mp3_1.patch, #54911

    Back to the top

    Powered by Savane 3.15-ef91.
    Corresponding source code