mp3read and mp3write

Version 1.4.0.0 (2.13 MB) by Dan Ellis
Improved reading and writing of mp3 files
25.2K Downloads
Updated 21 Apr 2010

View License

These versions of mp3read and mp3write are direct drop-in replacements for wavread and wavwrite to access MPEG audio mp3 files. Features include:
- aims to duplicate complete syntax of wavread and wavwrite
- also supports on-the-fly downsampling and channel merging of mpg123
- optimized for very long mp3 files - only decodes the needed portion
- uses popen for encoding to avoid a large temporary file (when available - see my popenw mex)
- attempts to preserve time alignment of files through read/write loop by removing "warm up" samples
- package includes helper binaries for Linux, Windows, Mac-PPC, Mac-Intel, and Mac-Intel-64bit

Cite As

Dan Ellis (2024). mp3read and mp3write (https://www.mathworks.com/matlabcentral/fileexchange/13852-mp3read-and-mp3write), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2010a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

mp3readwrite/html/

Version Published Release Notes
1.4.0.0

- updated binaries for maci64 (static link) and windows (http works)
- expands '~' in file names
- returns correct SR when reading over http:

1.2.0.0

Updated to use and include more recent versions of mpg123 and lame. I've done my best to fix inconsistencies with the 'size' return, but for some MP3s this relies on header info I can't probe.

1.1.0.0

This version enables the ability of mpg123 to read mp3 files from URLs.

1.0.0.0

- updated interaction of sample limits and predelay compensation in mp3read to make it more consistent
- increased buffer to provide more tolerance of bad blocks in stream