private void SettingParameter(AudioClip clip) { _parameter.config.SetLanguageCode(_code); _parameter.config.sampleRateHertz = clip.frequency; _parameter.config.audioChannelCount = clip.channels; var bytes = AudioConverter.CreateLinear16(clip); _parameter.audio.content = Convert.ToBase64String(bytes); }
public void RecordEnd() { var data = _audioRecorder.End(); CurrentRecordClip = AudioClip.Create("Record Clip", data.Length, _audioRecorder.RecordingClip.channels, _audioRecorder.RecordingClip.frequency, false); CurrentRecordClip.SetData(data, 0); Debug.Log("Clip Length : " + CurrentRecordClip.length); if (string.IsNullOrEmpty(_saveRecordAudioPath) == false) { if (_saveRecordAudioPath.EndsWith(SaveRecordAudioExtension, true, CultureInfo.CurrentCulture) == false) { _saveRecordAudioPath += SaveRecordAudioExtension; } File.WriteAllBytes(_saveRecordAudioPath, AudioConverter.CreateLinear16(CurrentRecordClip)); Debug.Log("Save Audio : " + _saveRecordAudioPath); } }