Skip to content

Commit 73fdefc

Browse files
committed
Microphone: high latency scenarios should occur much less often, Splitter/Mixer: render both sides
1 parent a783948 commit 73fdefc

File tree

6 files changed

+33
-11
lines changed

6 files changed

+33
-11
lines changed

Assets/Materials/diagramSymbols/multipleMixerNode.mat

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Material:
2727
m_InvalidKeywords: []
2828
m_LightmapFlags: 5
2929
m_EnableInstancingVariants: 1
30-
m_DoubleSidedGI: 0
30+
m_DoubleSidedGI: 1
3131
m_CustomRenderQueue: 3000
3232
stringTagMap:
3333
RenderType: Transparent
@@ -83,7 +83,7 @@ Material:
8383
- _Blend: 0
8484
- _BlendOp: 0
8585
- _BumpScale: 1
86-
- _Cull: 2
86+
- _Cull: 0
8787
- _Cutoff: 0.347
8888
- _DetailNormalMapScale: 1
8989
- _DstBlend: 10

Assets/Materials/diagramSymbols/multipleSplitterNode.mat

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Material:
2727
m_InvalidKeywords: []
2828
m_LightmapFlags: 5
2929
m_EnableInstancingVariants: 0
30-
m_DoubleSidedGI: 0
30+
m_DoubleSidedGI: 1
3131
m_CustomRenderQueue: 3000
3232
stringTagMap:
3333
RenderType: Transparent
@@ -83,7 +83,7 @@ Material:
8383
- _Blend: 0
8484
- _BlendOp: 0
8585
- _BumpScale: 1
86-
- _Cull: 2
86+
- _Cull: 0
8787
- _Cutoff: 0.476
8888
- _DetailNormalMapScale: 1
8989
- _DstBlend: 10

Assets/Resources/Prefabs/MultiMix.prefab

+1-1
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,7 @@ Transform:
10961096
m_PrefabAsset: {fileID: 0}
10971097
m_GameObject: {fileID: 1708237867706996}
10981098
m_LocalRotation: {x: 0, y: 1, z: 0, w: 0}
1099-
m_LocalPosition: {x: 0, y: 0, z: 0.0217}
1099+
m_LocalPosition: {x: 0, y: 0, z: 0.0203}
11001100
m_LocalScale: {x: 0.02660795, y: 0.026607996, z: 0.053216}
11011101
m_ConstrainProportionsScale: 0
11021102
m_Children: []

Assets/Resources/Prefabs/MultiSplit.prefab

+1-1
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,7 @@ Transform:
10961096
m_PrefabAsset: {fileID: 0}
10971097
m_GameObject: {fileID: 1708237867706996}
10981098
m_LocalRotation: {x: 0, y: 1, z: 0, w: 0}
1099-
m_LocalPosition: {x: 0, y: 0, z: 0.0217}
1099+
m_LocalPosition: {x: 0, y: 0, z: 0.02025}
11001100
m_LocalScale: {x: 0.02660795, y: 0.026607996, z: 0.053216}
11011101
m_ConstrainProportionsScale: 0
11021102
m_Children: []

Assets/Scripts/Microphone/MicrophoneSignalGenerator.cs

+24-2
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,32 @@ public override void Awake() {
6464
}
6565

6666
void Start() {
67-
source = GetComponent<AudioSource>();
67+
source = GetComponent<AudioSource>();
68+
OVRManager.TrackingAcquired += trackingAcquired;
69+
OVRManager.TrackingAcquired += trackingLost;
6870
SelectMic(0);
6971
}
7072

73+
void OnApplicationFocus(bool hasFocus)
74+
{
75+
if(hasFocus) SelectMic(0); // restart mic in order to clear its buffer and avoid severe latency
76+
}
77+
78+
void OnApplicationPause(bool isPaused)
79+
{
80+
if (!isPaused) SelectMic(0); // restart mic in order to clear its buffer and avoid severe latency
81+
}
82+
83+
84+
public void trackingAcquired(){
85+
SelectMic(0); // restart mic in order to clear its buffer and avoid severe latency
86+
}
87+
88+
public void trackingLost(){
89+
SelectMic(0); // restart mic in order to clear its buffer and avoid severe latency
90+
}
91+
92+
7193
Coroutine _MicActivateRoutine;
7294
void SelectMic(int num) {
7395
if (num >= Microphone.devices.Length) {
@@ -83,7 +105,7 @@ IEnumerator MicActivateRoutine(int num) {
83105
Microphone.End(Microphone.devices[curMicID]);
84106
curMicID = num;
85107

86-
micClip = Microphone.Start(Microphone.devices[num], true, 1, AudioSettings.outputSampleRate);
108+
micClip = Microphone.Start(Microphone.devices[num], true, 3, AudioSettings.outputSampleRate);
87109

88110
yield return null;
89111
if (micClip != null) {

ProjectSettings/ProjectSettings.asset

+3-3
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ PlayerSettings:
807807
metroSplashScreenUseBackgroundColor: 1
808808
platformCapabilities:
809809
WindowsStoreApps:
810-
EnterpriseAuthentication: False
810+
CodeGeneration: False
811811
VideosLibrary: False
812812
HumanInterfaceDevice: False
813813
Location: False
@@ -839,10 +839,10 @@ PlayerSettings:
839839
PointOfService: False
840840
RecordedCallsFolder: False
841841
Contacts: False
842+
InternetClient: False
842843
Proximity: False
843-
CodeGeneration: False
844844
BackgroundMediaPlayback: False
845-
InternetClient: False
845+
EnterpriseAuthentication: False
846846
metroTargetDeviceFamilies:
847847
Desktop: False
848848
Holographic: False

0 commit comments

Comments
 (0)