Search Unity

A few Audio Questions

Discussion in 'Editor & General Support' started by Shizen, Jun 6, 2014.

  1. Shizen

    Shizen

    Joined:
    Dec 31, 2012
    Posts:
    14
    I had a few questions about how Audio is handled in Unity. According to the documentation, Ogg/Vorbis is the internal, compressed format for audio resources, at least on some platforms (more on that later). Now if I compress my own audio stream into Ogg/Vorbis format, can I then play them directly? Vorbis by default uses a VBR (variable bit rate), do I have to encode with a specific set of Vorbis options, or can Unity handle all of them? Assuming the right combination, where would I tie back into the framework? Just via SetData on an audio clip? I know you can grab an Ogg/Vorbis file via WWW class which gives you an audioclip, but I don't know if it performs any magic on the bits in between.

    Secondly, as I mentioned above, the documentation also says Unity uses MP3 encoding for mobile platforms (for audio). Does that mean that Unity does not have decoders available for Ogg/Vorbis on mobile platforms? Or just prefers to use (potentially hardware augmented) MP3 decoders on those platforms? Would an Ogg/Vorbis sound play without modification on mobile?