Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[Released] DFVoice - VoIP Plugin

Discussion in 'Assets and Asset Store' started by PhobicGunner, Jul 9, 2014.

  1. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    DFVoiceHeaderBadge.png
    DaikonForge Voice - Cross-platform VoIP Solution for Unity3D


    DaikonForge Voice is the premiere VoIP solution for Unity3D. Empower your multiplayer game with realtime voice chat, no matter what networking framework you use!
    • Built on the industry standard and battle-tested Speex codec, for high quality sound without consuming precious bandwidth
    • Works on almost all platforms supported by Unity.
    • No native plugins, so it works in Unity Indie!
    • Works with nearly any networking solution. If it can send bytes, you're good to go!
    • Incredibly easy to integrate - in most cases, just a few lines of glue code.
    • Highly modular component-based design means you can easily change and extend just about every part of DFVoice - add custom codecs, microphone input, audio output code, and more.
    DFVoice is designed to be highly flexible for every conceivable use case - no matter if you're making a multiplayer board game, an online FPS arena, or even a large open world survival MMO!

    DFVoice is available for purchase here: https://www.assetstore.unity3d.com/en/#!/content/19344
     
  2. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,240
    I purchased uSpeak a few months ago. Does this have any improvements? Is there any kind of discount for uSpeak purchasers?
     
  3. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    DFVoice has a number of improvements over USpeak, and is superior in nearly every respect. It has a cleaner design, it has better Speex integration than USpeak ever had, and it's gone through a more rigorous closed beta test.
    I've sent you a PM.
     
  4. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,240
    Thanks! We're using Mulaw since that's the only codec that's fast enough for iPad, in our testing. Are there improvements in that regard, or mainly to Speex?
     
  5. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    Hm, there weren't any particular performance improvements put into Speex (not intentionally, anyway).
    It's currently the only codec which ships with DFVoice, but it should be easy enough to plug in your own codec (potentially based on the MuLaw codec presented in USpeak) if Speex proves to be a performance issue.
     
  6. OutSpoken_Gaming

    OutSpoken_Gaming

    Joined:
    Oct 14, 2013
    Posts:
    90
    Where did uSpeak go?
     
  7. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    Taken down, along with all other MoPho' Games middleware. DFVoice is now being offered under the DaikonForge name.
     
  8. OutSpoken_Gaming

    OutSpoken_Gaming

    Joined:
    Oct 14, 2013
    Posts:
    90
    So I can pay for an asset and then just have it taken from me? Why not leave it for everyone who paid for it?
     
  9. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    Go sign up on the DaikonForge forums and PM me (MasaakiHosoi) with your USpeak Invoice Number. I can give you access to the DFVoice package download on our site.
     
  10. OutSpoken_Gaming

    OutSpoken_Gaming

    Joined:
    Oct 14, 2013
    Posts:
    90
    Well that works. Thank you.
     
  11. shkar-noori

    shkar-noori

    Joined:
    Jun 10, 2013
    Posts:
    833
    *Requires splash screen display. See included Readme.txt for details*

    what about a license without the splash screen?
    may I see this Readme.txt file before we buy it?
     
  12. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    Well, we don't have any plans to lift the splash screen requirement, but if you'd like (and actually I recommend this, just for better user experience) you can make the splash screen skippable.
     
    shkar-noori likes this.
  13. shkar-noori

    shkar-noori

    Joined:
    Jun 10, 2013
    Posts:
    833
    may I see the readme.txt file before we buy?
    so as you require this, do you have any animated video for the splash screen? or a unity tween animation? cause we already integrated some middleware libs and we haven't used any static splash, and they all provided their stuff, are you gonna provide anything?
     
  14. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    There's two variations of splash screen template included as scenes with the package - there's one with a black background, and one with a white background (with appropriate color changes as necessary).

    The readme.txt is as follows:

     
    shkar-noori likes this.
  15. shkar-noori

    shkar-noori

    Joined:
    Jun 10, 2013
    Posts:
    833
    thank you for the file, there is a high probability that we use this asset in our game, and it supports PS4 right?
     
  16. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    I don't know if it supports PS4. Not part of the Sony dev program, don't have a devkit to test on.
    It might work, if PS4 supports the Microphone class, although it wouldn't port the voice audio over headset if it is supported (it would port it through TV speakers).

    This could change, however - I'm starting development on a new game, and console support is definitely something I'm considering so I may apply to a few developer programs (Xbox, PS, and WiiU) so I could take the chance to investigate what might be required to get DFVoice running on those platforms (if possible).
     
  17. shkar-noori

    shkar-noori

    Joined:
    Jun 10, 2013
    Posts:
    833
    thank you, I will keep an eye on the thread, definitely gonna buy :D [PC, Mac, Linux]
     
  18. Brock-Bondo

    Brock-Bondo

    Joined:
    Sep 21, 2013
    Posts:
    18
    Just integrated DFVoice into my prototype game which uses Photon PUN+ for networking. Tested it with the macbook and an ipad mini retina and it works. Will do more integration and testing tomorrow. Thanks!
     
  19. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    Hard to believe Unity put this on the 24-hr sale with it under such a dark cloud (see store reviews and final comments in this thread http://forum.unity3d.com/threads/dfvoice-voip-closed-beta-invitation.248594/page-2 ). It gives further proof that Unity doesn't research the products before they go on sale, and can sometimes put a product on sale that looks like it has been abandoned. This particular plugin was already abandoned previously, as it was known as USpeak before being closed down and later revived as DFVoice.

    I would have been happy to buy a voice chat plugin today if it had a dev working to fix the performance issues, support Unity 5, and if there was no requirement on the part of the customer to give this plugin its own starting splash screen.

    I don't know how many people will research DFVoice before deciding to purchase today, and how many buyers may be asking for a refund tomorrow. But it would be nice if Unity would stop putting items on sale when the dev has moved on (or is about to abandon their project).

    If I've got the wrong picture on this, I certainly invite the developer or whoever else to correct my impression. Preferably before the sale ends. ;)
     
  20. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    So this is interesting... DFVoice does not run in Unity 5? I'll have to do some investigation here. I can't think of any reason it would not work, so that's very curious.

    As far as performance, pretty much all of the problem lies within the NSpeex codec, which generates tons of garbage. Previously, that was the only real choice for audio encoding, since there were no other solutions that would also work on Unity Free.
    EDIT: Well, there IS ADPCM which I've written before, but ADPCM is not very high quality (to give you an idea, it's the same audio encoding used in SNES games)

    However.

    Unity 5 Personal now supports native plugins just as Unity 5 Pro does. This means using native C/C++ solutions is now a possibility. Because of this, I might seriously consider integrating Opus, which is the successor to Speex, as an extra option or even as a total replacement.
     
  21. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    I don't mean to give you a hard time, PhobicGunner. I realize there are realities involved with making a plugin and supporting it that can make it difficult and unrewarding. And occurrences in real life can take a person away from what they initially proposed to do.

    But the impression I get is that you aren't making a commitment to DFVoice. Is that right?

    Or are you saying you are sticking with DFVoice and are definitely going to integrate Opus?
     
  22. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    Well, today I'm going to be at the very least ensuring it runs properly in Unity 5. After that, I'll be taking a look at getting this integrated with DFVoice. It looks very simple to use - looks like I use an OpusEncoder class to encode (just give it pcm samples and it spits out a byte array) and an OpusDecoder class (give it the byte array and it spits out pcm samples). I can see from peeking at the source on Github that it allocates new byte arrays, gets a pointer to it, and passes that to the native side. It shouldn't be that hard to integrate the same kind of byte array pool I'm already using in DFVoice, so that it simply fetches byte arrays from a pool and returns them to the pool, to reduce garbage generation.
    My first order of business will just be seeing if I can get Opus.NET to work as-is, without modifications. Then I'll make it use a byte array pool instead of allocating new byte arrays, and make sure that works properly.
    If I can get all of that done, I'll go ahead and submit an update for it.
     
    ZJP likes this.
  23. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    Sounds good! What about the splash screen requirement? Is that gone or is it still around?
     
  24. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    I think I'll just scrap all of the requirements. You don't actually need a splash screen as it is right now, you can also do a note in the credits, but I think I'll just get rid of those altogether. I'll probably leave the splash screen logo stuff in the package though, as a purely optional thing.
     
  25. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    I think that's a great idea, and it's good to have logo / product art available in case someone wants to give credit.

    I'm going to stop by the store, purchase this thing, cross my fingers, and hope it all goes well! :)
     
  26. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    OK, so there's at the moment a little bit of setup to get it fully working in Unity 5:

    - After importing, it will tell you that there's two places it uses a deprecated version of AudioClip.Create. Remove the "IsThreeDimensional" parameter from the two places it calls this function. The warnings will go away. Next, in Start, add the following line at the end:

    Code (csharp):
    1.  
    2. GetComponent<AudioSource>().spatialBlend = IsThreeDimensional ? 1f : 0f;
    3.  
    - Next, there's apparently an unused DLL in the project, NAudio. I thought I had deleted this, but it turns out I had not. This DLL may prevent you from compiling, so delete it. It will then show an error about a missing assembly. These errors all come from AudioUtils.cs, simply delete all of the "using NAudio.*" statements and the errors will go away.

    It should, at this point, work perfectly fine (it does on my end).
    My next order of business is going to be implementing Opus. After that's done, I'll submit an update of that together with the aforementioned fixes.
     
    hopeful likes this.
  27. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    Okay, I've downloaded the plugin into an empty project and am making the corrections ...

    First, if you don't select Unity's auto-correct feature when importing, there will be 4 errors in UnityNetworkVoiceController. If you choose the auto-correct these will go away.

    I deleted the NAudio file (in Plugins) and removed the "using NAudio" references at the top of AudioUtils (in Utils).

    UnityAudioPlayer (in IO) is the file that needs the two AudioClip line corrections and the new line at the end of Start.

    If I try to run the LocalDemo (in Examples) in the editor, I get two errors. I don't have a microphone set up right now, so possibly that is the problem.

    LocalDemo builds and runs without errors, but I guess I'll have to set up my headphone/mic in order to see what it does. ;)

    ---------

    Failed to get record driver caps. result=37 (An invalid parameter was passed to this function. )
    UnityEngine.Microphone:GetDeviceCaps(String, Int32&, Int32&)
    DaikonForge.VoIP.MicrophoneInputDevice:StartRecording() (at Assets/DFVoice/Scripts/IO/MicrophoneInputDevice.cs:54)
    DaikonForge.VoIP.VoiceControllerBase:Awake() (at Assets/DFVoice/Scripts/Components/VoiceControllerBase.cs:79)

    Failed to get record driver caps. result=37 (An invalid parameter was passed to this function. )
    UnityEngine.Microphone:Start(String, Boolean, Int32, Int32)
    DaikonForge.VoIP.MicrophoneInputDevice:StartRecording() (at Assets/DFVoice/Scripts/IO/MicrophoneInputDevice.cs:62)
    DaikonForge.VoIP.VoiceControllerBase:Awake() (at Assets/DFVoice/Scripts/Components/VoiceControllerBase.cs:79)
     
  28. Daniel-F

    Daniel-F

    Joined:
    May 15, 2013
    Posts:
    26
    If the Opus integration goes well and allows for low-bandwidth/low-resource-usage voice chat on mobile, that would be incredible useful.

    From the Opus FAQ, in case it's any help:

    If you're targeting an embedded/mobile platform, chances are the fixed-point build will be faster, so make sure you're using --enable-fixed-point or defining FIXED_POINT in the build system.

    Opus also has a complexity option that can trade quality for complexity. The default is highest quality and highest complexity. You can control this using OPUS_SET_COMPLEXITY() (see doc for details).​
     
    Last edited: Mar 24, 2015
    hopeful likes this.
  29. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Good news. Waiting for Opus tests. This will decide if i buy DFVoice or not.

    Btw, think to integrated the management of the channels.
    "- Support for up to 255 channels (multistream frames)"
     
    hopeful likes this.
  30. Daniel-F

    Daniel-F

    Joined:
    May 15, 2013
    Posts:
    26
    Actually, I think that Fixed Point information is probably outdated (or at least, relevant mostly to phones that won't run Unity games well anyway). It sounds as if most modern phones have hardware floating point support now.
     
  31. DeathKill2000

    DeathKill2000

    Joined:
    Dec 30, 2012
    Posts:
    1
    Hey Phobic, got your plugin and have integrated over Photon. Pretty, nice, work. I have a past with VoIP and know how hard this stuff is, just awesome what you're doing.

    For anyone interested - I found iOS performed just great when I turned off amplitude clipping, seemed to generate clicking when on.

    I know Opus is next on your list (holy cow that will be amazing) - just wondering if your current NSpeex implementation include that AEC (speex/speex_echo.h) ? This is a huge requirement for my app and would really want to enable it if I can so it works on all platforms.

    If this is something that needs to wait until Opus that would obviously been even better. Thanks for all your work on this, looking forward to the next release :)
     
    hopeful likes this.
  32. Hodgson_SDAS

    Hodgson_SDAS

    Joined:
    Apr 30, 2015
    Posts:
    123
    Any word on an update time frame?

    I'm also very interested in purchasing after fixes have been made for Unity 5 and Opus support.
     
  33. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    It would be good to hear where this project is at. :)
     
  34. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    +1
     
  35. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    Sorry about the silence, guys. I've been meaning to integrate Opus for a while now, but things have been hectic so I haven't had the time. I'll try to get it done over this weekend.
     
    Daniel-F and hopeful like this.
  36. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    Grr.
    Does anybody here know how to compile Opus as a DLL? It's a little embarrasing but I can't seem to do it. Tried compiling the included VS solution, tried copying the source code to a new project. Really, this has been the main roadblock to integrating Opus so far. Don't know if I'm being stupid or what >.<
     
  37. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
  38. Obsurveyor

    Obsurveyor

    Joined:
    Nov 22, 2012
    Posts:
    277
    What did you download? I couldn't find a VS solution for building libopus. You probably don't even need to, if you're using the Opus .NET wrapper, it builds fine in VS 2013 and includes the opus.dll.
     
  39. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    I would just use Opus .NET, but AFAIK the included DLL is at the very least 32-bit only, and I think x86-only as well. If I could compile the DLL myself I'd likely be able to make separate DLLs for each platform.
     
    hopeful likes this.
  40. Obsurveyor

    Obsurveyor

    Joined:
    Nov 22, 2012
    Posts:
    277
    Oh yeah, I forgot Unity is 64bit now. :)
     
  41. carmine

    carmine

    Joined:
    Jan 4, 2012
    Posts:
    394
    Is the asset store getting an update soon? It still says it requires splash screens. The latest update seems to be from 2014.

    Also, any timeline on the opus thing? Thanks!
     
  42. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    @PhobicGunner - If you're still hung up on compiling the DLL, I imagine you could PM one of the Unity peeps and find out whatever it is you need to know. If you're running into an undocumented problem, maybe there's an actual bug ...?
     
  43. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    Posted a question to the mailing list. The first response is a bit less than promising >.<

     
  44. ctjet

    ctjet

    Joined:
    Feb 16, 2014
    Posts:
    2
    @PhobicGunner - I just bought the plugin today, but I am a little confused. Do we still need splash screens or is that old news? Also, I am getting 3 errors,
    Assets/DFVoice/Scripts/Codec/SpeexCodec.cs(14,53): error CS0433: The imported type `NSpeex.BandMode' is defined multiple times
    Assets/DFVoice/Scripts/Codec/SpeexCodec.cs(12,39): error CS0433: The imported type `NSpeex.SpeexDecoder' is defined multiple times
    Assets/DFVoice/Scripts/Codec/SpeexCodec.cs(11,39): error CS0433: The imported type `NSpeex.SpeexEncoder' is defined multiple times

    And i dont see anything for them. Any Ideas? I am using unity 5
     
  45. ctjet

    ctjet

    Joined:
    Feb 16, 2014
    Posts:
    2
    NVM, I have it working, I deleted NAudio
     
  46. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    The splash screen requirement is old news - you don't need that anymore.
     
  47. carmine

    carmine

    Joined:
    Jan 4, 2012
    Posts:
    394
    OK.. so I purchased DFVoice.... I'm making a mumble client in Unity. Everything is working great so far and I'm up to the point of actually capturing mic data and sending it.

    I noticed DFVoice is relying on RPCs to send two fields "headers" and "rawdata".... however the mumble server just has a single byte[] payload. (with a sequence number before it).

    Look at this:
    https://media.readthedocs.org/pdf/mumble-protocol/latest/mumble-protocol.pdf

    I'm hoping you're into figuring this out. I'd be more than happy to give you my project file so far if you can wire this up, and figure it out.

    -Carmine
     
    Last edited: May 15, 2015
  48. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    Hm, DFVoice really wasn't designed to act as a client for third-party VoIP solutions. Its primary purpose is to be a self-integrated voice chat solution within Unity. There also aren't any plans to allow this in the future, either.

    That said, you could probably take a look at the source code for the Speex codec for an example of how to encode audio with the Speex codec.

    In other news, somebody on the Opus mailing list was kind enough to provide a version of the VS solution that compiles to a handy DLL! So I should be able to get started on that.
     
    hopeful likes this.
  49. carmine

    carmine

    Joined:
    Jan 4, 2012
    Posts:
    394
    I'm just using Mumble as a transport. Pretend I asked the same question but said, "How do I get your audio data to be just a byte array" for TCP.

    Also, can you point me to the opus.DLL?
     
  50. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    Ah, that changes things. So, in the case that you don't want/need to maintain compatibility with other clients, you could fetch a byte array from a pool which is sized to encompass both header and data, then copy the header and data arrays into that one. I would probably also stuff in a byte which stores the data offset. Something like this:

    Code (csharp):
    1.  
    2. byte[] raw = TempArray<byte>.Obtain( 1 + headers.length + rawData.length ); // fetch byte array from pool
    3. raw[ 0 ] = (byte)headers.length;
    4. System.Buffer.BlockCopy( raw, 1, headers, 0, headers.length );
    5. System.Buffer.BlockCopy( raw, headers.length + 1, rawData, 0, rawData.length );
    6.  
    7. // send message
    8.  
    9. TempArray<byte>.Release( raw ); // return byte array to pool
    10.  
    Then, on the receiving end:

    1.) First byte is size of headers
    2.) Next series of bytes will be headers
    3.) All remaining bytes after that are data payload.