hey,
I’m building an app that will run on thinkingpad(Android)
and i’m trying to add a background sound and load the music from disk at runtime.
i think I tried every possible variation of this code…none of them are working. the common thing is the error:
Error: Cannot create FMOD::Sound instance for resource 8EBC, (Unsupported file or audio format. )
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
Error: Cannot create FMOD::Sound instance for resource 8EBC, (Unsupported file or audio format. )
UnityEngine.WWW:GetAudioClip(Boolean, Boolean, AudioType)
c__Iterator2:MoveNext() (at Assets/Scripts/TheScene.cs:282)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
i tried “.WAV”, “.OGG”. extensions. still doesn’t work. i tried from “file://” and with a direct link.
still nothing.
this is my code: (the first one is loading a single file, and the rest is first loading all the clips then i can play the one i want. (doesn’'t work!!!)
IEnumerator DownloadAndPlay(string url)
{
Debug.Log(url);
_www = new WWW("https://dl7.volafile.org/get/7yUm79kvybxr/BalloonsBG.ogg");
Debug.Log("Start Dowload");
yield return _www;
Debug.Log("Playing");
_audiopoint = GetComponent<AudioSource>();
_audiopoint.clip = _www.GetAudioClip(true, true, AudioType.OGGVORBIS);
_audiopoint.clip.name = "Downloaded clip";
_audiopoint.Play();
}
void PlaySound(int i)
{
source.clip = clips;
source.Play();
}
void ReloadSounds()
{
clips.Clear();
// StartCoroutine(DownloadAndPlay("file:///" + backgroundSoundPath));
// StartCoroutine(LoadFile(team1poppedSoundPath));
// StartCoroutine(LoadFile(team2poppedSoundPath));
// StartCoroutine(LoadFile(backgroundSoundPath));
}
IEnumerator LoadFile(string path)
{
string url = string.Format("file://{0}", path);
WWW www = new WWW(url);
yield return www;
AudioClip clip = www.GetAudioClip(true, true, AudioType.OGGVORBIS);
print("done loading");
clip.name = Path.GetFileName(path);
clips.Add(clip);
}
if u have any clue,
thanks!!