Skip to content

Mukarillo/UnityAudioRecorder

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

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