Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


oggVorbis

Load an Ogg Vorbis file into the audio clip.
Read time 1 minuteLast updated 2 days ago

Definition

  • Type: Property
  • Namespace: UnityEngine
  • Assembly: UnityEngine.UnityWebRequestWWWModule
Warning
Removed. Obsolete msg
Upgrade to WWW.GetAudioClip
public Object oggVorbis { get; }

Remarks

If the stream has not been downloaded completely, null will be returned. Use WWW.isDone or yield to see if the data is available.
Additional Resources: AudioClip, AudioSource.

Examples

using UnityEngine;using System.Collections;[RequireComponent(typeof(AudioSource))]public class ExampleClass : MonoBehaviour{ string path = "http://ia301106.us.archive.org/2/items/abird2005-02-10/abird2005-02-10t02.ogg"; IEnumerator Start() { // Start downloading using (var download = new WWW(path)) { // Wait for download to finish yield return download; // Create ogg vorbis file var clip = download.GetAudioClip(); // Play it if (clip != null) { GetComponent<AudioSource>().clip = clip; GetComponent<AudioSource>().Play(); } else // Handle error { Debug.Log("Ogg vorbis download failed. (Incorrect link?)"); } } }}