Пример #1
0
 public static byte[] ExportAudio(AudioClip audioClip)
 {
     byte[] data = (byte[])audioClip.GetAudioData();
     if (data.Length == 0)
     {
         return(null);
     }
     return(AudioConverter.ConvertToWav(data));
 }
Пример #2
0
        public static bool ExportAudio(IExportContainer container, AudioClip audioClip, Stream exportStream)
        {
            using (MemoryStream memStream = new MemoryStream())
            {
                audioClip.ExportBinary(container, memStream);
                if (memStream.Length == 0)
                {
                    return(false);
                }

                byte[] data = memStream.ToArray();
                return(AudioConverter.ConvertToWav(data, exportStream));
            }
        }