- Home /
How can I record a short audio clip, then send that to another player in a multiplayer asynchronous game?
I'm working on a turn-based, asynchronous "board game" app that involves a player recording a sound, then "sending" that to a second player(s) for their evaluation and scoring.
It's not a live streaming audio kind of play, so there are a number of audio options/assets I've seen that seem to not accomplish this asynchronous functioning at all.
Would love to answer any clarifying questions to figure out if this is possible. And I may be asking to do something "simple" this is not simple at all! :)
Not 100% unity can handle this, but my approach (Something I did awhile back and lost the project and had awful sound quality) was to use the microphone to record and play into a audioSource. Then I played that on one computer and could hear it (poorly) on another across the network. Not sure on either unity's improved on this hack yet, but hopeful it would be better than it was before for me.
Answer by eli_grinline · Jan 02, 2019 at 10:50 PM
@JxWolfe ...hey thanks a lot for the quick reply! :) I have been coming across this as maybe being beyond current Unity capability. It just seems surprising that one can't somehow "tap into" or be using mobile devices on-board audio sending functions through Unity. I know this an oversimplification of it (I'm a designer/animator, my son is the coder!) so I'm speaking from major ignorance! But even some of the audio networking assets I'm seeing almost seem BIGGER than this need and over shoot it...yet we can't find a work around using them. For example, we can do "live chat" and streaming audio across the world through multiplayer servers...but we can't record and store a 1-2 sec soundbite for a player to be notified of, listen to, then return a score on their own time back to Player A? Anyway...that's the idea, and by golly I bet there's a way! :) ...thanks again!
well, looking on asset store there appears to be some free voice systems, here's one that looks good, however I've never used it so I can't say too much: https://assetstore.unity.com/packages/tools/audio/photon-voice-2-130518
Yes, we actually talked to the guy who develops Photon and he said this doesn't do what we need it to do. Which is so puzzling...because again, taking into consideration my severe lack of "how this all really works"...it feels like it should be "easier" than full voice chat, live audio stuff!
But I ain't giving up yet! :D If you come across anything hopeful, please feel free to post here like you did with Photon. I'm super grateful to anyone with assets and ideas. It may expose a solid solve we haven't thought of. And/or help someone else's search! You rock!
Just wanted to update a possible solution given to me by a rockstar Unity game developer! We haven't tried this yet, but it was really cool of him to respond so quickly. He posted: You can record audio input with https://docs.unity3d.com/ScriptReference/$$anonymous$$icrophone.Start.html Serialize with GetData. Send via something like TCP/UDP socket. Deserialize with SetData. Then you can play it.
sounds like that would work... I remember using $$anonymous$$icrophone.Start on the old game... it does record input. And I believe that serializing with GetData would work. Thanks for that info!
Your answer
![](https://koobas.hobune.stream/wayback/20220612184952im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
asynchronous sound 0 Answers
How to make multiplayer character say out loud the user input? 1 Answer
AudioClip.Create() 1 Answer
Play audio clip from where it left 0 Answers
[iOS] Streaming audio with loop 1 Answer