com.adrenak.univoice 4.1.1 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -9
- package/Runtime/Adrenak.UniVoice.Runtime.asmdef +4 -4
- package/Runtime/Impl/Filters/RNNoise/RNNoiseFilter.cs +28 -0
- package/Runtime/Impl/Filters/RNNoise/RNNoiseFilter.cs.meta +11 -0
- package/{Samples.meta → Runtime/Impl/Filters/RNNoise.meta} +1 -1
- package/Runtime/Impl/Networks/Mirror/MirrorClient.cs +1 -1
- package/Runtime/Impl/Networks/Mirror/MirrorMessage.cs +1 -1
- package/Runtime/Impl/Networks/Mirror/MirrorMessageTags.cs +1 -1
- package/Runtime/Impl/Networks/Mirror/MirrorModeObserver.cs +1 -1
- package/Runtime/Impl/Networks/Mirror/MirrorServer.cs +2 -2
- package/{Samples → Samples~}/Group Chat Sample/Scripts/GroupVoiceCallMirrorSample.cs +1 -1
- package/package.json +1 -1
- /package/{Samples → Samples~}/Group Chat Sample/Prefabs/Mic Toggle.prefab +0 -0
- /package/{Samples → Samples~}/Group Chat Sample/Prefabs/Mic Toggle.prefab.meta +0 -0
- /package/{Samples → Samples~}/Group Chat Sample/Prefabs/Peer View.prefab +0 -0
- /package/{Samples → Samples~}/Group Chat Sample/Prefabs/Peer View.prefab.meta +0 -0
- /package/{Samples → Samples~}/Group Chat Sample/Prefabs.meta +0 -0
- /package/{Samples → Samples~}/Group Chat Sample/Scenes/GroupVoiceCallSample-Mirror.unity +0 -0
- /package/{Samples → Samples~}/Group Chat Sample/Scenes/GroupVoiceCallSample-Mirror.unity.meta +0 -0
- /package/{Samples → Samples~}/Group Chat Sample/Scenes.meta +0 -0
- /package/{Samples → Samples~}/Group Chat Sample/Scripts/GroupVoiceCallMirrorSample.cs.meta +0 -0
- /package/{Samples → Samples~}/Group Chat Sample/Scripts/PeerView.cs +0 -0
- /package/{Samples → Samples~}/Group Chat Sample/Scripts/PeerView.cs.meta +0 -0
- /package/{Samples → Samples~}/Group Chat Sample/Scripts.meta +0 -0
- /package/{Samples → Samples~}/Group Chat Sample/Sprites/mic.png +0 -0
- /package/{Samples → Samples~}/Group Chat Sample/Sprites/mic.png.meta +0 -0
- /package/{Samples → Samples~}/Group Chat Sample/Sprites/off.png +0 -0
- /package/{Samples → Samples~}/Group Chat Sample/Sprites/off.png.meta +0 -0
- /package/{Samples → Samples~}/Group Chat Sample/Sprites/on.png +0 -0
- /package/{Samples → Samples~}/Group Chat Sample/Sprites/on.png.meta +0 -0
- /package/{Samples → Samples~}/Group Chat Sample/Sprites/speaker.png +0 -0
- /package/{Samples → Samples~}/Group Chat Sample/Sprites/speaker.png.meta +0 -0
- /package/{Samples → Samples~}/Group Chat Sample/Sprites.meta +0 -0
- /package/{Samples → Samples~}/Group Chat Sample.meta +0 -0
package/README.md
CHANGED
|
@@ -4,16 +4,30 @@ UniVoice is a voice chat/VoIP solution for Unity.
|
|
|
4
4
|
Some features of UniVoice:
|
|
5
5
|
- 👥 Group voice chat. Multiple peers can join a chatroom and exchange audio.
|
|
6
6
|
|
|
7
|
-
- ⚙ Peer specific settings. Don't want to listen to a peer? Mute them. Don't want someone listening to you?
|
|
7
|
+
- ⚙ Peer specific settings. Don't want to listen to a peer? Mute them. Don't want someone listening to you? Deafen them.
|
|
8
8
|
|
|
9
|
-
- 🎨 Customize your audio input, output and networking
|
|
10
|
-
*
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
- 🎨 Customize your audio input, output and networking layers.
|
|
10
|
+
* 🌐 __Configurable Network__:
|
|
11
|
+
- UniVoice is networking agnostic. Implement the `IAudioClient` and `IAudioServer` interfaces using the networking plugin of your choice to have it send audio data over any networking solution.
|
|
12
|
+
- Built-in support for:
|
|
13
|
+
- Mirror networking.
|
|
13
14
|
|
|
14
|
-
*
|
|
15
|
+
* 🎤 __Configurable Audio Input__:
|
|
16
|
+
- UniVoice is audio input agnostic. You can change the source of outgoing audio by implementing the `IAudioInput` interface.
|
|
17
|
+
- Built-in support for:
|
|
18
|
+
- Capturing Mic audio as device input.
|
|
19
|
+
|
|
20
|
+
* 🔊 __Configurable Audio Output__:
|
|
21
|
+
- UniVoice is audio output agnostic. You can divert incoming audio to anywhere you want by implementing the `IAudioOutput` interface.
|
|
22
|
+
- Built-in support for:
|
|
23
|
+
- Playing incoming audio using Unity AudioSource.
|
|
15
24
|
|
|
16
|
-
* ✏️ __Audio Filters__:
|
|
25
|
+
* ✏️ __Audio Filters__:
|
|
26
|
+
- Modify outgoing and incoming audio by implementing the `IAudioFilter` interface.
|
|
27
|
+
- Built-in support for:
|
|
28
|
+
- Opus (Concentus) encoding & decoding.
|
|
29
|
+
- RNNoise based noise removal.
|
|
30
|
+
- Gaussian blurring for minor denoising.
|
|
17
31
|
|
|
18
32
|
## Installation
|
|
19
33
|
⚠️ [OpenUPM](https://openupm.com/packages/com.adrenak.univoice/?subPage=versions) may not have up to date releases. Install using NPM registry instead 👇
|
|
@@ -37,12 +51,12 @@ Ensure you have the NPM registry in the `manifest.json` file of your Unity proje
|
|
|
37
51
|
Then add `com.adrenak.univoice:x.y.z` to the `dependencies` in your `manifest.json` file (where x.y.z is the version you wish to install). The list of versions is available on [the UniVoice NPM page](https://www.npmjs.com/package/com.adrenak.univoice?activeTab=versions).
|
|
38
52
|
|
|
39
53
|
## Docs
|
|
40
|
-
|
|
54
|
+
API reference is available here: http://www.vatsalambastha.com/univoice
|
|
41
55
|
|
|
42
56
|
## Samples
|
|
43
57
|
This repository contains a sample scene for the Mirror network, which is the best place to see how UniVoice can be integrated into your project.
|
|
44
58
|
|
|
45
|
-
|
|
59
|
+
> The sample relies on Mirror networking to work. Follow the instructions below for enabling Mirror in your project before trying it out.
|
|
46
60
|
|
|
47
61
|
## Dependencies
|
|
48
62
|
[com.adrenak.brw](https://www.github.com/adrenak/brw) for reading and writing messages for communication. See `MirrorServer.cs` and `MirrorClient.cs` where they're used.
|
|
@@ -51,6 +65,19 @@ To try the sample, import Mirror and add the `UNIVOICE_MIRROR_NETWORK` compilati
|
|
|
51
65
|
|
|
52
66
|
[com.adrenak.concentus-unity](https://www.github.com/adrenak/concentus-unity) for Opus encoding and decoding. See `ConcentusEncodeFilter.cs` and `ConcentusDecodeFilter.cs` for usage
|
|
53
67
|
|
|
68
|
+
## Activating non-packaged dependencies
|
|
69
|
+
UniVoice includes and installs the dependencies mentioned above along with itself. The following implementations are available out of the box when you install it:
|
|
70
|
+
* Opus encoding/decoding filter (via Contentus-Unity)
|
|
71
|
+
* GaussianAudioBlur filter (plain C#, no dependencies used)
|
|
72
|
+
* Mic audio capture input (via UniMic)
|
|
73
|
+
* AudioSource based playback output (via UniMic)
|
|
74
|
+
|
|
75
|
+
But the following implementations are based on dependencies that you have to install and enable via compilation symbols as they are _not_ UniVoice dependencies and _don't_ get installed along with UniVoice. This is because they are either third party modules or based on native libraries (not plain C#) that can pose build issues.
|
|
76
|
+
* Mirror network:
|
|
77
|
+
* To enable, ensure the Mirror package is in your project and add `UNIVOICE_NETWORK_MIRROR` to activate it
|
|
78
|
+
* RNNoise Noise removal filter:
|
|
79
|
+
* To enable, ensure the [RNNoise4Unity](https://github.com/adrenak/RNNoise4Unity) package is in your project and add `UNIVOICE_FILTER_RNNOISE4UNITY` to activate it
|
|
80
|
+
|
|
54
81
|
## License and Support
|
|
55
82
|
This project is under the [MIT license](https://github.com/adrenak/univoice/blob/master/LICENSE).
|
|
56
83
|
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
"name": "Adrenak.UniVoice.Runtime",
|
|
3
3
|
"rootNamespace": "",
|
|
4
4
|
"references": [
|
|
5
|
-
"GUID:f87ecb857e752164ab814a3de8eb0262",
|
|
6
5
|
"GUID:1f776cd02c03a7b4280b6b649d7758e2",
|
|
7
|
-
"GUID:
|
|
8
|
-
"GUID:
|
|
9
|
-
"GUID:
|
|
6
|
+
"GUID:f87ecb857e752164ab814a3de8eb0262",
|
|
7
|
+
"GUID:b118fd5a40c85ad4e9b38e8c4a42bbb1",
|
|
8
|
+
"GUID:4653938bfdb5cf8409322ce17219d5f7",
|
|
9
|
+
"GUID:30817c1a0e6d646d99c048fc403f5979"
|
|
10
10
|
],
|
|
11
11
|
"includePlatforms": [],
|
|
12
12
|
"excludePlatforms": [],
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#if UNIVOICE_FILTER_RNNOISE4UNITY
|
|
2
|
+
using System;
|
|
3
|
+
|
|
4
|
+
using Adrenak.RNNoise4Unity;
|
|
5
|
+
|
|
6
|
+
namespace Adrenak.UniVoice.Filters {
|
|
7
|
+
public class RNNoiseFilter : IAudioFilter {
|
|
8
|
+
readonly Denoiser denoiser;
|
|
9
|
+
|
|
10
|
+
public RNNoiseFilter() {
|
|
11
|
+
denoiser = new Denoiser();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
public AudioFrame Run(AudioFrame input) {
|
|
15
|
+
var data = Utils.Bytes.BytesToFloats(input.samples);
|
|
16
|
+
|
|
17
|
+
denoiser.Denoise(data.AsSpan(), false);
|
|
18
|
+
|
|
19
|
+
return new AudioFrame {
|
|
20
|
+
timestamp = input.timestamp,
|
|
21
|
+
channelCount = input.channelCount,
|
|
22
|
+
frequency = input.frequency,
|
|
23
|
+
samples = Utils.Bytes.FloatsToBytes(data)
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
#endif
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// https://github.com/MirrorNetworking/Mirror/releases/tag/v89.11.0
|
|
4
4
|
// OnServerConnected no longer seems to work?
|
|
5
5
|
|
|
6
|
-
#if UNIVOICE_MIRROR_NETWORK
|
|
6
|
+
#if UNIVOICE_MIRROR_NETWORK || UNIVOICE_NETWORK_MIRROR
|
|
7
7
|
using System;
|
|
8
8
|
using System.Linq;
|
|
9
9
|
using System.Threading.Tasks;
|
|
@@ -62,7 +62,7 @@ namespace Adrenak.UniVoice.Networks {
|
|
|
62
62
|
NetworkManager.singleton.transport.OnServerConnectedWithAddress -= OnServerConnected;
|
|
63
63
|
#else
|
|
64
64
|
NetworkManager.singleton.transport.OnServerConnected -= OnServerConnected;
|
|
65
|
-
#endif
|
|
65
|
+
#endif
|
|
66
66
|
NetworkManager.singleton.transport.OnServerDisconnected -= OnServerDisconnected;
|
|
67
67
|
}
|
|
68
68
|
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{Samples → Samples~}/Group Chat Sample/Scenes/GroupVoiceCallSample-Mirror.unity.meta
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|