예제 #1
0
        public static void PlayPreviewFromAudicaFile(MonoBehaviour mono, AudioSource audioSource, string audicaPath)
        {
            var audica = new Audica(audicaPath);

            string tempPath      = Path.Combine(NLUtility.GetNLDirectory(), "Temp");
            string tempAudioPath = Path.Combine(tempPath, "preview.ogg");

            if (!Directory.Exists(tempPath))
            {
                Directory.CreateDirectory(tempPath);
            }
            audica.song.ExportToOgg(tempAudioPath);

            mono.StartCoroutine(NLUtility.PlayAudioClip(tempAudioPath, audioSource, (float)audica.desc.previewStartSeconds));
        }
예제 #2
0
 /// <summary>
 /// Returns an array of file paths to local audica files.
 /// </summary>
 /// <returns></returns>
 public static string[] GetLocalAudicaFiles()
 {
     return(GetAllFiles(NLUtility.GetAudicaDirectory(), "*.audica").ToArray());
 }