Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: mitchelq on May 11, 2014, 01:05:10 PM

Title: Recording audio (from mic) with playmaker <SOLVED>
Post by: mitchelq on May 11, 2014, 01:05:10 PM
Hello,

Is it possible to record audio (if someone pushes the record audio button) and then play it when he pushes another button with playmaker (like a voicerecorder)? Or will I need an asset to do this?

If I do need an asset can someone point me in the right direction?

If not, how can I do this with playmaker?

Also, is it then possible to save the sound so it can be used after a restart?

Thanks in advance!

Best regards,

Mitchel
Title: Re: Recording audio (from mic) with playmaker
Post by: mitchelq on May 16, 2014, 04:01:50 PM
Any ideas?
Title: Re: Recording audio (from mic) with playmaker
Post by: Alex Chouls on May 16, 2014, 10:37:11 PM
It looks like there is a Microphone class in Unity:
http://docs.unity3d.com/Documentation/ScriptReference/Microphone.html

However the CallMethod action doesn't support static methods yet, so you will need custom actions to call these methods.

Saving audio clips is a little harder. I found some info here:
http://answers.unity3d.com/questions/420477/recordsaveplayback-of-audio-clips-how-to.html

The article links to a script that should save a recorded audio clip, but I didn't dig too deeply into it.

I haven't worked with the Microphone class before, but I'll try to find some time to look into these custom actions...
Title: Re: Recording audio (from mic) with playmaker
Post by: Alex Chouls on May 17, 2014, 02:34:42 PM
Just noticed that Jean made microphone actions:
http://hutonggames.com/playmakerforum/index.php?topic=1771.msg7759#msg7759

Also we just released a new Call Static Method action that will help you call static methods without needing custom actions:
http://hutonggames.com/playmakerforum/index.php?topic=7340.0

However, if custom actions exist I recommend using those since the UI will generally be nicer...
Title: Re: Recording audio (from mic) with playmaker
Post by: mitchelq on May 21, 2014, 03:51:43 PM
Oh wow, I searched the forum but forgot to check the wiki  :o

Thanks a lot!