BananaHemic / Mumble-Unity

Performant Mumble Client For Unity3D
MIT License
77 stars 29 forks source link

If I want to use this project without unity, where can I start #39

Open dextercai opened 3 years ago

dextercai commented 3 years ago

If I want to use this project without unity, where can I start

BananaHemic commented 3 years ago

It shouldn't be too hard, the main thing would be changing the MumbleAudioPlayer.cs and MumbleMicrophone.cs to use whatever audio output/input api you're using. I'd start by bringing in the scripts one-by-one and fixing the compiler errors as they arise

dextercai commented 3 years ago

I have tried use the mumble.Net and mumbleSharp. However, the voice quality is very bad with some sharp noise. I hope this repo well work well. It is diffcult to create a buffered playback mechanism....

BananaHemic commented 3 years ago

Voice quality was very good for me, if you're not happy with it you can also increase the bandwidth

dextercai commented 3 years ago

It is still hard for me. Do you have any plan about a pure C# version?

BananaHemic commented 3 years ago

What part is giving you trouble? I'm not currently working on this repo, so I have no plans for a full C# version

dextercai commented 3 years ago

I tried to use the Unity 2019 to open this repo, but it doesnt work any more. Can this project opened with the personal licence?

BananaHemic commented 3 years ago

Yes

dextercai commented 3 years ago

What part is giving you trouble? I'm not currently working on this repo, so I have no plans for a full C# version

The biggest problem is the jitter buffer, I always get the bad sound when the client is playing audio from other clients. I check the implementation in the Mumble-Unity. Just put the audio buffer into the AudioSource, when each time Unity executive update function, the sound will played well and smoothly.

gro-ove commented 1 year ago

In case somebody would need an example solution, here is a Mumble-Unity working without Unity using NAudio 1.10.0. No changes to any of Scripts files have been made, it’s just a very basic reimplementation of UnityEngine namespace to get things to work. File Implementation/MumbleWrapper.cs is based on MumbleTester.cs. Mumble-Unityless.zip

BenWoodford commented 8 months ago

In case somebody would need an example solution, here is a Mumble-Unity working without Unity using NAudio 1.10.0. No changes to any of Scripts files have been made, it’s just a very basic reimplementation of UnityEngine namespace to get things to work. File Implementation/MumbleWrapper.cs is based on MumbleTester.cs. Mumble-Unityless.zip

You are a saint!

One thing I did find, your GetData method needs to wrap back to 0 as you end up going beyond the buffer length otherwise. In the for loop you need to do:

            for (var i = 0; i < pcmArray.Length; ++i)
            {
                if(i + offset >= _data.Length)
                {
                    offset = -i; // Start from 0.
                }

                pcmArray[i] = _data[i + offset];
            }

I was at a loss as I was struggling to get MumbleSharp working, but this has given me a fantastic starting point for implementing Mumble-Unity into my .NET application, so thanks!