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.
18 lines
399 B
18 lines
399 B
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); |
|
} |
|
}
|
|
|