- Home /
Audio Streaming Not Working
So I'm trying to get personal Audio loading working where people can play their own music, but I ran into a few problems with an overly complicated script (which automatically gets the file-path) so I stripped back the code to find out what the issue was. Here is the code:
var Source1 : GameObject;
var url : String;
function Start()
{
var www = new WWW(url);
Source1.audio.clip = www.GetAudioClip(false,true, AudioType.WAV);
if (System.IO.Directory.Exists(MusicFolder)) {
} else {
System.IO.Directory.CreateDirectory(MusicFolder);
}
}
function Update () {
if(!Source1.audio.isPlaying && Source1.audio.clip.isReadyToPlay)
Source1.audio.Play();
}
I have used a screenshot of the Source1 GameObject too help. The url variable is set to:
J:\13 DESIGNED GAMES $$$$$$$$$$$$$$$\FULL GAMES\GREEBROLL\Greebroll Menu\MenuAmbience01.wav
Here is a screenshot of the actual filepath: When I press play, the Audio Clip variable on the Audio Source component on the Source 1 Gameobject is blank (doesn't state MenuAmbience01) instead it just has the small audio icon. Help would be greatly appreciated.
Answer by Lemo76 · May 17, 2014 at 10:21 PM
Never mind, solved!
You should say how you solved it, because someone else might find it useful. Cheers
Your answer
Follow this Question
Related Questions
Unity streaming audio. Rtsp question. 1 Answer
Get certain audio sources from unity as buffer? 0 Answers
Live audio streaming through Audio Source 0 Answers
IOS Streaming crash 0 Answers
Stream Spotify to Unity's AudioSource 0 Answers