- 
                Notifications
    
You must be signed in to change notification settings  - Fork 6
 
API Reference
        Gindemit Konstantin edited this page May 12, 2023 
        ·
        1 revision
      
    Namespace: OggVorbis
The VorbisPlugin class is the main interface for interacting with the OggVorbis audio format.
public static void Save(
    string filePath,
    UnityEngine.AudioClip audioClip,
    float quality = 0.4f,
    int samplesToRead = 1024)- 
filePath: The file path where the audio clip will be saved. - 
audioClip: The Unity audio clip to be saved. - 
quality: The quality of the output audio file, default is 0.4f. - 
samplesToRead: The number of samples to read from the audio clip, default is 1024. 
This method saves a Unity audio clip to a specified file path with the given quality and number of samples to read.
public static byte[] GetOggVorbis(
    UnityEngine.AudioClip audioClip,
    float quality = 0.4f,
    int samplesToRead = 1024)- 
audioClip: The Unity audio clip to be converted. - 
quality: The quality of the output audio data, default is 0.4f. - 
samplesToRead: The number of samples to read from the audio clip, default is 1024. 
This method returns a byte array representing the audio clip in the OggVorbis format.
public static UnityEngine.AudioClip Load(
    string filePath, 
    int maxSamplesToRead = 1024)- 
filePath: The file path of the audio file to be loaded. - 
maxSamplesToRead: The maximum number of samples to read from the audio file, default is 1024. 
This method loads an audio clip from a specified file path and returns it as a Unity AudioClip.
public static UnityEngine.AudioClip ToAudioClip(
    byte[] bytes, 
    string audioClipName, 
    int maxSamplesToRead = 1024)- 
bytes: The byte array representing the audio data. - 
audioClipName: The name of the new Unity audio clip. - 
maxSamplesToRead: The maximum number of samples to read from the audio data, default is 1024. 
This method converts a byte array representing audio data into a Unity AudioClip.