Code Monkey home page Code Monkey logo

univoice's Introduction

UniVoice

A Peer to Peer Voice Over IP (VoIP) solution for Unity

Intro

UniVoice uses UniMic to capture audio and AirPeer to form WebRTC based peer to peer connections between which audio data can be exchanged.

Usage

Basic

  • Voice.New(AudioSource src) to create a new Voice instance. src is the AudioSource component that will play the incoming audio.
var voice = Voice.New(GetComponent<AudioSource>());
  • Voice.Create(string name, Action<bool> callback) creates a new room for voice chat. name should be unique (globally), callback is true if the room was created successfully, else false.
voice.Create("a3b4cd", success => Debug.Log("Room create success: " + success));
  • Voice.Join(string name, Action<bool> callback) attempts to join an existing room. name should be the one to be joined. callback is true if the join was successful, else false.
voice.Join("a3b4cd", success => Debug.Log("Room join success: " + success));
  • Voice.OnJoin(ConnectionId id) event fired on a Voice instance that is serving as a host (ie. .Create was called on it) everytime a peer joins the room

  • Voice.OnLeave(ConnectionId id) event fired on a Voice instance that is serving as a host (ie. .Create was called on it) everytime a peer leaves the room

  • Voice.OnSendVoiceSegment(int index, float[] segment) event fired everytime an audio segment was sent over the network. segment is the float representation of the audio and index represents the index of the segment. Eg. The first segment is indexed as 0

  • Voice.OnGetVoiceSegment(int index, float[] segment) event fired everytime an audio segment is received over the network. segment is the float representation of the audio and index represents the index of the segment. Eg. The first segment is indexed as 0

Known Issues

  • Room creation/join fails. This happens less often on mobile data (as compared to WiFi).
  • More

Contact

@www
@github

univoice's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.