Initial Commit
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
using System.IO;
|
||||
using Meta.WitAi;
|
||||
using Meta.WitAi.Dictation;
|
||||
using Meta.WitAi.Windows;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Oculus.Voice.Dictation
|
||||
{
|
||||
[CustomEditor(typeof(AppDictationExperience))]
|
||||
public class AppDictationExperienceEditor : Editor
|
||||
{
|
||||
[SerializeField] private string transcribeFile;
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
base.OnInspectorGUI();
|
||||
|
||||
if (EditorApplication.isPlaying)
|
||||
{
|
||||
GUILayout.BeginVertical(EditorStyles.helpBox);
|
||||
GUILayout.Label("File Transcriber");
|
||||
GUILayout.BeginHorizontal();
|
||||
transcribeFile = EditorGUILayout.TextField(transcribeFile);
|
||||
if (GUILayout.Button("Browse", GUILayout.Width(75)))
|
||||
{
|
||||
var pickedFile = EditorUtility.OpenFilePanel("Select File", "", "wav");
|
||||
if (!string.IsNullOrEmpty(pickedFile))
|
||||
{
|
||||
transcribeFile = pickedFile;
|
||||
}
|
||||
}
|
||||
|
||||
GUILayout.EndHorizontal();
|
||||
if (File.Exists(transcribeFile) && GUILayout.Button("Transcribe"))
|
||||
{
|
||||
var dictationService = ((AppDictationExperience)target).GetComponent<WitDictation>();
|
||||
dictationService.TranscribeFile(transcribeFile);
|
||||
}
|
||||
|
||||
GUILayout.EndVertical();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 294403565ca76cd44a221a07f911e80d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 95c8c3f7c517467f9a7d4365ca7f1f19
|
||||
timeCreated: 1656510929
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
using Meta.WitAi.Configuration;
|
||||
using Meta.WitAi.Data;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Oculus.Voice.Dictation.Data
|
||||
{
|
||||
public class AppDictationDataCreation
|
||||
{
|
||||
[MenuItem("Assets/Create/Voice SDK/Add App Dictation Experience to Scene", false, 100)]
|
||||
public static void AddVoiceCommandServiceToScene()
|
||||
{
|
||||
var witGo = new GameObject();
|
||||
witGo.name = "App Dictation Experience";
|
||||
var wit = witGo.AddComponent<AppDictationExperience>();
|
||||
wit.RuntimeDictationConfiguration = new WitDictationRuntimeConfiguration
|
||||
{
|
||||
witConfiguration = WitDataCreation.FindDefaultWitConfig()
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 55d3bf29671d34b9c84160431ee2429d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c6000f2708bf4d37b50eddbac06db445
|
||||
timeCreated: 1656458466
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Oculus.Voice.Dictation.Inspectors
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(WitDictationRuntimeConfigDrawer))]
|
||||
public class WitDictationRuntimeConfigDrawer : PropertyDrawer
|
||||
{
|
||||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
|
||||
{
|
||||
base.OnGUI(position, property, label);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ad073cad346af44a281dd01c4d8a4a3c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "VoiceSDK.Dictation.Editor",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:7fc7076089fdfbc4399cba40cc3b0dd6",
|
||||
"GUID:910a956078d2ff4429c717211dcfaecb",
|
||||
"GUID:fa958eb9f0171754fb207d563a15ddfa",
|
||||
"GUID:4504b1a6e0fdcc3498c30b266e4a63bf",
|
||||
"GUID:1c28d8b71ced07540b7c271537363cc6"
|
||||
],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fb043033254d90e46b4abaa2879909ea
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user