Answer the question
In order to leave comments, you need to log in
Unity how to record audio and play like in Talking Tom?
Hello! I want to create an app like "Talking Tom".
I need the Recording to stop if there is no sound, say 2 seconds. I have a 10 second timer. When I say, the recording starts and lasts for 10 seconds and then plays. Even if I stopped saying something, it records and reproduces empty silence. How to make the recording stop if the sound stops coming for 2 seconds. and what I said was reproduced in N number of seconds.
The maximum recording time I want is 10 seconds.
On one forum, I was offered the following solution. But I don't know how to do it.
"Record several times for 2 seconds and that's it. You check if there was any sound in the last recording. If there was, you leave it and still record it. If not, delete it. Then you connect and play back"
And another problem is poor audibility. You have to speak very loudly for the recording to start. When the recording is played back, the sound is very weak. In the "Talking Tom" application, for example, you do not need to speak so loudly for the recording to start. And when the recording is played the sound is also good.
Here is the script that I am using.
on the 1st photo script GameConstants. on the other 4 pictures, the GameControler script. I just couldn’t screen everything, so I posted it in parts.
I hope legible.
I can give you a full link to the project if needed.
Answer the question
In order to leave comments, you need to log in
I suppose that you need to play around with the SoundThreshold constant, as its name suggests.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question