/// <summary> /// 结束录音 /// </summary> public void EndRecording() { int audioLength = AudioRecord.EndRecording(duration, frequency); AudioClip audioClip = AudioClips.CutBlankSection(recording.clip, audioLength, frequency); // 保存原声音频 AudioRecord.SaveAudio(audioClip, originalPath); AudioClip audioClip1 = AudioClips.CutBlankSection(accompany.clip, audioLength, frequency); // 保存伴奏剪辑音频 AudioRecord.SaveAudio(audioClip1, accompanyClipPath); // 伴奏混合原声 AudioMixer.AudioMixing(accompanyClipPath, originalPath, finalPath); //TimeSpan startSpan = new TimeSpan(0,0,0); //TimeSpan endSpan = new TimeSpan(0,0, audioLength); //// 剪辑出最终效果 //AudioClips.TrimWavFile(mixedEffectPath, finalPath, startSpan, endSpan); }