Ogg Vorbis (.ogg, .oga)


    MIME types: audio/ogg, audio/vorbis
    Ogg Vorbis digital audio format.
    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.
    Stores up to 255 channels of compressed audio data.
    Ogg Vorbis uses variable bit rate (VBR) per sample.
    Supports arbitrary sampling frequencies from 8 kHz to 192 kHz.

Import and ExportImport and Export

  • Import["file.ogg"] imports an Ogg Vorbis file, returning an audio object.
  • Import["file.ogg",elem] imports the specified element from an Ogg Vorbis file.
  • The import format can be specified with Import["file","OGG"] or Import["file",{"OGG",elem,}].
  • Export["file.ogg",expr] exports an audio or sound object to an Ogg Vorbis 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 Ogg Vorbis 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 and Export use the "Audio" element by default for Ogg Vorbis files.
  • Multiple channels are represented as an array of audio samples.
  • Advanced Import element:
  • "AudioChannels"number of audio channels
    "AudioEncoding"audio encoding
    "SampleRate"number of amplitude samples per second and channel


  • Import and Export option:
  • IncludeMetaInformationAllwhether to include meta-information
    SampleRateAutomaticnumber of amplitude samples per second for each channel
  • Export options:
  • "AudioChannels"Automaticnumber of audio channels
    "CompressionLevel"0.5compression level, given as a number between 0 and 1
  • If the number of channels is unspecified, the highest number of simultaneous channels is taken, and silence is inserted if necessary.
  • If "AudioChannels" is set to a value n that is less than the number of channels to be exported, only the first n channels are exported.
  • "CompressionLevel" can be set to values in the range from 0 to 1, with larger values resulting in smaller file sizes.

ExamplesExamplesopen allclose all

Basic Examples  (2)Basic Examples  (2)

Import an Ogg Vorbis file:

Click for copyable input

Export to an Ogg Vorbis file:

Click for copyable input
Click for copyable input

Decrease compression level:

Click for copyable input
Introduced in 2014
| Updated in 2016