Unity サウンド再生
作成日時:2019/07/15
更新日時:2019/07/15
スポンサーリンク
UnityWebRequestMultimedia.GetAudioClip
IEnumerator GetAudioClip() { string soundPath = Application.streamingAssetsPath + "/sound"; string[] files = Directory.GetFiles(soundPath); foreach (string path in files) { if (Path.GetExtension(path) != ".wav") { continue; } UnityWebRequest www = UnityWebRequestMultimedia.GetAudioClip("file://" + path, AudioType.WAV); { yield return www.Send(); if (www.isNetworkError) { Debug.Log(www.error); } else { AudioClip myClip = DownloadHandlerAudioClip.GetContent(www); seClipList.Add(myClip); } } } }
関連リンク
https://docs.unity3d.com/ja/2018.2/ScriptReference/AudioType.html
https://docs.unity3d.com/ja/2017.4/ScriptReference/Networking.UnityWebRequest.SendWebRequest.html
https://docs.unity3d.com/ja/current/ScriptReference/Networking.UnityWebRequestAsyncOperation.html
https://docs.unity3d.com/ScriptReference/Networking.UnityWebRequestMultimedia.GetAudioClip.html
https://docs.unity3d.com/Manual/UnityWebRequest.html
https://docs.unity3d.com/ja/current/ScriptReference/WWW-audioClip.html
https://docs.unity3d.com/ja/2018.2/ScriptReference/AudioClip.html