Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
5
Question by thornekey · Mar 04, 2014 at 06:10 AM · multiplayerchat

Multiplayer Voice Chat?

How would i go about implementing some sort of Audio based chat for multiplayer?

assuming id need a audio source coming from each player joined.

then somehow linking it to a mic.. hmm

any clues?

Comment
Add comment · Show 8
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image newfinalflashers · Mar 04, 2014 at 07:26 AM 1
Share

try this:

http://docs.unity3d.com/Documentation/ScriptReference/$$anonymous$$icrophone.html

http://docs.unity3d.com/Documentation/ScriptReference/Network.html

avatar image thornekey newfinalflashers · Mar 04, 2014 at 09:21 AM 0
Share

thats very brief. i understand unity networking. and i know that the mic can be used. but making it so that the players mic is a streamed live and heard dynamically is a bit difficult.

avatar image AlucardJay newfinalflashers · Mar 04, 2014 at 02:11 PM 0
Share

Agreed. This answer does not help to provide a solution to the problem. Converting to comment.

avatar image thornekey · Mar 05, 2014 at 11:13 AM 0
Share

do you have any clue alucardj?

avatar image AlucardJay · Mar 05, 2014 at 11:20 AM 0
Share

No, sorry. Also curious so am following this question. I mean sure, $$anonymous$$icrophone.Start starts recording with built-in $$anonymous$$icrophone and plays the recorded audio right away, but how to play and sync that audio across all networked clients?

avatar image thornekey · Apr 14, 2014 at 03:07 AM 0
Share

perhaps. I could try that :)

avatar image worldofwars1 · Apr 17, 2014 at 12:11 PM 0
Share

I haven't been able to play around with it too much, I've been working with a database that's being a pain. xD If I find out a specific way to set it up I'll post back what I find.

Show more comments

2 Replies

· Add your reply
  • Sort: 
avatar image
4

Answer by worldofwars1 · Apr 13, 2014 at 02:29 AM

I figure you'd start it off like this

 @RPC
 function PlayMicrophone() 
 {
         audio.clip = Microphone.Start("", true, 100, 44100);
         audio.loop = true;
         while (!(Microphone.GetPosition("") > 0)){}
         audio.Play();
 }

Then add it to a function thats starts a server or when a player joins a server.

 function OnServerInitialized() 
 {
     networkView.RPC("PlayMicrophone", RPCMode.Others);
 }
 
 function OnConnectedToServer()
 {
     networkView.RPC("PlayMicrophone", RPCMode.Others);
 }

Something like that anyways.

Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image danny7 · Jan 06, 2016 at 06:05 AM 0
Share

Hey @worldofwars1 I've tried out your script, but I only here myself echo though the same application, others can't here me. Have any clues? Thanks.

avatar image Zoelovezle danny7 · Jan 06, 2016 at 10:39 AM -1
Share

@danny7 You should convert this to new Unity network , @worldofwars1 you should not answer with obsolete answers.

avatar image Dave-Carlile Zoelovezle · Jan 07, 2016 at 05:18 PM 1
Share

Um... the answer was from 2 years ago. What was obsolete about it then?

avatar image worldofwars1 · Jan 07, 2016 at 12:34 AM 0
Share

@danny7 Yeah this was never meant to be a complete answer only a push in the right direction and it's probably changed some you'll have to do some searching. @Zoelovezle Not really sure if this was obsolete 2 years ago, but hey what do I know. Also would like to note that I originally put this as a comment on the OP not as an answer. =p

avatar image
1

Answer by newfinalflashers · Jan 07, 2016 at 02:26 AM

After a year of game development I have come to one conclusion. Unity does not directly provide the tools for voice chat. You have to use external software, plugins, extensions, or manually edit the coding unity allows you to edit which is extremely hard:(. Voice chat (I don't think is on the asset store anymore) and uspeak are two of the only voice chat systems on the asset store and both use plugins. The problem with worldowar1's script is that the audio clip he is attempting to play over the network is not available over the network meaning that you may have the audio on your instance to play, but if somebody else is playing elsewhere that audio clip that you are telling them to play via rpc they will not have in their instance which avoids the whole entire problems and difficulties of voice chat. This explains you hearing yourself because you have the audio, and explains others not hearing the audio playing because they do not have YOUR clip that you recorded which can even cause others instance of the game to crash. If you can somehow modify a base audio recording using integers floats strings or booleans( super complex and maybe not worth time effort and having a huge cost to the efficiency of your game) from your recording like a whole nother language. Pretty much changing a rock into dust sending it and putting the dust particles back together. Rpcs can only send floats integers strings and booleans not audio recordings. If you want to do recording unless you are a boss scientist/mathematician and figure out away to convert speech into numbers or text send all that to somebody else without lag effecting your game and for them to convert those numbers slash text back into speech it is not doable through the given tools unity gives you unless you edit the editor code(hard). I highly suggest looking into plugins and using another software to do this. If you want to try my conversion method I will be happy to join you it will be a good science fair experiment for me. I can go a lot deeper into this but I just want to give you a basic level. But this is not simple stuff.thanks

Comment
Add comment · Show 6 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image worldofwars1 · Jan 07, 2016 at 05:01 PM 0
Share

So in other words (if I remember right you can use system api's in unity) you would take the pcm data from the recorded audio of one client, send the values over unitys networking and reconstruct it on another client? =p Trying to get a better picture of what you're trying to explain. Also you got me curious.

avatar image newfinalflashers worldofwars1 · Jan 07, 2016 at 06:23 PM 0
Share

Basically and i would love to try this with you if interested for my high school science fair project. Imagine this system with video chat or something more complex like defor$$anonymous$$g meshes. It is very possible though.but will not be efficient for sure.

avatar image worldofwars1 newfinalflashers · Jan 08, 2016 at 06:48 PM 0
Share

Sure it sounds like a fun experiment and could be useful to the unity community. ;3

Show more comments
avatar image newfinalflashers worldofwars1 · Jan 11, 2016 at 01:27 AM 0
Share

Sure email me at newfinalflashers@yahoo.com, then we will start a google docs form and post code/communicate via that.

avatar image Dave-Carlile · Jan 07, 2016 at 05:25 PM 1
Share

http://stackoverflow.com/questions/31171714/how-to-stream-live-audio-via-microphone-in-unity3d

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

29 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiplayer " killed " messages 1 Answer

Chat: new messages, bottom of scrollview? 2 Answers

How can I create a simple chat system for my multiplayer game? 1 Answer

Unity UNET Multiplayer Chatroom - (Need Help With 1 Line) 1 Answer

PlayerName in Chat Window 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges