You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
399 B
19 lines
399 B
2 years ago
|
using UnityEngine;
|
||
|
|
||
|
public class RecMicAudio : MonoBehaviour, IRecAudio
|
||
|
{
|
||
|
public int maxLength = 60;
|
||
|
AudioClip buffer;
|
||
|
|
||
|
public void StartRecording()
|
||
|
{
|
||
|
buffer = Microphone.Start(null, false, maxLength, AudioSettings.outputSampleRate);
|
||
|
}
|
||
|
|
||
|
public void StopRecording(string savePath)
|
||
|
{
|
||
|
Microphone.End(null);
|
||
|
SavWav.Save(savePath, buffer);
|
||
|
}
|
||
|
}
|