com.adrenak.univoice 2.0.0 → 2.0.2
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/CHANGELOG.md +67 -41
- package/CHANGELOG.md.meta +7 -7
- package/LICENSE +21 -21
- package/LICENSE.meta +7 -7
- package/README.md.meta +7 -7
- package/Runtime/Adrenak.UniVoice.Runtime.asmdef +3 -3
- package/Runtime/Adrenak.UniVoice.Runtime.asmdef.meta +7 -7
- package/Runtime/ChatroomAgent.cs +30 -40
- package/Runtime/ChatroomAgent.cs.meta +11 -11
- package/Runtime/Extensions.cs +1 -1
- package/Runtime/Extensions.cs.meta +12 -12
- package/Runtime/Interfaces/IAudioInput.cs +4 -2
- package/Runtime/Interfaces/IAudioInput.cs.meta +11 -11
- package/Runtime/Interfaces/IAudioOutput.cs.meta +11 -11
- package/Runtime/Interfaces/IChatroomNetwork.cs +6 -2
- package/Runtime/Interfaces/IChatroomNetwork.cs.meta +11 -11
- package/Runtime/Interfaces.meta +8 -8
- package/Runtime/Types/ChatroomAgentMode.cs.meta +11 -11
- package/Runtime/Types/ChatroomAudioSegment.cs +26 -26
- package/Runtime/Types/ChatroomPeerSettings.cs.meta +11 -11
- package/Runtime/Types.meta +8 -8
- package/Runtime.meta +9 -9
- package/package.json +1 -1
- package/package.json.meta +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,41 +1,67 @@
|
|
|
1
|
-
## [
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
### Bug Fixes
|
|
5
|
-
|
|
6
|
-
*
|
|
7
|
-
|
|
8
|
-
## [1.1
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
### Bug Fixes
|
|
12
|
-
|
|
13
|
-
*
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
### Bug Fixes
|
|
19
|
-
|
|
20
|
-
* README
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
1
|
+
## [2.0.2](https://github.com/adrenak/univoice/compare/v2.0.1...v2.0.2) (2022-11-02)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* remove comment about possible PeerID in IAudioOutput ([2246bb2](https://github.com/adrenak/univoice/commit/2246bb2bef234b84bdf6cd55a9faf87e09133953))
|
|
7
|
+
|
|
8
|
+
## [1.2.1](https://github.com/adrenak/univoice/compare/v1.2.0...v1.2.1) (2022-10-10)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* PeersOutputs gets filled as peers join, not when they start ([42eaeb9](https://github.com/adrenak/univoice/commit/42eaeb95eef4eea7ee559da9fdbcac78ceb941b4))
|
|
14
|
+
|
|
15
|
+
# [1.2.0](https://github.com/adrenak/univoice/compare/v1.1.4...v1.2.0) (2022-09-20)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* Update README.md ([5c234ee](https://github.com/adrenak/univoice/commit/5c234ee1e6aad430f72b4879a401bb98f3e68b88))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Features
|
|
24
|
+
|
|
25
|
+
* Remove inbuilt implementations. Remove samples. ([dbfc4c0](https://github.com/adrenak/univoice/commit/dbfc4c0a1ffd99d03aefe72aec0e27debe68525a))
|
|
26
|
+
|
|
27
|
+
## [1.1.4](https://github.com/adrenak/univoice/compare/v1.1.3...v1.1.4) (2021-08-10)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Bug Fixes
|
|
31
|
+
|
|
32
|
+
* Spell-fix in README ([fcbc7c6](https://github.com/adrenak/univoice/commit/fcbc7c6c28c84415a50050d7014ecdfc39347309))
|
|
33
|
+
|
|
34
|
+
## [1.1.3](https://github.com/adrenak/univoice/compare/v1.1.2...v1.1.3) (2021-06-03)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### Bug Fixes
|
|
38
|
+
|
|
39
|
+
* Add missing mute others toggle in sample scene. ([cff9574](https://github.com/adrenak/univoice/commit/cff9574bdd4b769de519f451e489b9dcdb76f649))
|
|
40
|
+
|
|
41
|
+
## [1.1.2](https://github.com/adrenak/univoice/compare/v1.1.1...v1.1.2) (2021-06-02)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### Bug Fixes
|
|
45
|
+
|
|
46
|
+
* README fix ([d03db44](https://github.com/adrenak/univoice/commit/d03db449e1fe2557a57df75ccfc8fe4a310f308f))
|
|
47
|
+
|
|
48
|
+
## [1.1.1](https://github.com/adrenak/univoice/compare/v1.1.0...v1.1.1) (2021-06-02)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
### Bug Fixes
|
|
52
|
+
|
|
53
|
+
* Prevent sample app screen from sleeping. ([545d96f](https://github.com/adrenak/univoice/commit/545d96f16b858ba1dbdb01de5298ba62c06c2725))
|
|
54
|
+
|
|
55
|
+
# [1.1.0](https://github.com/adrenak/univoice/compare/v1.0.0...v1.1.0) (2021-06-02)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
### Features
|
|
59
|
+
|
|
60
|
+
* InbuiltAudioOutput now also accepts minimum segment count and ([294bfef](https://github.com/adrenak/univoice/commit/294bfef5677d49cd941b513c421980cf6a5e393f))
|
|
61
|
+
|
|
62
|
+
# 1.0.0 (2021-06-02)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
### Features
|
|
66
|
+
|
|
67
|
+
* Full rebuild with AirPeer 1.2.0 ([9327b2a](https://github.com/adrenak/univoice/commit/9327b2a05da766e91bad5f8e6288e5c328ded429))
|
package/CHANGELOG.md.meta
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 0d7539eaf2ef9674d9822b7ae65e72b5
|
|
3
|
-
TextScriptImporter:
|
|
4
|
-
externalObjects: {}
|
|
5
|
-
userData:
|
|
6
|
-
assetBundleName:
|
|
7
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 0d7539eaf2ef9674d9822b7ae65e72b5
|
|
3
|
+
TextScriptImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
userData:
|
|
6
|
+
assetBundleName:
|
|
7
|
+
assetBundleVariant:
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2018 Vatsal Ambastha
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018 Vatsal Ambastha
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/LICENSE.meta
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 789be013ec943714a826e42a9d7db452
|
|
3
|
-
DefaultImporter:
|
|
4
|
-
externalObjects: {}
|
|
5
|
-
userData:
|
|
6
|
-
assetBundleName:
|
|
7
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 789be013ec943714a826e42a9d7db452
|
|
3
|
+
DefaultImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
userData:
|
|
6
|
+
assetBundleName:
|
|
7
|
+
assetBundleVariant:
|
package/README.md.meta
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: b497ccbc9f4029f4593611f820e24235
|
|
3
|
-
TextScriptImporter:
|
|
4
|
-
externalObjects: {}
|
|
5
|
-
userData:
|
|
6
|
-
assetBundleName:
|
|
7
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: b497ccbc9f4029f4593611f820e24235
|
|
3
|
+
TextScriptImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
userData:
|
|
6
|
+
assetBundleName:
|
|
7
|
+
assetBundleVariant:
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "Adrenak.UniVoice.Runtime"
|
|
3
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "Adrenak.UniVoice.Runtime"
|
|
3
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 6b289bb677194eb40b60db3a566aab7b
|
|
3
|
-
AssemblyDefinitionImporter:
|
|
4
|
-
externalObjects: {}
|
|
5
|
-
userData:
|
|
6
|
-
assetBundleName:
|
|
7
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 6b289bb677194eb40b60db3a566aab7b
|
|
3
|
+
AssemblyDefinitionImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
userData:
|
|
6
|
+
assetBundleName:
|
|
7
|
+
assetBundleVariant:
|
package/Runtime/ChatroomAgent.cs
CHANGED
|
@@ -73,6 +73,7 @@ namespace Adrenak.UniVoice {
|
|
|
73
73
|
// ====================================================================
|
|
74
74
|
/// <summary>
|
|
75
75
|
/// Creates and returns a new agent using the provided dependencies.
|
|
76
|
+
/// The instance then makes the dependencies work together.
|
|
76
77
|
/// </summary>
|
|
77
78
|
///
|
|
78
79
|
/// <param name="chatroomNetwork">The chatroom network implementation
|
|
@@ -105,7 +106,7 @@ namespace Adrenak.UniVoice {
|
|
|
105
106
|
PeerSettings = new Dictionary<short, ChatroomPeerSettings>();
|
|
106
107
|
PeerOutputs = new Dictionary<short, IAudioOutput>();
|
|
107
108
|
|
|
108
|
-
|
|
109
|
+
LinkDependencies();
|
|
109
110
|
}
|
|
110
111
|
|
|
111
112
|
/// <summary>
|
|
@@ -128,24 +129,23 @@ namespace Adrenak.UniVoice {
|
|
|
128
129
|
// ====================================================================
|
|
129
130
|
#region INTERNAL
|
|
130
131
|
// ====================================================================
|
|
131
|
-
void
|
|
132
|
-
//
|
|
132
|
+
void LinkDependencies() {
|
|
133
|
+
// Network events
|
|
133
134
|
Network.OnCreatedChatroom += () =>
|
|
134
135
|
CurrentMode = ChatroomAgentMode.Host;
|
|
135
136
|
Network.OnClosedChatroom += () => {
|
|
136
137
|
CurrentMode = ChatroomAgentMode.Unconnected;
|
|
137
138
|
RemoveAllPeers();
|
|
138
139
|
};
|
|
139
|
-
|
|
140
|
-
// Node client events
|
|
141
140
|
Network.OnJoinedChatroom += id => {
|
|
142
141
|
CurrentMode = ChatroomAgentMode.Guest;
|
|
143
|
-
EnsurePeerSettings(0);
|
|
144
142
|
};
|
|
145
|
-
Network.OnLeftChatroom += () =>
|
|
143
|
+
Network.OnLeftChatroom += () => {
|
|
146
144
|
RemoveAllPeers();
|
|
147
|
-
|
|
148
|
-
|
|
145
|
+
CurrentMode = ChatroomAgentMode.Unconnected;
|
|
146
|
+
};
|
|
147
|
+
Network.OnPeerJoinedChatroom += id =>
|
|
148
|
+
AddPeer(id);
|
|
149
149
|
Network.OnPeerLeftChatroom += id =>
|
|
150
150
|
RemovePeer(id);
|
|
151
151
|
|
|
@@ -159,21 +159,17 @@ namespace Adrenak.UniVoice {
|
|
|
159
159
|
var channels = data.channelCount;
|
|
160
160
|
var samples = data.samples;
|
|
161
161
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
if (HasSettingsForPeer(peerID) && !PeerSettings[peerID].muteThem)
|
|
162
|
+
if (PeerSettings.ContainsKey(peerID) && !PeerSettings[peerID].muteThem)
|
|
165
163
|
PeerOutputs[peerID].Feed(index, frequency, channels, samples);
|
|
166
164
|
};
|
|
167
165
|
|
|
168
166
|
AudioInput.OnSegmentReady += (index, samples) => {
|
|
167
|
+
// If we're muting ourselves to all, no point continuing
|
|
169
168
|
if (MuteSelf) return;
|
|
170
169
|
|
|
171
170
|
// Get all the recipients we haven't muted ourselves to
|
|
172
171
|
var recipients = Network.PeerIDs
|
|
173
|
-
.Where(x =>
|
|
174
|
-
return HasSettingsForPeer(x)
|
|
175
|
-
&& !PeerSettings[x].muteSelf;
|
|
176
|
-
});
|
|
172
|
+
.Where(x => PeerSettings.ContainsKey(x) && !PeerSettings[x].muteSelf);
|
|
177
173
|
|
|
178
174
|
// Send the audio segment to every deserving recipient
|
|
179
175
|
foreach (var recipient in recipients)
|
|
@@ -186,39 +182,33 @@ namespace Adrenak.UniVoice {
|
|
|
186
182
|
};
|
|
187
183
|
}
|
|
188
184
|
|
|
185
|
+
void AddPeer(short id) {
|
|
186
|
+
if (!PeerSettings.ContainsKey(id))
|
|
187
|
+
PeerSettings.Add(id, new ChatroomPeerSettings());
|
|
188
|
+
if(!PeerOutputs.ContainsKey(id)) {
|
|
189
|
+
var output = AudioOutputFactory.Create(
|
|
190
|
+
AudioInput.Frequency,
|
|
191
|
+
AudioInput.ChannelCount,
|
|
192
|
+
AudioInput.Frequency * AudioInput.ChannelCount / AudioInput.SegmentRate
|
|
193
|
+
);
|
|
194
|
+
output.ID = id.ToString();
|
|
195
|
+
PeerOutputs.Add(id, output);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
189
199
|
void RemovePeer(short id) {
|
|
190
200
|
if (PeerSettings.ContainsKey(id))
|
|
191
201
|
PeerSettings.Remove(id);
|
|
192
202
|
if (PeerOutputs.ContainsKey(id)) {
|
|
193
|
-
PeerOutputs[id].Dispose();
|
|
194
203
|
PeerOutputs[id].Dispose();
|
|
195
204
|
PeerOutputs.Remove(id);
|
|
196
205
|
}
|
|
197
206
|
}
|
|
198
207
|
|
|
199
|
-
void RemoveAllPeers()
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
PeerSettings.EnsureKey(id, new ChatroomPeerSettings());
|
|
204
|
-
|
|
205
|
-
bool HasSettingsForPeer(short id) => PeerSettings.ContainsKey(id);
|
|
206
|
-
|
|
207
|
-
void EnsurePeerStreamer(
|
|
208
|
-
short id,
|
|
209
|
-
int frequency,
|
|
210
|
-
int channels,
|
|
211
|
-
int segmentLength
|
|
212
|
-
) {
|
|
213
|
-
if (!PeerOutputs.ContainsKey(id) && PeerSettings.ContainsKey(id)) {
|
|
214
|
-
var output = AudioOutputFactory.Create(
|
|
215
|
-
frequency,
|
|
216
|
-
channels,
|
|
217
|
-
segmentLength
|
|
218
|
-
);
|
|
219
|
-
output.ID = id.ToString();
|
|
220
|
-
PeerOutputs.Add(id, output);
|
|
221
|
-
}
|
|
208
|
+
void RemoveAllPeers() {
|
|
209
|
+
var peers = Network.PeerIDs;
|
|
210
|
+
foreach(var peer in peers)
|
|
211
|
+
RemovePeer(peer);
|
|
222
212
|
}
|
|
223
213
|
#endregion
|
|
224
214
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 76706adfc97ef7d44823aa51d618267d
|
|
3
|
-
MonoImporter:
|
|
4
|
-
externalObjects: {}
|
|
5
|
-
serializedVersion: 2
|
|
6
|
-
defaultReferences: []
|
|
7
|
-
executionOrder: 0
|
|
8
|
-
icon: {instanceID: 0}
|
|
9
|
-
userData:
|
|
10
|
-
assetBundleName:
|
|
11
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 76706adfc97ef7d44823aa51d618267d
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|
package/Runtime/Extensions.cs
CHANGED
|
@@ -7,7 +7,7 @@ namespace Adrenak.UniVoice {
|
|
|
7
7
|
/// <summary>
|
|
8
8
|
/// Returns the normalized position of the AudioSource on its AudioClip
|
|
9
9
|
/// </summary>
|
|
10
|
-
public static float
|
|
10
|
+
public static float GetCurrentPosition(this AudioSource source) {
|
|
11
11
|
return (float)source.timeSamples / source.clip.samples;
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 646602ab062d77543b3742e51d16658f
|
|
3
|
-
timeCreated: 1547895114
|
|
4
|
-
licenseType: Free
|
|
5
|
-
MonoImporter:
|
|
6
|
-
serializedVersion: 2
|
|
7
|
-
defaultReferences: []
|
|
8
|
-
executionOrder: 0
|
|
9
|
-
icon: {instanceID: 0}
|
|
10
|
-
userData:
|
|
11
|
-
assetBundleName:
|
|
12
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 646602ab062d77543b3742e51d16658f
|
|
3
|
+
timeCreated: 1547895114
|
|
4
|
+
licenseType: Free
|
|
5
|
+
MonoImporter:
|
|
6
|
+
serializedVersion: 2
|
|
7
|
+
defaultReferences: []
|
|
8
|
+
executionOrder: 0
|
|
9
|
+
icon: {instanceID: 0}
|
|
10
|
+
userData:
|
|
11
|
+
assetBundleName:
|
|
12
|
+
assetBundleVariant:
|
|
@@ -26,8 +26,10 @@ namespace Adrenak.UniVoice {
|
|
|
26
26
|
/// <summary>
|
|
27
27
|
/// The number of segments (a segment is a sequence of audio samples)
|
|
28
28
|
/// that are emitted from the source every second.
|
|
29
|
-
/// A 16000 Hz source with a rate of 10
|
|
30
|
-
/// 1600 samples every 100 milliseconds.
|
|
29
|
+
/// Eg. A 16000 Hz source with one channel at a rate of 10
|
|
30
|
+
/// will output an array of 1600 samples every 100 milliseconds.
|
|
31
|
+
/// A 44000 Hz source with two channels at a rate of 10
|
|
32
|
+
/// will output an array of 8800 samples every 100 milliseconds.
|
|
31
33
|
/// </summary>
|
|
32
34
|
int SegmentRate { get; }
|
|
33
35
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: d56c2c84daac5494b93669532bca0b98
|
|
3
|
-
MonoImporter:
|
|
4
|
-
externalObjects: {}
|
|
5
|
-
serializedVersion: 2
|
|
6
|
-
defaultReferences: []
|
|
7
|
-
executionOrder: 0
|
|
8
|
-
icon: {instanceID: 0}
|
|
9
|
-
userData:
|
|
10
|
-
assetBundleName:
|
|
11
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: d56c2c84daac5494b93669532bca0b98
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 7d34118811133f44eb7ba1b5c3f6bb77
|
|
3
|
-
MonoImporter:
|
|
4
|
-
externalObjects: {}
|
|
5
|
-
serializedVersion: 2
|
|
6
|
-
defaultReferences: []
|
|
7
|
-
executionOrder: 0
|
|
8
|
-
icon: {instanceID: 0}
|
|
9
|
-
userData:
|
|
10
|
-
assetBundleName:
|
|
11
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 7d34118811133f44eb7ba1b5c3f6bb77
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|
|
@@ -46,12 +46,16 @@ namespace Adrenak.UniVoice {
|
|
|
46
46
|
/// <summary>
|
|
47
47
|
/// Fired when a peer joins the chatroom.
|
|
48
48
|
/// Provides the ID of the peer as event data.
|
|
49
|
+
/// This action also MUST be called for all previously
|
|
50
|
+
/// existing peers when we connect to a network.
|
|
49
51
|
/// </summary>
|
|
50
52
|
event Action<short> OnPeerJoinedChatroom;
|
|
51
53
|
|
|
52
54
|
/// <summary>
|
|
53
55
|
/// Fired when a peer leaves the chatroom.
|
|
54
56
|
/// Provides the ID of the peer as event data.
|
|
57
|
+
/// This also also MUST be called for all peers
|
|
58
|
+
/// when we leave a network.
|
|
55
59
|
/// </summary>
|
|
56
60
|
event Action<short> OnPeerLeftChatroom;
|
|
57
61
|
|
|
@@ -75,7 +79,7 @@ namespace Adrenak.UniVoice {
|
|
|
75
79
|
short OwnID { get; }
|
|
76
80
|
|
|
77
81
|
/// <summary>
|
|
78
|
-
/// IDs of all the peers in the current chatroom
|
|
82
|
+
/// IDs of all the peers in the current chatroom (excluding <see cref="OwnID"/>)
|
|
79
83
|
/// </summary>
|
|
80
84
|
List<short> PeerIDs { get; }
|
|
81
85
|
#endregion
|
|
@@ -86,7 +90,7 @@ namespace Adrenak.UniVoice {
|
|
|
86
90
|
/// <summary>
|
|
87
91
|
/// Creates a chatroom
|
|
88
92
|
/// </summary>
|
|
89
|
-
/// <param name="data">
|
|
93
|
+
/// <param name="data">Any arguments for hosting a chatroom</param>
|
|
90
94
|
void HostChatroom(object data = null);
|
|
91
95
|
|
|
92
96
|
/// <summary>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 11ba8951ad10dc84a963ca3c32cda48a
|
|
3
|
-
MonoImporter:
|
|
4
|
-
externalObjects: {}
|
|
5
|
-
serializedVersion: 2
|
|
6
|
-
defaultReferences: []
|
|
7
|
-
executionOrder: 0
|
|
8
|
-
icon: {instanceID: 0}
|
|
9
|
-
userData:
|
|
10
|
-
assetBundleName:
|
|
11
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 11ba8951ad10dc84a963ca3c32cda48a
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|
package/Runtime/Interfaces.meta
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: a0b094f3fe5bc624fae2ffb1e18c19a1
|
|
3
|
-
folderAsset: yes
|
|
4
|
-
DefaultImporter:
|
|
5
|
-
externalObjects: {}
|
|
6
|
-
userData:
|
|
7
|
-
assetBundleName:
|
|
8
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: a0b094f3fe5bc624fae2ffb1e18c19a1
|
|
3
|
+
folderAsset: yes
|
|
4
|
+
DefaultImporter:
|
|
5
|
+
externalObjects: {}
|
|
6
|
+
userData:
|
|
7
|
+
assetBundleName:
|
|
8
|
+
assetBundleVariant:
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 95ab24cb9f03b8c4c8f22f567259def4
|
|
3
|
-
MonoImporter:
|
|
4
|
-
externalObjects: {}
|
|
5
|
-
serializedVersion: 2
|
|
6
|
-
defaultReferences: []
|
|
7
|
-
executionOrder: 0
|
|
8
|
-
icon: {instanceID: 0}
|
|
9
|
-
userData:
|
|
10
|
-
assetBundleName:
|
|
11
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 95ab24cb9f03b8c4c8f22f567259def4
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
namespace Adrenak.UniVoice {
|
|
2
|
-
[System.Serializable]
|
|
3
|
-
/// <summary>
|
|
4
|
-
/// A data structure representing the audio transmitted over the network.
|
|
5
|
-
/// </summary>
|
|
6
|
-
public struct ChatroomAudioSegment {
|
|
7
|
-
/// <summary>
|
|
8
|
-
/// The segment index of the audio samples
|
|
9
|
-
/// </summary>
|
|
10
|
-
public int segmentIndex;
|
|
11
|
-
|
|
12
|
-
/// <summary>
|
|
13
|
-
/// The frequency (or sampling rate) of the audio
|
|
14
|
-
/// </summary>
|
|
15
|
-
public int frequency;
|
|
16
|
-
|
|
17
|
-
/// <summary>
|
|
18
|
-
/// THe number of channels in the audio
|
|
19
|
-
/// </summary>
|
|
20
|
-
public int channelCount;
|
|
21
|
-
|
|
22
|
-
/// <summary>
|
|
23
|
-
/// A float array representing the audio sample data
|
|
24
|
-
/// </summary>
|
|
25
|
-
public float[] samples;
|
|
26
|
-
}
|
|
1
|
+
namespace Adrenak.UniVoice {
|
|
2
|
+
[System.Serializable]
|
|
3
|
+
/// <summary>
|
|
4
|
+
/// A data structure representing the audio transmitted over the network.
|
|
5
|
+
/// </summary>
|
|
6
|
+
public struct ChatroomAudioSegment {
|
|
7
|
+
/// <summary>
|
|
8
|
+
/// The segment index of the audio samples
|
|
9
|
+
/// </summary>
|
|
10
|
+
public int segmentIndex;
|
|
11
|
+
|
|
12
|
+
/// <summary>
|
|
13
|
+
/// The frequency (or sampling rate) of the audio
|
|
14
|
+
/// </summary>
|
|
15
|
+
public int frequency;
|
|
16
|
+
|
|
17
|
+
/// <summary>
|
|
18
|
+
/// THe number of channels in the audio
|
|
19
|
+
/// </summary>
|
|
20
|
+
public int channelCount;
|
|
21
|
+
|
|
22
|
+
/// <summary>
|
|
23
|
+
/// A float array representing the audio sample data
|
|
24
|
+
/// </summary>
|
|
25
|
+
public float[] samples;
|
|
26
|
+
}
|
|
27
27
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 8aa96a7270a41ab42a055ed9a5bcfacd
|
|
3
|
-
MonoImporter:
|
|
4
|
-
externalObjects: {}
|
|
5
|
-
serializedVersion: 2
|
|
6
|
-
defaultReferences: []
|
|
7
|
-
executionOrder: 0
|
|
8
|
-
icon: {instanceID: 0}
|
|
9
|
-
userData:
|
|
10
|
-
assetBundleName:
|
|
11
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 8aa96a7270a41ab42a055ed9a5bcfacd
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|
package/Runtime/Types.meta
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: af3826214be11544e9a38629b9c93566
|
|
3
|
-
folderAsset: yes
|
|
4
|
-
DefaultImporter:
|
|
5
|
-
externalObjects: {}
|
|
6
|
-
userData:
|
|
7
|
-
assetBundleName:
|
|
8
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: af3826214be11544e9a38629b9c93566
|
|
3
|
+
folderAsset: yes
|
|
4
|
+
DefaultImporter:
|
|
5
|
+
externalObjects: {}
|
|
6
|
+
userData:
|
|
7
|
+
assetBundleName:
|
|
8
|
+
assetBundleVariant:
|
package/Runtime.meta
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: e1b2e834bd331324e9157c87f86d1143
|
|
3
|
-
folderAsset: yes
|
|
4
|
-
timeCreated: 1547895114
|
|
5
|
-
licenseType: Free
|
|
6
|
-
DefaultImporter:
|
|
7
|
-
userData:
|
|
8
|
-
assetBundleName:
|
|
9
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: e1b2e834bd331324e9157c87f86d1143
|
|
3
|
+
folderAsset: yes
|
|
4
|
+
timeCreated: 1547895114
|
|
5
|
+
licenseType: Free
|
|
6
|
+
DefaultImporter:
|
|
7
|
+
userData:
|
|
8
|
+
assetBundleName:
|
|
9
|
+
assetBundleVariant:
|
package/package.json
CHANGED
package/package.json.meta
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 5677af848094d404f835a6468b36f003
|
|
3
|
-
TextScriptImporter:
|
|
4
|
-
externalObjects: {}
|
|
5
|
-
userData:
|
|
6
|
-
assetBundleName:
|
|
7
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 5677af848094d404f835a6468b36f003
|
|
3
|
+
TextScriptImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
userData:
|
|
6
|
+
assetBundleName:
|
|
7
|
+
assetBundleVariant:
|