public void EndRecording() { int length = 0; AudioClip clip = null; if (SoundRecordCenter.EndRecording(out length, out clip)) { byte[] dataBuf = SoundRecordCenter.GetData(clip); byte[] dataBuf2 = SoundRecordCenter.GetClipData(clip); Debuger.Log("录间数据长度:" + dataBuf.Length); Debuger.Log("录间数据长度2:" + dataBuf2.Length); byte[] pressBuf = DataZipCenter.CompressByGZIP(dataBuf); Debuger.Log("压缩后数据长度:" + pressBuf.Length); byte[] pressBuf2 = DataZipCenter.CompressByGZIP(dataBuf2); Debuger.Log("压缩后数据长度2:" + pressBuf2.Length); clip = SoundRecordCenter.SetData(clip, DataZipCenter.DeCompressByGZIP(pressBuf)); AudioManager.Play(clip, false); } }
public void StartRecording() { SoundRecordCenter.TryStartRecording(); }