expo-speech-recognition 56.0.3 → 57.0.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.
package/android/build.gradle
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
plugins {
|
|
2
|
+
id 'com.android.library'
|
|
3
|
+
id 'expo-module-gradle-plugin'
|
|
4
|
+
}
|
|
2
5
|
|
|
3
6
|
group = 'expo.modules.speechrecognition'
|
|
4
7
|
|
|
@@ -6,34 +9,6 @@ group = 'expo.modules.speechrecognition'
|
|
|
6
9
|
def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text)
|
|
7
10
|
version = packageJson.version
|
|
8
11
|
|
|
9
|
-
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
10
|
-
apply from: expoModulesCorePlugin
|
|
11
|
-
applyKotlinExpoModulesCorePlugin()
|
|
12
|
-
useCoreDependencies()
|
|
13
|
-
useExpoPublishing()
|
|
14
|
-
|
|
15
|
-
// If you want to use the managed Android SDK versions from expo-modules-core, set this to true.
|
|
16
|
-
// The Android SDK versions will be bumped from time to time in SDK releases and may introduce breaking changes in your module code.
|
|
17
|
-
// Most of the time, you may like to manage the Android SDK versions yourself.
|
|
18
|
-
def useManagedAndroidSdkVersions = false
|
|
19
|
-
if (useManagedAndroidSdkVersions) {
|
|
20
|
-
useDefaultAndroidSdkVersions()
|
|
21
|
-
} else {
|
|
22
|
-
buildscript {
|
|
23
|
-
// Simple helper that allows the root project to override versions declared by this library.
|
|
24
|
-
ext.safeExtGet = { prop, fallback ->
|
|
25
|
-
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
project.android {
|
|
29
|
-
compileSdkVersion safeExtGet("compileSdkVersion", 34)
|
|
30
|
-
defaultConfig {
|
|
31
|
-
minSdkVersion safeExtGet("minSdkVersion", 21)
|
|
32
|
-
targetSdkVersion safeExtGet("targetSdkVersion", 34)
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
12
|
android {
|
|
38
13
|
namespace "expo.modules.speechrecognition"
|
|
39
14
|
defaultConfig {
|
package/android/src/main/java/expo/modules/speechrecognition/ExpoSpeechRecognitionOptions.kt
CHANGED
|
@@ -4,7 +4,9 @@ import android.media.AudioFormat
|
|
|
4
4
|
import android.speech.RecognizerIntent
|
|
5
5
|
import expo.modules.kotlin.records.Field
|
|
6
6
|
import expo.modules.kotlin.records.Record
|
|
7
|
+
import expo.modules.kotlin.types.OptimizedRecord
|
|
7
8
|
|
|
9
|
+
@OptimizedRecord
|
|
8
10
|
class SpeechRecognitionOptions : Record {
|
|
9
11
|
@Field
|
|
10
12
|
val interimResults: Boolean? = false
|
|
@@ -58,6 +60,7 @@ class SpeechRecognitionOptions : Record {
|
|
|
58
60
|
val iosVoiceProcessingEnabled: Boolean? = false
|
|
59
61
|
}
|
|
60
62
|
|
|
63
|
+
@OptimizedRecord
|
|
61
64
|
class VolumeChangeEventOptions : Record {
|
|
62
65
|
@Field
|
|
63
66
|
val enabled: Boolean? = false
|
|
@@ -66,6 +69,7 @@ class VolumeChangeEventOptions : Record {
|
|
|
66
69
|
val intervalMillis: Int? = null
|
|
67
70
|
}
|
|
68
71
|
|
|
72
|
+
@OptimizedRecord
|
|
69
73
|
class RecordingOptions : Record {
|
|
70
74
|
@Field
|
|
71
75
|
val persist: Boolean = false
|
|
@@ -83,6 +87,7 @@ class RecordingOptions : Record {
|
|
|
83
87
|
val outputEncoding: String? = null
|
|
84
88
|
}
|
|
85
89
|
|
|
90
|
+
@OptimizedRecord
|
|
86
91
|
class AudioSourceOptions : Record {
|
|
87
92
|
@Field
|
|
88
93
|
val uri: String = ""
|
|
@@ -100,11 +105,13 @@ class AudioSourceOptions : Record {
|
|
|
100
105
|
val chunkDelayMillis: Long? = null
|
|
101
106
|
}
|
|
102
107
|
|
|
108
|
+
@OptimizedRecord
|
|
103
109
|
class GetSupportedLocaleOptions : Record {
|
|
104
110
|
@Field
|
|
105
111
|
val androidRecognitionServicePackage: String? = null
|
|
106
112
|
}
|
|
107
113
|
|
|
114
|
+
@OptimizedRecord
|
|
108
115
|
class TriggerOfflineModelDownloadOptions : Record {
|
|
109
116
|
@Field
|
|
110
117
|
val locale: String = "en-US"
|
|
@@ -405,7 +405,10 @@ class ExpoSpeechService(
|
|
|
405
405
|
is String -> intent.putExtra(fieldValue, value)
|
|
406
406
|
is List<*> -> {
|
|
407
407
|
if (value.all { it is String }) {
|
|
408
|
-
intent.
|
|
408
|
+
intent.putStringArrayListExtra(
|
|
409
|
+
fieldValue,
|
|
410
|
+
ArrayList(value.filterIsInstance<String>()),
|
|
411
|
+
)
|
|
409
412
|
}
|
|
410
413
|
}
|
|
411
414
|
is Double -> intent.putExtra(fieldValue, value.toInt())
|