-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chore: Remove interfaces, and add files for packaging
- Loading branch information
Showing
39 changed files
with
95 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
using Pv.Unity; | ||
|
||
namespace ARFlow | ||
{ | ||
public class AudioStreaming | ||
{ | ||
private List<float> _unsentFrames; | ||
|
||
public List<float> GetFrames() | ||
{ | ||
return _unsentFrames; | ||
} | ||
|
||
public AudioStreaming() | ||
{ | ||
_unsentFrames = new List<float>(); | ||
} | ||
|
||
/// <summary> | ||
/// Since Unity's microphone implementation requires calling "start" and "end", we need | ||
/// a call to start microphone recording | ||
/// </summary> | ||
public void InitializeAudioRecording(int sampleRate, int frameLength) | ||
{ | ||
VoiceProcessor.Instance.StartRecording(frameLength, sampleRate); | ||
VoiceProcessor.Instance.AddFrameListener(UpdateCurrentAudioFrame); | ||
} | ||
|
||
/// <summary> | ||
/// Our point is that we only want to send the current frame, not all frames that might be sent. | ||
/// </summary> | ||
/// <param name="frame"></param> | ||
private void UpdateCurrentAudioFrame(float[] frame) | ||
{ | ||
_unsentFrames.AddRange(frame); | ||
} | ||
|
||
public void ClearFrameList() | ||
{ | ||
_unsentFrames.Clear(); | ||
} | ||
|
||
public void DisposeAudioRecording() | ||
{ | ||
VoiceProcessor.Instance.StopRecording(); | ||
} | ||
} | ||
|
||
|
||
} |
File renamed without changes.
36 changes: 0 additions & 36 deletions
36
unity/Assets/ARFlowPackage/ARFlow/Interfaces/IAudioStreaming.cs
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
unity/Assets/ARFlowPackage/ARFlow/Interfaces/IAudioStreaming.cs.meta
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
unity/Assets/ARFlowPackage/ARFlow/Interfaces/IMeshEncoder.cs
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
unity/Assets/ARFlowPackage/ARFlow/Interfaces/IMeshEncoder.cs.meta
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
25 changes: 25 additions & 0 deletions
25
unity/Assets/ARFlowPackage/ARFlow/MeshingEncode/MeshEncoder.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
using Draco.Encoder; | ||
using Unity.Collections; | ||
|
||
namespace ARFlow | ||
{ | ||
public class MeshEncoder | ||
{ | ||
public List<NativeArray<byte>> EncodeMesh(Mesh mesh) | ||
{ | ||
EncodeResult[] result = DracoEncoder.EncodeMesh(mesh); | ||
List<NativeArray<byte>> ret = new(); | ||
foreach (EncodeResult item in result) | ||
{ | ||
ret.Add(item.data); | ||
} | ||
return ret; | ||
} | ||
} | ||
|
||
} | ||
|
File renamed without changes.
21 changes: 0 additions & 21 deletions
21
unity/Assets/ARFlowPackage/ARFlowDependencies/package.json
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...ets/ARFlowPackage/ARFlowDependencies.meta → .../Assets/Packages/UnityVoiceProcessor.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 3 additions & 2 deletions
5
...kage/ARFlowDependencies/package.json.meta → ...s/Packages/com.atteneder.draco@4.1.0.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
unity/Assets/Scripts/Utils/MeshingEncode/MeshingEncoder.cs
This file was deleted.
Oops, something went wrong.