- Home /
WWW load mp3 GetAudioClip without stream,play only a part,then no sound.
IEnumerator _LoadAudio(string path) {
string fullPath = "file://" + path;
WWW www = new WWW(fullPath);
yield return www;
AudioClip clip = www.GetAudioClip(true, false, AudioType.MPEG);
clip.name = path.Substring(path.LastIndexOf('/') + 1);
Debug.LogError(clip.isReadyToPlay);
chapterContentView.audioSource.clip = clip;
chapterContentView.Play();
Debug.LogError("load audio");
}
when I use the www to load the mp3 file,after I download from the local,after a period of time,nearly half of the audio length,it play with no sound,very weird,I also see the file property in the inspector,I found after nearly half of the audio length with no sound wave.also no sound,
but when I see the local mp3,it also no sound wave but there is the sound.I do not know why ,hope someone can help me!!!please....
3-28-2014 3-40-36 pm.jpg
(63.9 kB)
3-28-2014 3-46-32 pm.jpg
(65.5 kB)
Comment
Your answer
Follow this Question
Related Questions
How to use Resources.UnloadAsset 1 Answer
Issues importing AudioClip at runtime using WWW class 1 Answer
Endless Audio streaming (Radio)?! 3 Answers
WWW.GetAudioClip hardware decoding? ( on iphone and android ) 1 Answer
Why WWW.audioClip in unity 3.5 is take much more time to load in comparison with unity 3? 0 Answers