- Home /
Sending Microphone Input over Network
There seems to be very little on the web regarding sending your mic input to another client over a network. This is a link I found on the unity forum.. The script rooch84 posted was pretty helpful and I have managed to setup the connection between the server and client, as well as successfully record/send the audio from the mic input to the other client.
This is great however the audio quality isn't very good; it makes your voice "sound like a robot".
When recording the mic input directly to an audio source and playing it back afterwards the sound is fine (without sending it through a network)..
So my question is does anyone know how to improve the script or where I can find a tutorial on this subject? The current script I am using seems to be:
• Recording the mic input to an audio source
• Reading the audio clip from the audio source component frame by frame
• and finally sending that data during each frame through an RPC to the other client
This does leave the audio on the other clients side sounding "choppy" though :( Has anyone had this problem before and what did you do to fix it?
If you know more about this it's be great if you contribute because there really doesn't seem to be much on this subject on the web yet - Perhaps someone would like to make a tutorial ;)
Thanks for the help!
Have you checked locally whether playing back the encoded/decoded byte array is crackly?
Oh good idea, I hadn't thought of that yet :) I've tested the mic but that was without the encoding/decoding.. I will test this without the network and see what the quality is like when playing back on the same device.
Ok, I turned the RPC function into a regular function and called it each frame.. The audio quality is slightly improved, however it still is more crackly than when recording a full audio clip with the mic and then playing it back.
Is there a way to increase the amount of times that the data from the audio clip is sampled to create a less crackly recording?
P.s. On a side note; hertz is a measurement for frequency (i.e. how many times per second), but what exactly does it mean if the frequency is at 44100khz?
It can't be how many times per second my computer is reading the data from my mic. I am guessing the frequency is referring to how quickly the recorded sound waves are vibrating i.e. the pitch.
Answer by Ahisical · Feb 28, 2013 at 04:19 PM
Check out the asset store, there is a new package that allows speech over network.
Your answer
Follow this Question
Related Questions
AudioClip sync across a network: help needed! 0 Answers
Playing Audio Over Network -1 Answers
Get the device audio volume 0 Answers
Network Audio. Why doesnt max distance work over network? 0 Answers