Unity Vorbis plugin is a powerful tool for the Unity game engine that allows you to work with OGG Vorbis audio files. OGG Vorbis is a free, open-source audio coding format that is well-suited for streaming and manipulation in games.
The plugin provides you with the following functionalities:
For detailed information about these features, visit the API Reference page on our wiki.
To install the plugin, follow these steps:
For more detailed instructions, please visit the Installation Guide on the wiki.
Here's a quick rundown on how to use some of the most essential functions provided by this plugin:
// Loading Vorbis OGG from file at runtime:
string pathToFile = ...; // path to your file
UnityEngine.AudioClip audioClip = OggVorbis.VorbisPlugin.Load(pathToFile);
// Saving Vorbis OGG to file at runtime:
string pathToFile = ...; // path where you want to save the file
UnityEngine.AudioClip audioClip = ...; // audio clip you want to save
float quality = 0.4f; // optional parameter, values from 0 to 1
OggVorbis.VorbisPlugin.Save(pathToFile, audioClip, quality);
// Getting Vorbis OGG from bytes array at runtime:
byte[] sourceAudioBytes = ...; // byte array of your audio
UnityEngine.AudioClip sourceAudioClip = OggVorbis.VorbisPlugin.ToAudioClip(sourceAudioBytes, "NameOfAudioClip");
// Serializing Vorbis OGG to bytes array at runtime:
UnityEngine.AudioClip sourceAudioClip = ...; // audio clip you want to serialize
float quality = 0.4f; // optional parameter, values from 0 to 1
byte[] bytes = OggVorbis.VorbisPlugin.GetOggVorbis(sourceAudioClip, quality);
Visit the Usage Guide on the wiki for step-by-step instructions on how to use the plugin in your Unity project.
If you want to build the plugin from source, we've provided detailed instructions for each supported platform in our Building from Source page on the wiki.
We welcome contributions from the community. To contribute, please read the Contribution Guidelines on the wiki.
This project is licensed under the MIT License. See the LICENSE file for details.