For what formats I can create a stream via createStream?


I try to create a stream from an audio file.
I use unity and make build for android.

var result = FMODUnity.RuntimeManager.CoreSystem.createStream(filename, FMOD.MODE.CREATESTREAM, out Sound);

This code works for wav or mp3 formats.
But not works and return ERR_FORMAT in result for wma, amr and others.

So my question: for what formats I can create a stream via createStream?

if createStream supports NOT only wav or mp3, then why I get ERR_FORMAT?

If createStream supports ONLY wav and mp3, then how to open other formats from disk?


I was hoping to point you at our docs, specifically our FMOD_SOUND_TYPE docs for a full list of supported formats. However those docs are a little dated, while mostly correct they missed some detail. To answer your question directly, WMA can only be decoded on Windows platforms, not Android. Generally I recommend our container format FSB, for Android use FADPCM or Vorbis compression with it. If that’s not an option, try .ogg or .m4a as an alternative.

Here is a trimmed down version of my update to the docs that highlights all of our supported formats:

  • FMOD Sample Bank (.fsb). Proprietary multi-sound bank format. Supported encodings: PCM16, FADPCM, Vorbis, AT9, XMA, Opus.
  • Audio Interchange File Format (.aif, .aiff). Uncompressed integer formats only.
  • Microsoft Advanced Systems Format (.asf, .wma, .wmv). Platform provided decoder, available only on Windows.
  • Downloadable Sound (.dls). Multi-sound bank format used by MIDI (.mid).
  • Free Lossless Audio Codec (.flac).
  • Impulse Tracker (.it).
  • Musical Instrument Digital Interface (.mid).
  • Protracker / Fasttracker Module File (.mod).
  • Moving Picture Experts Group (.mp2, .mp3). Also supports .wav (RIFF) container format.
  • Ogg Vorbis (.ogg).
  • Play list information container (.asx, .pls, .m3u, .wax). No audio, tags only.
  • Raw uncompressed PCM data (.raw).
  • ScreamTracker 3 Module (.s3m).
  • Microsoft Waveform Audio File Format (.wav). Supported encodings: Uncompressed PCM, IMA ADPCM. Platform provided ACM decoder extensions, available only on Windows.
  • FastTracker 2 Extended Module (.xm).
  • Apple Audio Queue decoder (.mp4, .m4a, .mp3). Supported encodings: AAC, ALAC, MP3. Platform provided decoder, available only on iOS / tvOS devices.
  • Microsoft Media Foundation decoder (.asf, .wma, .wmv, .mp4, .m4a). Platform provided decoder, available only on UWP.
  • Google Media Codec decoder (.m4a, .mp4). Platform provided decoder, available only on Android.
1 Like

Thanks! Very helpful!