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.
Files changed (34) hide show
  1. package/README.md +36 -9
  2. package/Runtime/Adrenak.UniVoice.Runtime.asmdef +4 -4
  3. package/Runtime/Impl/Filters/RNNoise/RNNoiseFilter.cs +28 -0
  4. package/Runtime/Impl/Filters/RNNoise/RNNoiseFilter.cs.meta +11 -0
  5. package/{Samples.meta → Runtime/Impl/Filters/RNNoise.meta} +1 -1
  6. package/Runtime/Impl/Networks/Mirror/MirrorClient.cs +1 -1
  7. package/Runtime/Impl/Networks/Mirror/MirrorMessage.cs +1 -1
  8. package/Runtime/Impl/Networks/Mirror/MirrorMessageTags.cs +1 -1
  9. package/Runtime/Impl/Networks/Mirror/MirrorModeObserver.cs +1 -1
  10. package/Runtime/Impl/Networks/Mirror/MirrorServer.cs +2 -2
  11. package/{Samples → Samples~}/Group Chat Sample/Scripts/GroupVoiceCallMirrorSample.cs +1 -1
  12. package/package.json +1 -1
  13. /package/{Samples → Samples~}/Group Chat Sample/Prefabs/Mic Toggle.prefab +0 -0
  14. /package/{Samples → Samples~}/Group Chat Sample/Prefabs/Mic Toggle.prefab.meta +0 -0
  15. /package/{Samples → Samples~}/Group Chat Sample/Prefabs/Peer View.prefab +0 -0
  16. /package/{Samples → Samples~}/Group Chat Sample/Prefabs/Peer View.prefab.meta +0 -0
  17. /package/{Samples → Samples~}/Group Chat Sample/Prefabs.meta +0 -0
  18. /package/{Samples → Samples~}/Group Chat Sample/Scenes/GroupVoiceCallSample-Mirror.unity +0 -0
  19. /package/{Samples → Samples~}/Group Chat Sample/Scenes/GroupVoiceCallSample-Mirror.unity.meta +0 -0
  20. /package/{Samples → Samples~}/Group Chat Sample/Scenes.meta +0 -0
  21. /package/{Samples → Samples~}/Group Chat Sample/Scripts/GroupVoiceCallMirrorSample.cs.meta +0 -0
  22. /package/{Samples → Samples~}/Group Chat Sample/Scripts/PeerView.cs +0 -0
  23. /package/{Samples → Samples~}/Group Chat Sample/Scripts/PeerView.cs.meta +0 -0
  24. /package/{Samples → Samples~}/Group Chat Sample/Scripts.meta +0 -0
  25. /package/{Samples → Samples~}/Group Chat Sample/Sprites/mic.png +0 -0
  26. /package/{Samples → Samples~}/Group Chat Sample/Sprites/mic.png.meta +0 -0
  27. /package/{Samples → Samples~}/Group Chat Sample/Sprites/off.png +0 -0
  28. /package/{Samples → Samples~}/Group Chat Sample/Sprites/off.png.meta +0 -0
  29. /package/{Samples → Samples~}/Group Chat Sample/Sprites/on.png +0 -0
  30. /package/{Samples → Samples~}/Group Chat Sample/Sprites/on.png.meta +0 -0
  31. /package/{Samples → Samples~}/Group Chat Sample/Sprites/speaker.png +0 -0
  32. /package/{Samples → Samples~}/Group Chat Sample/Sprites/speaker.png.meta +0 -0
  33. /package/{Samples → Samples~}/Group Chat Sample/Sprites.meta +0 -0
  34. /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? Mute yourself against them.
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 layer.
10
- * 🎤 __Configurable Audio Input__: UniVoice is audio input agnostic. It supports mic audio input out of the box and you can change the source of outgoing audio by implementing the `IAudioInput` interrace.
11
-
12
- * 🔊 __Configurable Audio Output__: UniVoice is audio output agnostic. Out of the box is supports playing peer audio using Unity AudioSource. You can divert incoming audio to anywhere you want by implementing the `IAudioOutput` interface.
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
- * 🌐 __Configurable Network__: UniVoice is network agnostic and supports Mirror out of the box. You can implement the `IAudioClient` and `IAudioServer` interfaces using the networking plugin of your choice to make it compatible with it.
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__: Modify outgoing and incoming audio by implementing the `IAudioFilter` interface. Gaussian blurring for denoising and Opus (Concentus) encoding & decoding for lower bandwidth consumption are provided out of the box.
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
- Am API reference is available: http://www.vatsalambastha.com/univoice
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
- To try the sample, import Mirror and add the `UNIVOICE_MIRROR_NETWORK` compilation symbol to your project.
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:30817c1a0e6d646d99c048fc403f5979",
8
- "GUID:725ee7191c021de4dbf9269590ded755",
9
- "GUID:b118fd5a40c85ad4e9b38e8c4a42bbb1"
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
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: bc1ad3167deb8cf4896b4f4b1180ec9a
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,5 +1,5 @@
1
1
  fileFormatVersion: 2
2
- guid: dc0b6ac6ddea66b4b8aee68c2ee0e99a
2
+ guid: 046f57b349547674cb5b8c8e31c89467
3
3
  folderAsset: yes
4
4
  DefaultImporter:
5
5
  externalObjects: {}
@@ -1,4 +1,4 @@
1
- #if UNIVOICE_MIRROR_NETWORK
1
+ #if UNIVOICE_MIRROR_NETWORK || UNIVOICE_NETWORK_MIRROR
2
2
  using System;
3
3
  using System.Linq;
4
4
  using System.Collections.Generic;
@@ -1,4 +1,4 @@
1
- #if UNIVOICE_MIRROR_NETWORK
1
+ #if UNIVOICE_MIRROR_NETWORK || UNIVOICE_NETWORK_MIRROR
2
2
  using System;
3
3
 
4
4
  using Mirror;
@@ -1,4 +1,4 @@
1
- #if UNIVOICE_MIRROR_NETWORK
1
+ #if UNIVOICE_MIRROR_NETWORK || UNIVOICE_NETWORK_MIRROR
2
2
  namespace Adrenak.UniVoice.Networks {
3
3
  /// <summary>
4
4
  /// The different types of messages we send over Mirror
@@ -1,4 +1,4 @@
1
- #if UNIVOICE_MIRROR_NETWORK
1
+ #if UNIVOICE_MIRROR_NETWORK || UNIVOICE_NETWORK_MIRROR
2
2
  using Mirror;
3
3
 
4
4
  using System;
@@ -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
 
@@ -1,4 +1,4 @@
1
- #if UNIVOICE_MIRROR_NETWORK
1
+ #if UNIVOICE_MIRROR_NETWORK || UNIVOICE_NETWORK_MIRROR
2
2
  using System.Linq;
3
3
  using System.Collections;
4
4
  using System.Collections.Generic;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.adrenak.univoice",
3
- "version": "4.1.1",
3
+ "version": "4.2.0",
4
4
  "displayName": "Adrenak.UniVoice",
5
5
  "description": "Voice chat/VoIP framework for Unity.",
6
6
  "unity": "2021.2",
File without changes