Convert2Wem() public static method

Covert Wav to Wem using WwiseCLI.exe for faster conversion, source path should be wav file
public static Convert2Wem ( string wavSourcePath, string destinationPath, int audioQuality ) : void
wavSourcePath string
destinationPath string
audioQuality int
return void
        /// <summary>
        /// Convert ogg or wave audio files to Wwise 2013 wem audio, including preview wem file.
        /// </summary>
        /// <param name="audioPath"></param>
        /// <param name="audioQuality"></param>
        /// <param name="previewLength"></param>
        /// <param name="chorusTime"></param>
        /// <returns>wemPath</returns>
        public static string Convert2Wem(string audioPath, int audioQuality = 4, long previewLength = 30000, long chorusTime = 4000)
        {
            // ExternalApps.VerifyExternalApps(); // for testing
            var audioPathNoExt = Path.Combine(Path.GetDirectoryName(audioPath), Path.GetFileNameWithoutExtension(audioPath));
            var oggPath        = String.Format(audioPathNoExt + ".ogg");
            var wavPath        = String.Format(audioPathNoExt + ".wav");
            var wemPath        = String.Format(audioPathNoExt + ".wem");
            var oggPreviewPath = String.Format(audioPathNoExt + "_preview.ogg");
            var wavPreviewPath = String.Format(audioPathNoExt + "_preview.wav");
            var wemPreviewPath = String.Format(audioPathNoExt + "_preview.wem");

            if (audioPath.Substring(audioPath.Length - 4).ToLower() == ".ogg") //in RS1 ogg was actually wwise
            {
                ExternalApps.Ogg2Wav(audioPath, wavPath);                      //detect quality here
                if (!File.Exists(oggPreviewPath))
                {
                    ExternalApps.Ogg2Preview(audioPath, oggPreviewPath, previewLength, chorusTime);
                    ExternalApps.Ogg2Wav(oggPreviewPath, wavPreviewPath);
                }
                audioPath = wavPath;
            }

            if (audioPath.Substring(audioPath.Length - 4).ToLower() == ".wav")
            {
                if (!File.Exists(wavPreviewPath))
                {
                    if (!File.Exists(oggPath))
                    {
                        //may cause issues if you've got another guitar.ogg in folder, but it's extremely rare.
                        ExternalApps.Wav2Ogg(audioPath, oggPath, audioQuality); // 4
                    }
                    ExternalApps.Ogg2Preview(oggPath, oggPreviewPath, previewLength, chorusTime);
                    ExternalApps.Ogg2Wav(oggPreviewPath, wavPreviewPath);
                }
                Wwise.Convert2Wem(audioPath, wemPath, audioQuality);
                audioPath = wemPath;
            }

            if (audioPath.Substring(audioPath.Length - 4).ToLower() == ".wem" && !File.Exists(wemPreviewPath))
            {
                Revorb(audioPath, oggPath, Path.GetDirectoryName(Application.ExecutablePath), WwiseVersion.Wwise2013);
                ExternalApps.Ogg2Wav(oggPath, wavPath);
                ExternalApps.Ogg2Preview(oggPath, oggPreviewPath, previewLength, chorusTime);
                ExternalApps.Ogg2Wav(oggPreviewPath, wavPreviewPath);
                Wwise.Convert2Wem(wavPath, wemPath, audioQuality);
                audioPath = wemPath;
            }

            return(audioPath);
        }