Skip to content

Mukarillo/UnityAudioRecorder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UnityAudioRecorder

Multi-platform helper to record audio.

How to use

you can find a pratical example inside this repository in Main scene

1 - Create a new instance of AudioRecorder

public class Exemple : MonoBehaviour
{
    private AudioRecorder recorder = new AudioRecorder();
}

2 - Call AudioRecorder.StartRecording with the callback and maximum length

public class Exemple : MonoBehaviour
{
    private AudioRecorder recorder = new AudioRecorder();
    
    public void Record()
    {
      recorder.StartRecording(OnFinishRecording, 20);
    }
    
    private void OnFinishRecording(AudioClip clip)
    {
      //clip is the recorded clip
    }
}

3 - If you want to end the record, just call AudioRecorder.EndRecording. It will invoke the callback that was set in the StartRecording method.

AudioRecorder public overview

Properties

AudioRecorder.isRecording

  • Description: Returns true if is recording an audio.

Methods

AudioRecorder.StartRecording

  • Description: Starts recording using the default microphone.

  • Parameters :

name type description
completeCallback UnityAction<AudioClip> Callback to be called when the recording is done.
maxClipLenth int Maximum size of the clip in seconds.

AudioRecorder.StopRecording

  • Description: Stops recording and do not callback.

AudioRecorder.EndRecording

  • Description: Stops recording and callback.

External tools

-UnityWav - by DeadlyFingers
-SavWav - by DarkTable