MP3 (.mp3)


    MIME types: audio/mpeg, audio/mpeg3, audio/x-mpeg-3MP3 digital audio format, known as MPEG Audio Layer 3.
    A lossy compression scheme commonly used for consumer audio streaming, storage, transfer, and playback, which can also be used on the web.
    Binary file format.
    Follows the ISO/IEC 11172-3 and ISO/IEC 13818-3 standard.
    Supports a few sampling frequencies from 8kHz to 48kHz.
    Supports up to two audio channels.

Import and Export

  • Import["file.mp3"] imports an MP3 file, returning an audio object.
  • Import["file.mp3",elem] imports the specified element from an MP3 file.
  • The import format can be specified with Import["file","MP3"] or Import["file",{"MP3",elem,}].
  • Export["file.mp3",expr] exports an audio or sound object to an MP3 file.
  • Sound objects including notes are rasterized to sampled audio.
  • See the reference pages for full general information on Import and Export.
  • ImportString and ExportString support the MP3 audio format.


  • General Import elements:
  • "Elements"list of elements and options available in this file
    "Rules"full list of rules for each element and option
    "Options"list of rules for options, properties, and settings
  • Data representation elements:
  • "Audio"audio signal given as an Audio object
    "AudioFile"audio signal given as an out-of-core Audio object
    "Data"raw audio samples, given as a list of real numbers, each sublist representing an individual audio channel
    "SampledSoundList"audio signal given as a SampledSoundList object
    "Sound"audio signal given as a Sound object
  • Import by default uses the "Audio" element for short MP3 files and the "AudioFile" element otherwise.
  • Advanced Import element:
  • "AudioChannels"number of audio channels
    "Duration"duration of the audio given in seconds
    "Length"number of samples
    "SampleRate"number of amplitude samples per second and channel
  • Metadata elements:
  • "MetaInformation"interpreted as quantities, locations, dates, numbers, etc.
    "RawMetaInformation"uninterpreted as strings and numbers
  • Multiple channels are represented as an array of audio samples.



open allclose all

Basic Examples  (2)

Import an MP3 file:

Click for copyable input

Generate an audio signal and export to MP3:

Click for copyable input
Click for copyable input

Scope  (4)

Import Elements  (14)

Import Options  (6)

Export Options  (5)

See Also

"M4A"  "OggVorbis"  "AIFF"  "AU"  "FLAC"  "SND"  "WAV"  "Wave64"

Introduced in 2014
| Updated in 2018