Git Product home page Git Product logo

unityaudiorecorder's Introduction

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

unityaudiorecorder's People

Contributors

mukarillo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

unityaudiorecorder's Issues

How to test this in Unity Editor?

Thanks for sharing this code. I try to run it, but in the Unity Editor run, if I pressed the "button" to record, it just flashes and does not seem to record anything? But if I build and run, then it will ask me for permission to use the microphone, then it works well on a my MacBook.

Is there something I need to give permission to run on the Unity Editor itself?

Thanks

David

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.