// Unity unifies file system access in the WWW class, we can use the WWW class to get data both from internet and from local file system on any platform.
        IEnumerator DownloadClipAndPlayFromUrl(string url)
        {
            if (lastAudioLoader != null)
            {
                lastAudioLoader.Destroy();
            }
            lastAudioLoader  = null;
            audioSource.clip = null;

            var isFromInternet = url.IndexOf("http", StringComparison.InvariantCultureIgnoreCase) != -1;

            statusMessage = "Getting data " + url;
            var www = new WWW(url);

            while (!www.isDone)
            {
                if (isFromInternet)
                {
                    statusMessage = "Downloading " + url + "\nDownload progress: " + (int)(www.progress * 100) + "%";
                }
                yield return(new WaitForEndOfFrame());
            }

            if (www.bytes.Length == 0)
            {
                statusMessage = "Error: downloaded zero bytes from " + url;
            }
            else
            {
                statusMessage = "Loading " + url;

                if (loadMethod.value == LoadMethod.StreamInUnityThread)
                {
                    statusMessage = "Streaming";
                }
                else
                {
                    loadTimer = Stopwatch.StartNew();
                }

                var config = new AudioLoaderConfig();
                config.DataStream         = new MemoryStream(www.bytes);
                config.PreferredDecoder   = preferredDecoder.value;
                config.UnityAudioClipName = url;
                config.LoadMethod         = loadMethod.value;

                lastAudioLoader = new AudioLoader(config);
                lastAudioLoader.OnLoadingAborted += () => statusMessage = "Loading aborted.";
                lastAudioLoader.OnLoadingDone    += () => statusMessage = "Loading done.";
                lastAudioLoader.OnLoadingFailed  += (exception) => statusMessage = "Loading has failed: " + exception.Message;
                audioSource.clip = lastAudioLoader.AudioClip;
                lastAudioLoader.StartLoading();
            }
        }