>()
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/android/src/main/java/com/reactnativetranscription/WavHeaderFunctions.java:
--------------------------------------------------------------------------------
1 | package com.reactnativetranscription;
2 |
3 | import java.io.RandomAccessFile;
4 | import java.io.FileNotFoundException;
5 | import java.io.IOException;
6 | import java.nio.ByteOrder;
7 | import java.nio.ByteBuffer;
8 |
9 | public class WavHeaderFunctions {
10 | public static char readLEChar(RandomAccessFile f) throws IOException {
11 | byte b1 = f.readByte();
12 | byte b2 = f.readByte();
13 | return (char)((b2 << 8) | b1);
14 | }
15 |
16 | public static int readLEInt(RandomAccessFile f) throws IOException {
17 | byte b1 = f.readByte();
18 | byte b2 = f.readByte();
19 | byte b3 = f.readByte();
20 | byte b4 = f.readByte();
21 | return (int)((b1 & 0xFF) | (b2 & 0xFF) << 8 | (b3 & 0xFF) << 16 | (b4 & 0xFF) << 24);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: ['module:metro-react-native-babel-preset'],
3 | };
4 |
--------------------------------------------------------------------------------
/example/android/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | android
4 | Project android created by Buildship.
5 |
6 |
7 |
8 |
9 | org.eclipse.buildship.core.gradleprojectbuilder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.buildship.core.gradleprojectnature
16 |
17 |
18 |
--------------------------------------------------------------------------------
/example/android/.settings/org.eclipse.buildship.core.prefs:
--------------------------------------------------------------------------------
1 | connection.project.dir=
2 | eclipse.preferences.version=1
3 |
--------------------------------------------------------------------------------
/example/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: "com.android.application"
2 |
3 | import com.android.build.OutputFile
4 |
5 | /**
6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
7 | * and bundleReleaseJsAndAssets).
8 | * These basically call `react-native bundle` with the correct arguments during the Android build
9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
10 | * bundle directly from the development server. Below you can see all the possible configurations
11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the
12 | * `apply from: "../../node_modules/react-native/react.gradle"` line.
13 | *
14 | * project.ext.react = [
15 | * // the name of the generated asset file containing your JS bundle
16 | * bundleAssetName: "index.android.bundle",
17 | *
18 | * // the entry file for bundle generation
19 | * entryFile: "index.android.js",
20 | *
21 | * // https://facebook.github.io/react-native/docs/performance#enable-the-ram-format
22 | * bundleCommand: "ram-bundle",
23 | *
24 | * // whether to bundle JS and assets in debug mode
25 | * bundleInDebug: false,
26 | *
27 | * // whether to bundle JS and assets in release mode
28 | * bundleInRelease: true,
29 | *
30 | * // whether to bundle JS and assets in another build variant (if configured).
31 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
32 | * // The configuration property can be in the following formats
33 | * // 'bundleIn${productFlavor}${buildType}'
34 | * // 'bundleIn${buildType}'
35 | * // bundleInFreeDebug: true,
36 | * // bundleInPaidRelease: true,
37 | * // bundleInBeta: true,
38 | *
39 | * // whether to disable dev mode in custom build variants (by default only disabled in release)
40 | * // for TranscriptionExample: to disable dev mode in the staging build type (if configured)
41 | * devDisabledInStaging: true,
42 | * // The configuration property can be in the following formats
43 | * // 'devDisabledIn${productFlavor}${buildType}'
44 | * // 'devDisabledIn${buildType}'
45 | *
46 | * // the root of your project, i.e. where "package.json" lives
47 | * root: "../../",
48 | *
49 | * // where to put the JS bundle asset in debug mode
50 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
51 | *
52 | * // where to put the JS bundle asset in release mode
53 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release",
54 | *
55 | * // where to put drawable resources / React Native assets, e.g. the ones you use via
56 | * // require('./image.png')), in debug mode
57 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
58 | *
59 | * // where to put drawable resources / React Native assets, e.g. the ones you use via
60 | * // require('./image.png')), in release mode
61 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
62 | *
63 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means
64 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
65 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle
66 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
67 | * // for TranscriptionExample, you might want to remove it from here.
68 | * inputExcludes: ["android/**", "ios/**"],
69 | *
70 | * // override which node gets called and with what additional arguments
71 | * nodeExecutableAndArgs: ["node"],
72 | *
73 | * // supply additional arguments to the packager
74 | * extraPackagerArgs: []
75 | * ]
76 | */
77 |
78 | project.ext.react = [
79 | enableHermes: false, // clean and rebuild if changing
80 | ]
81 |
82 | apply from: "../../node_modules/react-native/react.gradle"
83 |
84 | /**
85 | * Set this to true to create two separate APKs instead of one:
86 | * - An APK that only works on ARM devices
87 | * - An APK that only works on x86 devices
88 | * The advantage is the size of the APK is reduced by about 4MB.
89 | * Upload all the APKs to the Play Store and people will download
90 | * the correct one based on the CPU architecture of their device.
91 | */
92 | def enableSeparateBuildPerCPUArchitecture = false
93 |
94 | /**
95 | * Run Proguard to shrink the Java bytecode in release builds.
96 | */
97 | def enableProguardInReleaseBuilds = false
98 |
99 | /**
100 | * The preferred build flavor of JavaScriptCore.
101 | *
102 | * For TranscriptionExample, to use the international variant, you can use:
103 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
104 | *
105 | * The international variant includes ICU i18n library and necessary data
106 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
107 | * give correct results when using with locales other than en-US. Note that
108 | * this variant is about 6MiB larger per architecture than default.
109 | */
110 | def jscFlavor = 'org.webkit:android-jsc:+'
111 |
112 | /**
113 | * Whether to enable the Hermes VM.
114 | *
115 | * This should be set on project.ext.react and mirrored here. If it is not set
116 | * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
117 | * and the benefits of using Hermes will therefore be sharply reduced.
118 | */
119 | def enableHermes = project.ext.react.get("enableHermes", false);
120 |
121 | android {
122 | compileSdkVersion rootProject.ext.compileSdkVersion
123 |
124 | compileOptions {
125 | sourceCompatibility JavaVersion.VERSION_1_8
126 | targetCompatibility JavaVersion.VERSION_1_8
127 | }
128 |
129 | defaultConfig {
130 | applicationId "com.example.reactnativetranscription"
131 | minSdkVersion rootProject.ext.minSdkVersion
132 | targetSdkVersion rootProject.ext.targetSdkVersion
133 | versionCode 1
134 | versionName "1.0"
135 | }
136 | splits {
137 | abi {
138 | reset()
139 | enable enableSeparateBuildPerCPUArchitecture
140 | universalApk false // If true, also generate a universal APK
141 | include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
142 | }
143 | }
144 | signingConfigs {
145 | debug {
146 | storeFile file('debug.keystore')
147 | storePassword 'android'
148 | keyAlias 'androiddebugkey'
149 | keyPassword 'android'
150 | }
151 | }
152 | buildTypes {
153 | debug {
154 | signingConfig signingConfigs.debug
155 | }
156 | release {
157 | // Caution! In production, you need to generate your own keystore file.
158 | // see https://facebook.github.io/react-native/docs/signed-apk-android.
159 | signingConfig signingConfigs.debug
160 | minifyEnabled enableProguardInReleaseBuilds
161 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
162 | }
163 | }
164 | // applicationVariants are e.g. debug, release
165 | applicationVariants.all { variant ->
166 | variant.outputs.each { output ->
167 | // For each separate APK per architecture, set a unique version code as described here:
168 | // https://developer.android.com/studio/build/configure-apk-splits.html
169 | def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
170 | def abi = output.getFilter(OutputFile.ABI)
171 | if (abi != null) { // null for the universal-debug, universal-release variants
172 | output.versionCodeOverride =
173 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
174 | }
175 |
176 | }
177 | }
178 |
179 | packagingOptions {
180 | pickFirst "lib/armeabi-v7a/libc++_shared.so"
181 | pickFirst "lib/arm64-v8a/libc++_shared.so"
182 | pickFirst "lib/x86/libc++_shared.so"
183 | pickFirst "lib/x86_64/libc++_shared.so"
184 | }
185 | }
186 |
187 | dependencies {
188 | implementation fileTree(dir: "libs", include: ["*.jar"])
189 | //noinspection GradleDynamicVersion
190 | implementation "com.facebook.react:react-native:+" // From node_modules
191 |
192 |
193 | implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
194 | debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
195 | exclude group:'com.facebook.fbjni'
196 | }
197 | debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
198 | exclude group:'com.facebook.flipper'
199 | }
200 | debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
201 | exclude group:'com.facebook.flipper'
202 | }
203 |
204 | if (enableHermes) {
205 | def hermesPath = "../../node_modules/hermes-engine/android/";
206 | debugImplementation files(hermesPath + "hermes-debug.aar")
207 | releaseImplementation files(hermesPath + "hermes-release.aar")
208 | } else {
209 | implementation jscFlavor
210 | }
211 |
212 | implementation project(':reactnativetranscription')
213 | }
214 |
215 | // Run this once to be able to run the application with BUCK
216 | // puts all compile dependencies into folder libs for BUCK to use
217 | task copyDownloadableDepsToLibs(type: Copy) {
218 | from configurations.compile
219 | into 'libs'
220 | }
221 |
222 | apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
223 |
--------------------------------------------------------------------------------
/example/android/app/debug.keystore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReLearnApp/react-native-transcription/8809e9ae01eca460ebf3e0184d77af961b3e39e2/example/android/app/debug.keystore
--------------------------------------------------------------------------------
/example/android/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
--------------------------------------------------------------------------------
/example/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/android/app/src/debug/java/com/example/reactnativetranscription/ReactNativeFlipper.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the LICENSE file in the root
5 | * directory of this source tree.
6 | */
7 | package com.example.reactnativetranscription;
8 |
9 | import android.content.Context;
10 | import com.facebook.flipper.android.AndroidFlipperClient;
11 | import com.facebook.flipper.android.utils.FlipperUtils;
12 | import com.facebook.flipper.core.FlipperClient;
13 | import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
14 | import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
15 | import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
16 | import com.facebook.flipper.plugins.inspector.DescriptorMapping;
17 | import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
18 | import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
19 | import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
20 | import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
21 | import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
22 | import com.facebook.react.ReactInstanceManager;
23 | import com.facebook.react.bridge.ReactContext;
24 | import com.facebook.react.modules.network.NetworkingModule;
25 | import okhttp3.OkHttpClient;
26 |
27 | public class ReactNativeFlipper {
28 | public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
29 | if (FlipperUtils.shouldEnableFlipper(context)) {
30 | final FlipperClient client = AndroidFlipperClient.getInstance(context);
31 | client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
32 | client.addPlugin(new ReactFlipperPlugin());
33 | client.addPlugin(new DatabasesFlipperPlugin(context));
34 | client.addPlugin(new SharedPreferencesFlipperPlugin(context));
35 | client.addPlugin(CrashReporterPlugin.getInstance());
36 | NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
37 | NetworkingModule.setCustomClientBuilder(
38 | new NetworkingModule.CustomClientBuilder() {
39 | @Override
40 | public void apply(OkHttpClient.Builder builder) {
41 | builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
42 | }
43 | });
44 | client.addPlugin(networkFlipperPlugin);
45 | client.start();
46 | // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
47 | // Hence we run if after all native modules have been initialized
48 | ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
49 | if (reactContext == null) {
50 | reactInstanceManager.addReactInstanceEventListener(
51 | new ReactInstanceManager.ReactInstanceEventListener() {
52 | @Override
53 | public void onReactContextInitialized(ReactContext reactContext) {
54 | reactInstanceManager.removeReactInstanceEventListener(this);
55 | reactContext.runOnNativeModulesQueueThread(
56 | new Runnable() {
57 | @Override
58 | public void run() {
59 | client.addPlugin(new FrescoFlipperPlugin());
60 | }
61 | });
62 | }
63 | });
64 | } else {
65 | client.addPlugin(new FrescoFlipperPlugin());
66 | }
67 | }
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/example/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
17 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/example/android/app/src/main/java/com/example/reactnativetranscription/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.reactnativetranscription;
2 |
3 | import com.facebook.react.ReactActivity;
4 |
5 | public class MainActivity extends ReactActivity {
6 |
7 | /**
8 | * Returns the name of the main component registered from JavaScript. This is used to schedule
9 | * rendering of the component.
10 | */
11 | @Override
12 | protected String getMainComponentName() {
13 | return "TranscriptionExample";
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/example/android/app/src/main/java/com/example/reactnativetranscription/MainApplication.java:
--------------------------------------------------------------------------------
1 | package com.example.reactnativetranscription;
2 |
3 | import android.app.Application;
4 | import android.content.Context;
5 | import com.facebook.react.PackageList;
6 | import com.facebook.react.ReactApplication;
7 | import com.facebook.react.ReactNativeHost;
8 | import com.facebook.react.ReactPackage;
9 | import com.facebook.react.ReactInstanceManager;
10 | import com.facebook.soloader.SoLoader;
11 | import java.lang.reflect.InvocationTargetException;
12 | import java.util.List;
13 |
14 | import com.reactnativetranscription.TranscriptionPackage;
15 |
16 | public class MainApplication extends Application implements ReactApplication {
17 |
18 | private final ReactNativeHost mReactNativeHost =
19 | new ReactNativeHost(this) {
20 | @Override
21 | public boolean getUseDeveloperSupport() {
22 | return BuildConfig.DEBUG;
23 | }
24 |
25 | @Override
26 | protected List getPackages() {
27 | @SuppressWarnings("UnnecessaryLocalVariable")
28 | List packages = new PackageList(this).getPackages();
29 | // Packages that cannot be autolinked yet can be added manually here, for TranscriptionExample:
30 | // packages.add(new MyReactNativePackage());
31 | packages.add(new TranscriptionPackage());
32 |
33 | return packages;
34 | }
35 |
36 | @Override
37 | protected String getJSMainModuleName() {
38 | return "index";
39 | }
40 | };
41 |
42 | @Override
43 | public ReactNativeHost getReactNativeHost() {
44 | return mReactNativeHost;
45 | }
46 |
47 | @Override
48 | public void onCreate() {
49 | super.onCreate();
50 | SoLoader.init(this, /* native exopackage */ false);
51 | initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); // Remove this line if you don't want Flipper enabled
52 | }
53 |
54 | /**
55 | * Loads Flipper in React Native templates.
56 | *
57 | * @param context
58 | */
59 | private static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
60 | if (BuildConfig.DEBUG) {
61 | try {
62 | /*
63 | We use reflection here to pick up the class that initializes Flipper,
64 | since Flipper library is not available in release mode
65 | */
66 | Class> aClass = Class.forName("com.reactnativetranscriptionExample.ReactNativeFlipper");
67 | aClass
68 | .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
69 | .invoke(null, context, reactInstanceManager);
70 | } catch (ClassNotFoundException e) {
71 | e.printStackTrace();
72 | } catch (NoSuchMethodException e) {
73 | e.printStackTrace();
74 | } catch (IllegalAccessException e) {
75 | e.printStackTrace();
76 | } catch (InvocationTargetException e) {
77 | e.printStackTrace();
78 | }
79 | }
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReLearnApp/react-native-transcription/8809e9ae01eca460ebf3e0184d77af961b3e39e2/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReLearnApp/react-native-transcription/8809e9ae01eca460ebf3e0184d77af961b3e39e2/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReLearnApp/react-native-transcription/8809e9ae01eca460ebf3e0184d77af961b3e39e2/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReLearnApp/react-native-transcription/8809e9ae01eca460ebf3e0184d77af961b3e39e2/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReLearnApp/react-native-transcription/8809e9ae01eca460ebf3e0184d77af961b3e39e2/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReLearnApp/react-native-transcription/8809e9ae01eca460ebf3e0184d77af961b3e39e2/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReLearnApp/react-native-transcription/8809e9ae01eca460ebf3e0184d77af961b3e39e2/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReLearnApp/react-native-transcription/8809e9ae01eca460ebf3e0184d77af961b3e39e2/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReLearnApp/react-native-transcription/8809e9ae01eca460ebf3e0184d77af961b3e39e2/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReLearnApp/react-native-transcription/8809e9ae01eca460ebf3e0184d77af961b3e39e2/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Transcription Example
3 |
4 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/example/android/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | ext {
5 | buildToolsVersion = "29.0.2"
6 | minSdkVersion = 22
7 | compileSdkVersion = 29
8 | targetSdkVersion = 29
9 | }
10 | repositories {
11 | google()
12 | jcenter()
13 | }
14 | dependencies {
15 | classpath('com.android.tools.build:gradle:4.0.1')
16 |
17 | // NOTE: Do not place your application dependencies here; they belong
18 | // in the individual module build.gradle files
19 | }
20 | }
21 |
22 | allprojects {
23 | repositories {
24 | mavenLocal()
25 | maven {
26 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
27 | url("$rootDir/../node_modules/react-native/android")
28 | }
29 | maven {
30 | // Android JSC is installed from npm
31 | url("$rootDir/../node_modules/jsc-android/dist")
32 | }
33 |
34 | google()
35 | jcenter()
36 | maven { url 'https://www.jitpack.io' }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
19 |
20 | android.useAndroidX=true
21 | android.enableJetifier=true
22 | FLIPPER_VERSION=0.33.1
23 |
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReLearnApp/react-native-transcription/8809e9ae01eca460ebf3e0184d77af961b3e39e2/example/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Thu Aug 20 23:16:57 EDT 2020
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
7 |
--------------------------------------------------------------------------------
/example/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | #
4 | # Copyright 2015 the original author or authors.
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | ##############################################################################
20 | ##
21 | ## Gradle start up script for UN*X
22 | ##
23 | ##############################################################################
24 |
25 | # Attempt to set APP_HOME
26 | # Resolve links: $0 may be a link
27 | PRG="$0"
28 | # Need this for relative symlinks.
29 | while [ -h "$PRG" ] ; do
30 | ls=`ls -ld "$PRG"`
31 | link=`expr "$ls" : '.*-> \(.*\)$'`
32 | if expr "$link" : '/.*' > /dev/null; then
33 | PRG="$link"
34 | else
35 | PRG=`dirname "$PRG"`"/$link"
36 | fi
37 | done
38 | SAVED="`pwd`"
39 | cd "`dirname \"$PRG\"`/" >/dev/null
40 | APP_HOME="`pwd -P`"
41 | cd "$SAVED" >/dev/null
42 |
43 | APP_NAME="Gradle"
44 | APP_BASE_NAME=`basename "$0"`
45 |
46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
48 |
49 | # Use the maximum available, or set MAX_FD != -1 to use that value.
50 | MAX_FD="maximum"
51 |
52 | warn () {
53 | echo "$*"
54 | }
55 |
56 | die () {
57 | echo
58 | echo "$*"
59 | echo
60 | exit 1
61 | }
62 |
63 | # OS specific support (must be 'true' or 'false').
64 | cygwin=false
65 | msys=false
66 | darwin=false
67 | nonstop=false
68 | case "`uname`" in
69 | CYGWIN* )
70 | cygwin=true
71 | ;;
72 | Darwin* )
73 | darwin=true
74 | ;;
75 | MINGW* )
76 | msys=true
77 | ;;
78 | NONSTOP* )
79 | nonstop=true
80 | ;;
81 | esac
82 |
83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
84 |
85 | # Determine the Java command to use to start the JVM.
86 | if [ -n "$JAVA_HOME" ] ; then
87 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
88 | # IBM's JDK on AIX uses strange locations for the executables
89 | JAVACMD="$JAVA_HOME/jre/sh/java"
90 | else
91 | JAVACMD="$JAVA_HOME/bin/java"
92 | fi
93 | if [ ! -x "$JAVACMD" ] ; then
94 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
95 |
96 | Please set the JAVA_HOME variable in your environment to match the
97 | location of your Java installation."
98 | fi
99 | else
100 | JAVACMD="java"
101 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
102 |
103 | Please set the JAVA_HOME variable in your environment to match the
104 | location of your Java installation."
105 | fi
106 |
107 | # Increase the maximum file descriptors if we can.
108 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
109 | MAX_FD_LIMIT=`ulimit -H -n`
110 | if [ $? -eq 0 ] ; then
111 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
112 | MAX_FD="$MAX_FD_LIMIT"
113 | fi
114 | ulimit -n $MAX_FD
115 | if [ $? -ne 0 ] ; then
116 | warn "Could not set maximum file descriptor limit: $MAX_FD"
117 | fi
118 | else
119 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
120 | fi
121 | fi
122 |
123 | # For Darwin, add options to specify how the application appears in the dock
124 | if $darwin; then
125 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
126 | fi
127 |
128 | # For Cygwin, switch paths to Windows format before running java
129 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
130 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
131 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
132 | JAVACMD=`cygpath --unix "$JAVACMD"`
133 |
134 | # We build the pattern for arguments to be converted via cygpath
135 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
136 | SEP=""
137 | for dir in $ROOTDIRSRAW ; do
138 | ROOTDIRS="$ROOTDIRS$SEP$dir"
139 | SEP="|"
140 | done
141 | OURCYGPATTERN="(^($ROOTDIRS))"
142 | # Add a user-defined pattern to the cygpath arguments
143 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
144 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
145 | fi
146 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
147 | i=0
148 | for arg in "$@" ; do
149 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
150 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
151 |
152 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
153 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
154 | else
155 | eval `echo args$i`="\"$arg\""
156 | fi
157 | i=$((i+1))
158 | done
159 | case $i in
160 | (0) set -- ;;
161 | (1) set -- "$args0" ;;
162 | (2) set -- "$args0" "$args1" ;;
163 | (3) set -- "$args0" "$args1" "$args2" ;;
164 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
165 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
166 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
167 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
168 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
169 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
170 | esac
171 | fi
172 |
173 | # Escape application args
174 | save () {
175 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
176 | echo " "
177 | }
178 | APP_ARGS=$(save "$@")
179 |
180 | # Collect all arguments for the java command, following the shell quoting and substitution rules
181 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
182 |
183 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
184 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
185 | cd "$(dirname "$0")"
186 | fi
187 |
188 | exec "$JAVACMD" "$@"
189 |
--------------------------------------------------------------------------------
/example/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem http://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
33 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
34 |
35 | @rem Find java.exe
36 | if defined JAVA_HOME goto findJavaFromJavaHome
37 |
38 | set JAVA_EXE=java.exe
39 | %JAVA_EXE% -version >NUL 2>&1
40 | if "%ERRORLEVEL%" == "0" goto init
41 |
42 | echo.
43 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
44 | echo.
45 | echo Please set the JAVA_HOME variable in your environment to match the
46 | echo location of your Java installation.
47 |
48 | goto fail
49 |
50 | :findJavaFromJavaHome
51 | set JAVA_HOME=%JAVA_HOME:"=%
52 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
53 |
54 | if exist "%JAVA_EXE%" goto init
55 |
56 | echo.
57 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
58 | echo.
59 | echo Please set the JAVA_HOME variable in your environment to match the
60 | echo location of your Java installation.
61 |
62 | goto fail
63 |
64 | :init
65 | @rem Get command-line arguments, handling Windows variants
66 |
67 | if not "%OS%" == "Windows_NT" goto win9xME_args
68 |
69 | :win9xME_args
70 | @rem Slurp the command line arguments.
71 | set CMD_LINE_ARGS=
72 | set _SKIP=2
73 |
74 | :win9xME_args_slurp
75 | if "x%~1" == "x" goto execute
76 |
77 | set CMD_LINE_ARGS=%*
78 |
79 | :execute
80 | @rem Setup the command line
81 |
82 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
83 |
84 | @rem Execute Gradle
85 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
86 |
87 | :end
88 | @rem End local scope for the variables with windows NT shell
89 | if "%ERRORLEVEL%"=="0" goto mainEnd
90 |
91 | :fail
92 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
93 | rem the _cmd.exe /c_ return code!
94 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
95 | exit /b 1
96 |
97 | :mainEnd
98 | if "%OS%"=="Windows_NT" endlocal
99 |
100 | :omega
101 |
--------------------------------------------------------------------------------
/example/android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'TranscriptionExample'
2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
3 | include ':app'
4 |
5 | include ':reactnativetranscription'
6 | project(':reactnativetranscription').projectDir = new File(rootProject.projectDir, '../../android')
7 |
--------------------------------------------------------------------------------
/example/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "TranscriptionExample",
3 | "displayName": "Transcription Example"
4 | }
5 |
--------------------------------------------------------------------------------
/example/babel.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const pak = require('../package.json');
3 |
4 | module.exports = {
5 | presets: ['module:metro-react-native-babel-preset'],
6 | plugins: [
7 | [
8 | 'module-resolver',
9 | {
10 | alias: {
11 | [pak.name]: path.join(__dirname, '..', pak.source),
12 | },
13 | },
14 | ],
15 | ],
16 | };
17 |
--------------------------------------------------------------------------------
/example/index.tsx:
--------------------------------------------------------------------------------
1 | import { AppRegistry } from 'react-native';
2 | import App from './src/App';
3 | import { name as appName } from './app.json';
4 |
5 | AppRegistry.registerComponent(appName, () => App);
6 |
--------------------------------------------------------------------------------
/example/ios/File.swift:
--------------------------------------------------------------------------------
1 | //
2 | // File.swift
3 | // TranscriptionExample
4 | //
5 |
6 | import Foundation
7 |
--------------------------------------------------------------------------------
/example/ios/Podfile:
--------------------------------------------------------------------------------
1 | platform :ios, '13.5'
2 | #plugin 'cocoapods-user-defined-build-types'
3 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
4 |
5 | #enable_user_defined_build_types!
6 | #use_frameworks!
7 |
8 |
9 | target 'TranscriptionExample' do
10 | # Pods for TranscriptionExample
11 | pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
12 | pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
13 | pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
14 | pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
15 | pod 'React', :path => '../node_modules/react-native/'
16 | pod 'React-Core', :path => '../node_modules/react-native/'
17 | pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
18 | pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
19 | pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
20 | pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
21 | pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
22 | pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
23 | pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
24 | pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
25 | pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
26 | pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
27 | pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
28 | pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
29 |
30 | pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
31 | pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
32 | pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
33 | pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
34 | pod 'ReactCommon/callinvoker', :path => "../node_modules/react-native/ReactCommon"
35 | pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
36 | pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga', :modular_headers => true
37 |
38 | pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
39 | pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
40 | pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
41 |
42 | permissions_path = '../node_modules/react-native-permissions/ios'
43 | pod 'Permission-Microphone', :path => "#{permissions_path}/Microphone.podspec"
44 | pod 'Permission-SpeechRecognition', :path => "#{permissions_path}/SpeechRecognition.podspec"
45 |
46 |
47 | pod 'react-native-transcription', :path => '../..'
48 |
49 | use_native_modules!
50 |
51 |
52 | end
53 |
--------------------------------------------------------------------------------
/example/ios/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - boost-for-react-native (1.63.0)
3 | - DoubleConversion (1.1.6)
4 | - FBLazyVector (0.62.2)
5 | - FBReactNativeSpec (0.62.2):
6 | - Folly (= 2018.10.22.00)
7 | - RCTRequired (= 0.62.2)
8 | - RCTTypeSafety (= 0.62.2)
9 | - React-Core (= 0.62.2)
10 | - React-jsi (= 0.62.2)
11 | - ReactCommon/turbomodule/core (= 0.62.2)
12 | - Folly (2018.10.22.00):
13 | - boost-for-react-native
14 | - DoubleConversion
15 | - Folly/Default (= 2018.10.22.00)
16 | - glog
17 | - Folly/Default (2018.10.22.00):
18 | - boost-for-react-native
19 | - DoubleConversion
20 | - glog
21 | - glog (0.3.5)
22 | - Permission-Microphone (2.1.5):
23 | - RNPermissions
24 | - Permission-SpeechRecognition (2.1.5):
25 | - RNPermissions
26 | - RCTRequired (0.62.2)
27 | - RCTTypeSafety (0.62.2):
28 | - FBLazyVector (= 0.62.2)
29 | - Folly (= 2018.10.22.00)
30 | - RCTRequired (= 0.62.2)
31 | - React-Core (= 0.62.2)
32 | - React (0.62.2):
33 | - React-Core (= 0.62.2)
34 | - React-Core/DevSupport (= 0.62.2)
35 | - React-Core/RCTWebSocket (= 0.62.2)
36 | - React-RCTActionSheet (= 0.62.2)
37 | - React-RCTAnimation (= 0.62.2)
38 | - React-RCTBlob (= 0.62.2)
39 | - React-RCTImage (= 0.62.2)
40 | - React-RCTLinking (= 0.62.2)
41 | - React-RCTNetwork (= 0.62.2)
42 | - React-RCTSettings (= 0.62.2)
43 | - React-RCTText (= 0.62.2)
44 | - React-RCTVibration (= 0.62.2)
45 | - React-Core (0.62.2):
46 | - Folly (= 2018.10.22.00)
47 | - glog
48 | - React-Core/Default (= 0.62.2)
49 | - React-cxxreact (= 0.62.2)
50 | - React-jsi (= 0.62.2)
51 | - React-jsiexecutor (= 0.62.2)
52 | - Yoga
53 | - React-Core/CoreModulesHeaders (0.62.2):
54 | - Folly (= 2018.10.22.00)
55 | - glog
56 | - React-Core/Default
57 | - React-cxxreact (= 0.62.2)
58 | - React-jsi (= 0.62.2)
59 | - React-jsiexecutor (= 0.62.2)
60 | - Yoga
61 | - React-Core/Default (0.62.2):
62 | - Folly (= 2018.10.22.00)
63 | - glog
64 | - React-cxxreact (= 0.62.2)
65 | - React-jsi (= 0.62.2)
66 | - React-jsiexecutor (= 0.62.2)
67 | - Yoga
68 | - React-Core/DevSupport (0.62.2):
69 | - Folly (= 2018.10.22.00)
70 | - glog
71 | - React-Core/Default (= 0.62.2)
72 | - React-Core/RCTWebSocket (= 0.62.2)
73 | - React-cxxreact (= 0.62.2)
74 | - React-jsi (= 0.62.2)
75 | - React-jsiexecutor (= 0.62.2)
76 | - React-jsinspector (= 0.62.2)
77 | - Yoga
78 | - React-Core/RCTActionSheetHeaders (0.62.2):
79 | - Folly (= 2018.10.22.00)
80 | - glog
81 | - React-Core/Default
82 | - React-cxxreact (= 0.62.2)
83 | - React-jsi (= 0.62.2)
84 | - React-jsiexecutor (= 0.62.2)
85 | - Yoga
86 | - React-Core/RCTAnimationHeaders (0.62.2):
87 | - Folly (= 2018.10.22.00)
88 | - glog
89 | - React-Core/Default
90 | - React-cxxreact (= 0.62.2)
91 | - React-jsi (= 0.62.2)
92 | - React-jsiexecutor (= 0.62.2)
93 | - Yoga
94 | - React-Core/RCTBlobHeaders (0.62.2):
95 | - Folly (= 2018.10.22.00)
96 | - glog
97 | - React-Core/Default
98 | - React-cxxreact (= 0.62.2)
99 | - React-jsi (= 0.62.2)
100 | - React-jsiexecutor (= 0.62.2)
101 | - Yoga
102 | - React-Core/RCTImageHeaders (0.62.2):
103 | - Folly (= 2018.10.22.00)
104 | - glog
105 | - React-Core/Default
106 | - React-cxxreact (= 0.62.2)
107 | - React-jsi (= 0.62.2)
108 | - React-jsiexecutor (= 0.62.2)
109 | - Yoga
110 | - React-Core/RCTLinkingHeaders (0.62.2):
111 | - Folly (= 2018.10.22.00)
112 | - glog
113 | - React-Core/Default
114 | - React-cxxreact (= 0.62.2)
115 | - React-jsi (= 0.62.2)
116 | - React-jsiexecutor (= 0.62.2)
117 | - Yoga
118 | - React-Core/RCTNetworkHeaders (0.62.2):
119 | - Folly (= 2018.10.22.00)
120 | - glog
121 | - React-Core/Default
122 | - React-cxxreact (= 0.62.2)
123 | - React-jsi (= 0.62.2)
124 | - React-jsiexecutor (= 0.62.2)
125 | - Yoga
126 | - React-Core/RCTSettingsHeaders (0.62.2):
127 | - Folly (= 2018.10.22.00)
128 | - glog
129 | - React-Core/Default
130 | - React-cxxreact (= 0.62.2)
131 | - React-jsi (= 0.62.2)
132 | - React-jsiexecutor (= 0.62.2)
133 | - Yoga
134 | - React-Core/RCTTextHeaders (0.62.2):
135 | - Folly (= 2018.10.22.00)
136 | - glog
137 | - React-Core/Default
138 | - React-cxxreact (= 0.62.2)
139 | - React-jsi (= 0.62.2)
140 | - React-jsiexecutor (= 0.62.2)
141 | - Yoga
142 | - React-Core/RCTVibrationHeaders (0.62.2):
143 | - Folly (= 2018.10.22.00)
144 | - glog
145 | - React-Core/Default
146 | - React-cxxreact (= 0.62.2)
147 | - React-jsi (= 0.62.2)
148 | - React-jsiexecutor (= 0.62.2)
149 | - Yoga
150 | - React-Core/RCTWebSocket (0.62.2):
151 | - Folly (= 2018.10.22.00)
152 | - glog
153 | - React-Core/Default (= 0.62.2)
154 | - React-cxxreact (= 0.62.2)
155 | - React-jsi (= 0.62.2)
156 | - React-jsiexecutor (= 0.62.2)
157 | - Yoga
158 | - React-CoreModules (0.62.2):
159 | - FBReactNativeSpec (= 0.62.2)
160 | - Folly (= 2018.10.22.00)
161 | - RCTTypeSafety (= 0.62.2)
162 | - React-Core/CoreModulesHeaders (= 0.62.2)
163 | - React-RCTImage (= 0.62.2)
164 | - ReactCommon/turbomodule/core (= 0.62.2)
165 | - React-cxxreact (0.62.2):
166 | - boost-for-react-native (= 1.63.0)
167 | - DoubleConversion
168 | - Folly (= 2018.10.22.00)
169 | - glog
170 | - React-jsinspector (= 0.62.2)
171 | - React-jsi (0.62.2):
172 | - boost-for-react-native (= 1.63.0)
173 | - DoubleConversion
174 | - Folly (= 2018.10.22.00)
175 | - glog
176 | - React-jsi/Default (= 0.62.2)
177 | - React-jsi/Default (0.62.2):
178 | - boost-for-react-native (= 1.63.0)
179 | - DoubleConversion
180 | - Folly (= 2018.10.22.00)
181 | - glog
182 | - React-jsiexecutor (0.62.2):
183 | - DoubleConversion
184 | - Folly (= 2018.10.22.00)
185 | - glog
186 | - React-cxxreact (= 0.62.2)
187 | - React-jsi (= 0.62.2)
188 | - React-jsinspector (0.62.2)
189 | - react-native-background-downloader (2.3.4):
190 | - React
191 | - react-native-transcription (0.1.0):
192 | - React
193 | - React-RCTActionSheet (0.62.2):
194 | - React-Core/RCTActionSheetHeaders (= 0.62.2)
195 | - React-RCTAnimation (0.62.2):
196 | - FBReactNativeSpec (= 0.62.2)
197 | - Folly (= 2018.10.22.00)
198 | - RCTTypeSafety (= 0.62.2)
199 | - React-Core/RCTAnimationHeaders (= 0.62.2)
200 | - ReactCommon/turbomodule/core (= 0.62.2)
201 | - React-RCTBlob (0.62.2):
202 | - FBReactNativeSpec (= 0.62.2)
203 | - Folly (= 2018.10.22.00)
204 | - React-Core/RCTBlobHeaders (= 0.62.2)
205 | - React-Core/RCTWebSocket (= 0.62.2)
206 | - React-jsi (= 0.62.2)
207 | - React-RCTNetwork (= 0.62.2)
208 | - ReactCommon/turbomodule/core (= 0.62.2)
209 | - React-RCTImage (0.62.2):
210 | - FBReactNativeSpec (= 0.62.2)
211 | - Folly (= 2018.10.22.00)
212 | - RCTTypeSafety (= 0.62.2)
213 | - React-Core/RCTImageHeaders (= 0.62.2)
214 | - React-RCTNetwork (= 0.62.2)
215 | - ReactCommon/turbomodule/core (= 0.62.2)
216 | - React-RCTLinking (0.62.2):
217 | - FBReactNativeSpec (= 0.62.2)
218 | - React-Core/RCTLinkingHeaders (= 0.62.2)
219 | - ReactCommon/turbomodule/core (= 0.62.2)
220 | - React-RCTNetwork (0.62.2):
221 | - FBReactNativeSpec (= 0.62.2)
222 | - Folly (= 2018.10.22.00)
223 | - RCTTypeSafety (= 0.62.2)
224 | - React-Core/RCTNetworkHeaders (= 0.62.2)
225 | - ReactCommon/turbomodule/core (= 0.62.2)
226 | - React-RCTSettings (0.62.2):
227 | - FBReactNativeSpec (= 0.62.2)
228 | - Folly (= 2018.10.22.00)
229 | - RCTTypeSafety (= 0.62.2)
230 | - React-Core/RCTSettingsHeaders (= 0.62.2)
231 | - ReactCommon/turbomodule/core (= 0.62.2)
232 | - React-RCTText (0.62.2):
233 | - React-Core/RCTTextHeaders (= 0.62.2)
234 | - React-RCTVibration (0.62.2):
235 | - FBReactNativeSpec (= 0.62.2)
236 | - Folly (= 2018.10.22.00)
237 | - React-Core/RCTVibrationHeaders (= 0.62.2)
238 | - ReactCommon/turbomodule/core (= 0.62.2)
239 | - ReactCommon/callinvoker (0.62.2):
240 | - DoubleConversion
241 | - Folly (= 2018.10.22.00)
242 | - glog
243 | - React-cxxreact (= 0.62.2)
244 | - ReactCommon/turbomodule/core (0.62.2):
245 | - DoubleConversion
246 | - Folly (= 2018.10.22.00)
247 | - glog
248 | - React-Core (= 0.62.2)
249 | - React-cxxreact (= 0.62.2)
250 | - React-jsi (= 0.62.2)
251 | - ReactCommon/callinvoker (= 0.62.2)
252 | - RNPermissions (2.1.5):
253 | - React
254 | - Yoga (1.14.0)
255 |
256 | DEPENDENCIES:
257 | - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
258 | - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)
259 | - FBReactNativeSpec (from `../node_modules/react-native/Libraries/FBReactNativeSpec`)
260 | - Folly (from `../node_modules/react-native/third-party-podspecs/Folly.podspec`)
261 | - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
262 | - Permission-Microphone (from `../node_modules/react-native-permissions/ios/Microphone.podspec`)
263 | - Permission-SpeechRecognition (from `../node_modules/react-native-permissions/ios/SpeechRecognition.podspec`)
264 | - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)
265 | - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`)
266 | - React (from `../node_modules/react-native/`)
267 | - React-Core (from `../node_modules/react-native/`)
268 | - React-Core/DevSupport (from `../node_modules/react-native/`)
269 | - React-Core/RCTWebSocket (from `../node_modules/react-native/`)
270 | - React-CoreModules (from `../node_modules/react-native/React/CoreModules`)
271 | - React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`)
272 | - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`)
273 | - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)
274 | - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
275 | - react-native-background-downloader (from `../node_modules/react-native-background-downloader`)
276 | - react-native-transcription (from `../..`)
277 | - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`)
278 | - React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`)
279 | - React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`)
280 | - React-RCTImage (from `../node_modules/react-native/Libraries/Image`)
281 | - React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`)
282 | - React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`)
283 | - React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`)
284 | - React-RCTText (from `../node_modules/react-native/Libraries/Text`)
285 | - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`)
286 | - ReactCommon/callinvoker (from `../node_modules/react-native/ReactCommon`)
287 | - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
288 | - RNPermissions (from `../node_modules/react-native-permissions`)
289 | - Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
290 |
291 | SPEC REPOS:
292 | trunk:
293 | - boost-for-react-native
294 |
295 | EXTERNAL SOURCES:
296 | DoubleConversion:
297 | :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec"
298 | FBLazyVector:
299 | :path: "../node_modules/react-native/Libraries/FBLazyVector"
300 | FBReactNativeSpec:
301 | :path: "../node_modules/react-native/Libraries/FBReactNativeSpec"
302 | Folly:
303 | :podspec: "../node_modules/react-native/third-party-podspecs/Folly.podspec"
304 | glog:
305 | :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec"
306 | Permission-Microphone:
307 | :path: "../node_modules/react-native-permissions/ios/Microphone.podspec"
308 | Permission-SpeechRecognition:
309 | :path: "../node_modules/react-native-permissions/ios/SpeechRecognition.podspec"
310 | RCTRequired:
311 | :path: "../node_modules/react-native/Libraries/RCTRequired"
312 | RCTTypeSafety:
313 | :path: "../node_modules/react-native/Libraries/TypeSafety"
314 | React:
315 | :path: "../node_modules/react-native/"
316 | React-Core:
317 | :path: "../node_modules/react-native/"
318 | React-CoreModules:
319 | :path: "../node_modules/react-native/React/CoreModules"
320 | React-cxxreact:
321 | :path: "../node_modules/react-native/ReactCommon/cxxreact"
322 | React-jsi:
323 | :path: "../node_modules/react-native/ReactCommon/jsi"
324 | React-jsiexecutor:
325 | :path: "../node_modules/react-native/ReactCommon/jsiexecutor"
326 | React-jsinspector:
327 | :path: "../node_modules/react-native/ReactCommon/jsinspector"
328 | react-native-background-downloader:
329 | :path: "../node_modules/react-native-background-downloader"
330 | react-native-transcription:
331 | :path: "../.."
332 | React-RCTActionSheet:
333 | :path: "../node_modules/react-native/Libraries/ActionSheetIOS"
334 | React-RCTAnimation:
335 | :path: "../node_modules/react-native/Libraries/NativeAnimation"
336 | React-RCTBlob:
337 | :path: "../node_modules/react-native/Libraries/Blob"
338 | React-RCTImage:
339 | :path: "../node_modules/react-native/Libraries/Image"
340 | React-RCTLinking:
341 | :path: "../node_modules/react-native/Libraries/LinkingIOS"
342 | React-RCTNetwork:
343 | :path: "../node_modules/react-native/Libraries/Network"
344 | React-RCTSettings:
345 | :path: "../node_modules/react-native/Libraries/Settings"
346 | React-RCTText:
347 | :path: "../node_modules/react-native/Libraries/Text"
348 | React-RCTVibration:
349 | :path: "../node_modules/react-native/Libraries/Vibration"
350 | ReactCommon:
351 | :path: "../node_modules/react-native/ReactCommon"
352 | RNPermissions:
353 | :path: "../node_modules/react-native-permissions"
354 | Yoga:
355 | :path: "../node_modules/react-native/ReactCommon/yoga"
356 |
357 | SPEC CHECKSUMS:
358 | boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
359 | DoubleConversion: 5805e889d232975c086db112ece9ed034df7a0b2
360 | FBLazyVector: 4aab18c93cd9546e4bfed752b4084585eca8b245
361 | FBReactNativeSpec: 5465d51ccfeecb7faa12f9ae0024f2044ce4044e
362 | Folly: 30e7936e1c45c08d884aa59369ed951a8e68cf51
363 | glog: 1f3da668190260b06b429bb211bfbee5cd790c28
364 | Permission-Microphone: af45e35013788b52eecf3cd8f13185c4b6f7bff7
365 | Permission-SpeechRecognition: 844dc75f7165ff00bc0714bedd1c2bd42d6fa076
366 | RCTRequired: cec6a34b3ac8a9915c37e7e4ad3aa74726ce4035
367 | RCTTypeSafety: 93006131180074cffa227a1075802c89a49dd4ce
368 | React: 29a8b1a02bd764fb7644ef04019270849b9a7ac3
369 | React-Core: b12bffb3f567fdf99510acb716ef1abd426e0e05
370 | React-CoreModules: 4a9b87bbe669d6c3173c0132c3328e3b000783d0
371 | React-cxxreact: e65f9c2ba0ac5be946f53548c1aaaee5873a8103
372 | React-jsi: b6dc94a6a12ff98e8877287a0b7620d365201161
373 | React-jsiexecutor: 1540d1c01bb493ae3124ed83351b1b6a155db7da
374 | React-jsinspector: 512e560d0e985d0e8c479a54a4e5c147a9c83493
375 | react-native-background-downloader: f33bf10a731164e272c9101254f63c74b8dc09f9
376 | react-native-transcription: 9b18433b5abcc422492ef8db8ef86348788485e3
377 | React-RCTActionSheet: f41ea8a811aac770e0cc6e0ad6b270c644ea8b7c
378 | React-RCTAnimation: 49ab98b1c1ff4445148b72a3d61554138565bad0
379 | React-RCTBlob: a332773f0ebc413a0ce85942a55b064471587a71
380 | React-RCTImage: e70be9b9c74fe4e42d0005f42cace7981c994ac3
381 | React-RCTLinking: c1b9739a88d56ecbec23b7f63650e44672ab2ad2
382 | React-RCTNetwork: 73138b6f45e5a2768ad93f3d57873c2a18d14b44
383 | React-RCTSettings: 6e3738a87e21b39a8cb08d627e68c44acf1e325a
384 | React-RCTText: fae545b10cfdb3d247c36c56f61a94cfd6dba41d
385 | React-RCTVibration: 4356114dbcba4ce66991096e51a66e61eda51256
386 | ReactCommon: ed4e11d27609d571e7eee8b65548efc191116eb3
387 | RNPermissions: 1888705aebcc81714efa5dbff94351e4388ae012
388 | Yoga: 3ebccbdd559724312790e7742142d062476b698e
389 |
390 | PODFILE CHECKSUM: 50cb54caa0890fdfd9108ef15113d65bf6a90ff8
391 |
392 | COCOAPODS: 1.9.3
393 |
--------------------------------------------------------------------------------
/example/ios/TranscriptionExample-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | //
2 | // Use this file to import your target's public headers that you would like to expose to Swift.
3 | //
4 |
--------------------------------------------------------------------------------
/example/ios/TranscriptionExample.xcodeproj/xcshareddata/xcschemes/TranscriptionExample.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
38 |
39 |
44 |
45 |
51 |
52 |
53 |
54 |
55 |
56 |
66 |
68 |
74 |
75 |
76 |
77 |
81 |
82 |
83 |
84 |
90 |
92 |
98 |
99 |
100 |
101 |
103 |
104 |
107 |
108 |
109 |
--------------------------------------------------------------------------------
/example/ios/TranscriptionExample.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/example/ios/TranscriptionExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/TranscriptionExample/AppDelegate.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #import
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (nonatomic, strong) UIWindow *window;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/example/ios/TranscriptionExample/AppDelegate.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #import "AppDelegate.h"
9 |
10 | #import
11 | #import
12 | #import
13 |
14 |
15 |
16 | @implementation AppDelegate
17 |
18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
19 | {
20 |
21 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
22 | RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
23 | moduleName:@"TranscriptionExample"
24 | initialProperties:nil];
25 |
26 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
27 |
28 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
29 | UIViewController *rootViewController = [UIViewController new];
30 | rootViewController.view = rootView;
31 | self.window.rootViewController = rootViewController;
32 | [self.window makeKeyAndVisible];
33 | return YES;
34 | }
35 |
36 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
37 | {
38 | #if DEBUG
39 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
40 | #else
41 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
42 | #endif
43 | }
44 |
45 | @end
46 |
--------------------------------------------------------------------------------
/example/ios/TranscriptionExample/Base.lproj/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
21 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/example/ios/TranscriptionExample/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/example/ios/TranscriptionExample/Images.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/example/ios/TranscriptionExample/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | Transcription Example
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1
25 | LSRequiresIPhoneOS
26 |
27 | NSAppTransportSecurity
28 |
29 | NSAllowsArbitraryLoads
30 |
31 | NSExceptionDomains
32 |
33 | localhost
34 |
35 | NSExceptionAllowsInsecureHTTPLoads
36 |
37 |
38 |
39 |
40 | NSLocationWhenInUseUsageDescription
41 |
42 | UILaunchStoryboardName
43 | LaunchScreen
44 | UIRequiredDeviceCapabilities
45 |
46 | armv7
47 |
48 | UISupportedInterfaceOrientations
49 |
50 | UIInterfaceOrientationPortrait
51 | UIInterfaceOrientationLandscapeLeft
52 | UIInterfaceOrientationLandscapeRight
53 |
54 | UIViewControllerBasedStatusBarAppearance
55 |
56 | NSMicrophoneUsageDescription
57 | The example uses your mic to transcribe and record text
58 | NSSpeechRecognitionUsageDescription
59 | Might use SFSpeechRecognizer for live transcription.
60 |
61 |
62 |
--------------------------------------------------------------------------------
/example/ios/TranscriptionExample/main.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #import
9 |
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/example/metro.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const blacklist = require('metro-config/src/defaults/blacklist');
3 | const escape = require('escape-string-regexp');
4 | const pak = require('../package.json');
5 |
6 | const root = path.resolve(__dirname, '..');
7 |
8 | const modules = Object.keys({
9 | ...pak.peerDependencies,
10 | });
11 |
12 | module.exports = {
13 | projectRoot: __dirname,
14 | watchFolders: [root],
15 |
16 | // We need to make sure that only one version is loaded for peerDependencies
17 | // So we blacklist them at the root, and alias them to the versions in example's node_modules
18 | resolver: {
19 | blacklistRE: blacklist(
20 | modules.map(
21 | (m) =>
22 | new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`)
23 | )
24 | ),
25 |
26 | extraNodeModules: modules.reduce((acc, name) => {
27 | acc[name] = path.join(__dirname, 'node_modules', name);
28 | return acc;
29 | }, {}),
30 | },
31 |
32 | transformer: {
33 | getTransformOptions: async () => ({
34 | transform: {
35 | experimentalImportSupport: false,
36 | inlineRequires: true,
37 | },
38 | }),
39 | },
40 | };
41 |
--------------------------------------------------------------------------------
/example/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-native-transcription-example",
3 | "description": "Example app for react-native-transcription",
4 | "version": "0.0.1",
5 | "private": true,
6 | "scripts": {
7 | "android": "react-native run-android",
8 | "ios": "react-native run-ios",
9 | "start": "react-native start"
10 | },
11 | "dependencies": {
12 | "react": "16.11.0",
13 | "react-native": "0.62.2",
14 | "react-native-background-downloader": "^2.3.4",
15 | "react-native-permissions": "^2.1.5",
16 | "react-native-progress": "^4.1.2"
17 | },
18 | "devDependencies": {
19 | "@babel/core": "^7.9.6",
20 | "@babel/runtime": "^7.9.6",
21 | "babel-plugin-module-resolver": "^4.0.0",
22 | "metro-react-native-babel-preset": "^0.59.0"
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/example/src/App.js:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { NativeEventEmitter, StyleSheet, View, Text, Button } from 'react-native';
3 | import Transcription from 'react-native-transcription';
4 | import { check, PERMISSIONS, RESULTS, request } from 'react-native-permissions';
5 | import RNBackgroundDownloader from 'react-native-background-downloader';
6 | import * as Progress from 'react-native-progress';
7 |
8 | export default class App extends React.Component {
9 | constructor(props) {
10 | super(props);
11 | this.state = {
12 | result: "Download the model files then tap start."
13 | }// Don't call this.setState() here!
14 | //console.log("Multiply")
15 | //Transcription.multiply(4, 5).then(result => console.log(result))
16 |
17 | let lostTasks = RNBackgroundDownloader.checkForExistingDownloads().then((lostTasks) => {
18 | for (let task of lostTasks) {
19 | console.log(`Task ${task.id} was found!`);
20 | task.progress((percent) => {
21 | console.log(`Downloaded: ${percent * 100}%`);
22 | }).done(() => {
23 | console.log('Downlaod is done!');
24 | }).error((error) => {
25 | console.log('Download canceled due to error: ', error);
26 | });
27 | }
28 | });
29 |
30 |
31 | check(PERMISSIONS.IOS.MICROPHONE)
32 | .then((result) => {
33 | switch (result) {
34 | case RESULTS.UNAVAILABLE:
35 | console.log(
36 | 'This feature is not available (on this device / in this context)',
37 | );
38 | break;
39 | case RESULTS.DENIED:
40 | console.log(
41 | 'The permission has not been requested / is denied but requestable',
42 | );
43 | request(PERMISSIONS.IOS.MICROPHONE);
44 | break;
45 | case RESULTS.GRANTED:
46 | console.log('The permission is granted');
47 | break;
48 | case RESULTS.BLOCKED:
49 | console.log('The permission is denied and not requestable anymore');
50 | break;
51 | }
52 | })
53 | .catch((error) => {
54 | // …
55 | });
56 |
57 | check(PERMISSIONS.ANDROID.RECORD_AUDIO)
58 | .then((result) => {
59 | switch (result) {
60 | case RESULTS.UNAVAILABLE:
61 | console.log(
62 | 'This feature is not available (on this device / in this context)',
63 | );
64 | break;
65 | case RESULTS.DENIED:
66 | console.log(
67 | 'The permission has not been requested / is denied but requestable',
68 | );
69 | console.log("Requesting")
70 | request(PERMISSIONS.ANDROID.RECORD_AUDIO);
71 | break;
72 | case RESULTS.GRANTED:
73 | console.log('The permission is granted');
74 | break;
75 | case RESULTS.BLOCKED:
76 | console.log('The permission is denied and not requestable anymore');
77 | break;
78 | }
79 | })
80 | .catch((error) => {
81 | // …
82 | });
83 |
84 |
85 | }
86 |
87 | componentDidMount() {
88 |
89 | console.log("URI: " + RNBackgroundDownloader.directories.documents);
90 |
91 | TranscriptEvents = new NativeEventEmitter(Transcription);
92 |
93 | this.transcribeUnsubscribe1 = TranscriptEvents.addListener("onRecordingChange", res => {
94 | console.log("onRecordingChange event", res);
95 | var transcription = "";
96 | for(word in res.words){
97 | transcription = (transcription + res.words[word] + " ");
98 | }
99 | this.setState({ result: transcription});
100 | });
101 | this.transcribeUnsubscribe1 = TranscriptEvents.addListener("onRecordingCompletion", res => {
102 | console.log("onRecordingCompletion event", res);
103 | var transcription = "";
104 | for(word in res.words){
105 | transcription = (transcription + res.words[word] + " ");
106 | }
107 | this.setState({ result: transcription});
108 | });
109 | this.transcribeUnsubscribe1 = TranscriptEvents.addListener("onWavTranscribed", res => {
110 | console.log("onWavTranscribed event", res);
111 | var transcription = "";
112 | for(word in res.words){
113 | transcription = (transcription + res.words[word] + " ");
114 | }
115 | this.setState({ result: transcription});
116 | });
117 | }
118 |
119 | startModelDownloads() {
120 | let modelTask = RNBackgroundDownloader.download({
121 | id: 'model',
122 | url: 'https://github.com/mozilla/DeepSpeech/releases/download/v0.9.3/deepspeech-0.9.3-models.tflite',
123 | destination: `${RNBackgroundDownloader.directories.documents}/deepspeech-0.9.3-models.tflite`
124 | }).begin((expectedBytes) => {
125 | console.log(`Going to download ${expectedBytes} bytes!`);
126 | }).progress((percent) => {
127 | console.log(`Downloaded: ${percent * 100}%`);
128 | this.setState({
129 | modelProgress: percent
130 | })
131 | }).done(() => {
132 | console.log('Download is done!');
133 | this.setState({
134 | modelProgress: 0
135 | })
136 | }).error((error) => {
137 | console.log('Download canceled due to error: ', error);
138 | });
139 |
140 |
141 | let scorerTask = RNBackgroundDownloader.download({
142 | id: 'scorer',
143 | url: 'https://github.com/mozilla/DeepSpeech/releases/download/v0.9.3/deepspeech-0.9.3-models.scorer',
144 | destination: `${RNBackgroundDownloader.directories.documents}/deepspeech-0.9.3-models.scorer`
145 | }).begin((expectedBytes) => {
146 | console.log(`Going to download ${expectedBytes} bytes!`);
147 | }).progress((percent) => {
148 | console.log(`Downloaded: ${percent * 100}%`);
149 | this.setState({
150 | scorerProgress: percent
151 | })
152 | }).done(() => {
153 | console.log('Download is done!');
154 | this.setState({
155 | scorerProgress: 0
156 | })
157 | }).error((error) => {
158 | console.log('Download canceled due to error: ', error);
159 | });
160 |
161 | let wavTask = RNBackgroundDownloader.download({
162 | id: 'wav',
163 | url: 'https://www.ee.columbia.edu/~dpwe/sounds/mr/spkr0.wav',
164 | destination: `${RNBackgroundDownloader.directories.documents}/test.wav`
165 | }).begin((expectedBytes) => {
166 | console.log(`Going to download ${expectedBytes} bytes!`);
167 | }).progress((percent) => {
168 | console.log(`Downloaded: ${percent * 100}%`);
169 | this.setState({
170 | wavProgress: percent
171 | })
172 | }).done(() => {
173 | console.log('Download is done!');
174 | this.setState({
175 | wavProgress: 0
176 | })
177 | }).error((error) => {
178 | console.log('Download canceled due to error: ', error);
179 | });
180 |
181 | }
182 |
183 | render() {
184 | return (
185 |
186 | Result: {this.state.result}
187 |
202 | );
203 | }
204 | }
205 |
206 |
207 |
208 | const styles = StyleSheet.create({
209 | container: {
210 | flex: 1,
211 | alignItems: 'center',
212 | justifyContent: 'center',
213 | },
214 | });
215 |
--------------------------------------------------------------------------------
/ios/AudioContext.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AudioContext.swift
3 | // deepspeech_ios_test
4 | //
5 | // Created by Erik Ziegler on 27.07.20.
6 | // Copyright © 2020 Mozilla. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import AVFoundation
11 | import AudioToolbox
12 | import Accelerate
13 |
14 | import deepspeech_ios
15 |
16 | /// Holds audio information used for building waveforms
17 | final class AudioContext {
18 |
19 | /// The audio asset URL used to load the context
20 | public let audioURL: URL
21 |
22 | /// Total number of samples in loaded asset
23 | public let totalSamples: Int
24 |
25 | /// Loaded asset
26 | public let asset: AVAsset
27 |
28 | // Loaded assetTrack
29 | public let assetTrack: AVAssetTrack
30 |
31 | private init(audioURL: URL, totalSamples: Int, asset: AVAsset, assetTrack: AVAssetTrack) {
32 | self.audioURL = audioURL
33 | self.totalSamples = totalSamples
34 | self.asset = asset
35 | self.assetTrack = assetTrack
36 | }
37 |
38 | public static func load(fromAudioURL audioURL: URL, completionHandler: @escaping (_ audioContext: AudioContext?) -> ()) {
39 | let asset = AVURLAsset(url: audioURL, options: [AVURLAssetPreferPreciseDurationAndTimingKey: NSNumber(value: true as Bool)])
40 |
41 | guard let assetTrack = asset.tracks(withMediaType: AVMediaType.audio).first else {
42 | fatalError("Couldn't load AVAssetTrack")
43 | }
44 |
45 | asset.loadValuesAsynchronously(forKeys: ["duration"]) {
46 | var error: NSError?
47 | let status = asset.statusOfValue(forKey: "duration", error: &error)
48 | switch status {
49 | case .loaded:
50 | guard
51 | let formatDescriptions = assetTrack.formatDescriptions as? [CMAudioFormatDescription],
52 | let audioFormatDesc = formatDescriptions.first,
53 | let asbd = CMAudioFormatDescriptionGetStreamBasicDescription(audioFormatDesc)
54 | else { break }
55 |
56 | let totalSamples = Int((asbd.pointee.mSampleRate) * Float64(asset.duration.value) / Float64(asset.duration.timescale))
57 | let audioContext = AudioContext(audioURL: audioURL, totalSamples: totalSamples, asset: asset, assetTrack: assetTrack)
58 | completionHandler(audioContext)
59 | return
60 |
61 | case .failed, .cancelled, .loading, .unknown:
62 | print("Couldn't load asset: \(error?.localizedDescription ?? "Unknown error")")
63 | }
64 |
65 | completionHandler(nil)
66 | }
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/ios/Frameworks/deepspeech_ios.framework/Headers/deepspeech_ios-Swift.h:
--------------------------------------------------------------------------------
1 | // Generated by Apple Swift version 5.4 (swiftlang-1205.0.26.9 clang-1205.0.19.55)
2 | #ifndef DEEPSPEECH_IOS_SWIFT_H
3 | #define DEEPSPEECH_IOS_SWIFT_H
4 | #pragma clang diagnostic push
5 | #pragma clang diagnostic ignored "-Wgcc-compat"
6 |
7 | #if !defined(__has_include)
8 | # define __has_include(x) 0
9 | #endif
10 | #if !defined(__has_attribute)
11 | # define __has_attribute(x) 0
12 | #endif
13 | #if !defined(__has_feature)
14 | # define __has_feature(x) 0
15 | #endif
16 | #if !defined(__has_warning)
17 | # define __has_warning(x) 0
18 | #endif
19 |
20 | #if __has_include()
21 | # include
22 | #endif
23 |
24 | #pragma clang diagnostic ignored "-Wauto-import"
25 | #include
26 | #include
27 | #include
28 | #include
29 |
30 | #if !defined(SWIFT_TYPEDEFS)
31 | # define SWIFT_TYPEDEFS 1
32 | # if __has_include()
33 | # include
34 | # elif !defined(__cplusplus)
35 | typedef uint_least16_t char16_t;
36 | typedef uint_least32_t char32_t;
37 | # endif
38 | typedef float swift_float2 __attribute__((__ext_vector_type__(2)));
39 | typedef float swift_float3 __attribute__((__ext_vector_type__(3)));
40 | typedef float swift_float4 __attribute__((__ext_vector_type__(4)));
41 | typedef double swift_double2 __attribute__((__ext_vector_type__(2)));
42 | typedef double swift_double3 __attribute__((__ext_vector_type__(3)));
43 | typedef double swift_double4 __attribute__((__ext_vector_type__(4)));
44 | typedef int swift_int2 __attribute__((__ext_vector_type__(2)));
45 | typedef int swift_int3 __attribute__((__ext_vector_type__(3)));
46 | typedef int swift_int4 __attribute__((__ext_vector_type__(4)));
47 | typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2)));
48 | typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3)));
49 | typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
50 | #endif
51 |
52 | #if !defined(SWIFT_PASTE)
53 | # define SWIFT_PASTE_HELPER(x, y) x##y
54 | # define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y)
55 | #endif
56 | #if !defined(SWIFT_METATYPE)
57 | # define SWIFT_METATYPE(X) Class
58 | #endif
59 | #if !defined(SWIFT_CLASS_PROPERTY)
60 | # if __has_feature(objc_class_property)
61 | # define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__
62 | # else
63 | # define SWIFT_CLASS_PROPERTY(...)
64 | # endif
65 | #endif
66 |
67 | #if __has_attribute(objc_runtime_name)
68 | # define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
69 | #else
70 | # define SWIFT_RUNTIME_NAME(X)
71 | #endif
72 | #if __has_attribute(swift_name)
73 | # define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X)))
74 | #else
75 | # define SWIFT_COMPILE_NAME(X)
76 | #endif
77 | #if __has_attribute(objc_method_family)
78 | # define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X)))
79 | #else
80 | # define SWIFT_METHOD_FAMILY(X)
81 | #endif
82 | #if __has_attribute(noescape)
83 | # define SWIFT_NOESCAPE __attribute__((noescape))
84 | #else
85 | # define SWIFT_NOESCAPE
86 | #endif
87 | #if __has_attribute(ns_consumed)
88 | # define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed))
89 | #else
90 | # define SWIFT_RELEASES_ARGUMENT
91 | #endif
92 | #if __has_attribute(warn_unused_result)
93 | # define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
94 | #else
95 | # define SWIFT_WARN_UNUSED_RESULT
96 | #endif
97 | #if __has_attribute(noreturn)
98 | # define SWIFT_NORETURN __attribute__((noreturn))
99 | #else
100 | # define SWIFT_NORETURN
101 | #endif
102 | #if !defined(SWIFT_CLASS_EXTRA)
103 | # define SWIFT_CLASS_EXTRA
104 | #endif
105 | #if !defined(SWIFT_PROTOCOL_EXTRA)
106 | # define SWIFT_PROTOCOL_EXTRA
107 | #endif
108 | #if !defined(SWIFT_ENUM_EXTRA)
109 | # define SWIFT_ENUM_EXTRA
110 | #endif
111 | #if !defined(SWIFT_CLASS)
112 | # if __has_attribute(objc_subclassing_restricted)
113 | # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA
114 | # define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
115 | # else
116 | # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
117 | # define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
118 | # endif
119 | #endif
120 | #if !defined(SWIFT_RESILIENT_CLASS)
121 | # if __has_attribute(objc_class_stub)
122 | # define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub))
123 | # define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME)
124 | # else
125 | # define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME)
126 | # define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME)
127 | # endif
128 | #endif
129 |
130 | #if !defined(SWIFT_PROTOCOL)
131 | # define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
132 | # define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
133 | #endif
134 |
135 | #if !defined(SWIFT_EXTENSION)
136 | # define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__)
137 | #endif
138 |
139 | #if !defined(OBJC_DESIGNATED_INITIALIZER)
140 | # if __has_attribute(objc_designated_initializer)
141 | # define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
142 | # else
143 | # define OBJC_DESIGNATED_INITIALIZER
144 | # endif
145 | #endif
146 | #if !defined(SWIFT_ENUM_ATTR)
147 | # if defined(__has_attribute) && __has_attribute(enum_extensibility)
148 | # define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility)))
149 | # else
150 | # define SWIFT_ENUM_ATTR(_extensibility)
151 | # endif
152 | #endif
153 | #if !defined(SWIFT_ENUM)
154 | # define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
155 | # if __has_feature(generalized_swift_name)
156 | # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
157 | # else
158 | # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
159 | # endif
160 | #endif
161 | #if !defined(SWIFT_UNAVAILABLE)
162 | # define SWIFT_UNAVAILABLE __attribute__((unavailable))
163 | #endif
164 | #if !defined(SWIFT_UNAVAILABLE_MSG)
165 | # define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg)))
166 | #endif
167 | #if !defined(SWIFT_AVAILABILITY)
168 | # define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
169 | #endif
170 | #if !defined(SWIFT_WEAK_IMPORT)
171 | # define SWIFT_WEAK_IMPORT __attribute__((weak_import))
172 | #endif
173 | #if !defined(SWIFT_DEPRECATED)
174 | # define SWIFT_DEPRECATED __attribute__((deprecated))
175 | #endif
176 | #if !defined(SWIFT_DEPRECATED_MSG)
177 | # define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__)))
178 | #endif
179 | #if __has_feature(attribute_diagnose_if_objc)
180 | # define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning")))
181 | #else
182 | # define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
183 | #endif
184 | #if !defined(IBSegueAction)
185 | # define IBSegueAction
186 | #endif
187 | #if __has_feature(modules)
188 | #if __has_warning("-Watimport-in-framework-header")
189 | #pragma clang diagnostic ignored "-Watimport-in-framework-header"
190 | #endif
191 | #endif
192 |
193 | #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
194 | #pragma clang diagnostic ignored "-Wduplicate-method-arg"
195 | #if __has_warning("-Wpragma-clang-attribute")
196 | # pragma clang diagnostic ignored "-Wpragma-clang-attribute"
197 | #endif
198 | #pragma clang diagnostic ignored "-Wunknown-pragmas"
199 | #pragma clang diagnostic ignored "-Wnullability"
200 |
201 | #if __has_attribute(external_source_symbol)
202 | # pragma push_macro("any")
203 | # undef any
204 | # pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="deepspeech_ios",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
205 | # pragma pop_macro("any")
206 | #endif
207 |
208 | #if __has_attribute(external_source_symbol)
209 | # pragma clang attribute pop
210 | #endif
211 | #pragma clang diagnostic pop
212 | #endif
213 |
--------------------------------------------------------------------------------
/ios/Frameworks/deepspeech_ios.framework/Headers/deepspeech_ios.h:
--------------------------------------------------------------------------------
1 | //
2 | // deepspeech_ios.h
3 | // deepspeech_ios
4 | //
5 | // Created by Reuben Morais on 14.06.20.
6 | // Copyright © 2020 Mozilla. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | // In this header, you should import all the public headers of your framework using statements like #import
12 |
13 |
14 |
--------------------------------------------------------------------------------
/ios/Frameworks/deepspeech_ios.framework/Info.plist:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReLearnApp/react-native-transcription/8809e9ae01eca460ebf3e0184d77af961b3e39e2/ios/Frameworks/deepspeech_ios.framework/Info.plist
--------------------------------------------------------------------------------
/ios/Frameworks/deepspeech_ios.framework/Modules/deepspeech_ios.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReLearnApp/react-native-transcription/8809e9ae01eca460ebf3e0184d77af961b3e39e2/ios/Frameworks/deepspeech_ios.framework/Modules/deepspeech_ios.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo
--------------------------------------------------------------------------------
/ios/Frameworks/deepspeech_ios.framework/Modules/deepspeech_ios.swiftmodule/Project/arm64.swiftsourceinfo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReLearnApp/react-native-transcription/8809e9ae01eca460ebf3e0184d77af961b3e39e2/ios/Frameworks/deepspeech_ios.framework/Modules/deepspeech_ios.swiftmodule/Project/arm64.swiftsourceinfo
--------------------------------------------------------------------------------
/ios/Frameworks/deepspeech_ios.framework/Modules/deepspeech_ios.swiftmodule/arm64-apple-ios.swiftdoc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReLearnApp/react-native-transcription/8809e9ae01eca460ebf3e0184d77af961b3e39e2/ios/Frameworks/deepspeech_ios.framework/Modules/deepspeech_ios.swiftmodule/arm64-apple-ios.swiftdoc
--------------------------------------------------------------------------------
/ios/Frameworks/deepspeech_ios.framework/Modules/deepspeech_ios.swiftmodule/arm64-apple-ios.swiftinterface:
--------------------------------------------------------------------------------
1 | // swift-interface-format-version: 1.0
2 | // swift-compiler-version: Apple Swift version 5.4 (swiftlang-1205.0.26.9 clang-1205.0.19.55)
3 | // swift-module-flags: -target arm64-apple-ios13.5 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name deepspeech_ios
4 | import Swift
5 | @_exported import deepspeech_ios
6 | import deepspeech_ios.libdeepspeech_Private
7 | public enum DeepSpeechError : Swift.Error {
8 | case noModel(errorCode: Swift.Int32)
9 | case invalidAlphabet(errorCode: Swift.Int32)
10 | case invalidShape(errorCode: Swift.Int32)
11 | case invalidScorer(errorCode: Swift.Int32)
12 | case modelIncompatible(errorCode: Swift.Int32)
13 | case scorerNotEnabled(errorCode: Swift.Int32)
14 | case scorerUnreadable(errorCode: Swift.Int32)
15 | case scorerInvalidLm(errorCode: Swift.Int32)
16 | case scorerNoTrie(errorCode: Swift.Int32)
17 | case scorerInvalidTrie(errorCode: Swift.Int32)
18 | case scorerVersionMismatch(errorCode: Swift.Int32)
19 | case failInitMmap(errorCode: Swift.Int32)
20 | case failInitSess(errorCode: Swift.Int32)
21 | case failInterpreter(errorCode: Swift.Int32)
22 | case failRunSess(errorCode: Swift.Int32)
23 | case failCreateStream(errorCode: Swift.Int32)
24 | case failReadProtobuf(errorCode: Swift.Int32)
25 | case failCreateSess(errorCode: Swift.Int32)
26 | case failCreateModel(errorCode: Swift.Int32)
27 | case invalidErrorCode(errorCode: Swift.Int32)
28 | }
29 | extension DeepSpeechError : Foundation.LocalizedError {
30 | public var errorDescription: Swift.String? {
31 | get
32 | }
33 | }
34 | public struct DeepSpeechTokenMetadata {
35 | public let text: Swift.String
36 | public let timestep: Swift.Int
37 | public let startTime: Swift.Float
38 | }
39 | public struct DeepSpeechCandidateTranscript {
40 | public var tokens: [deepspeech_ios.DeepSpeechTokenMetadata] {
41 | get
42 | }
43 | }
44 | public struct DeepSpeechMetadata {
45 | public var transcripts: [deepspeech_ios.DeepSpeechCandidateTranscript] {
46 | get
47 | }
48 | }
49 | @_hasMissingDesignatedInitializers public class DeepSpeechStream {
50 | @objc deinit
51 | public func feedAudioContent(buffer: Swift.Array)
52 | public func feedAudioContent(buffer: Swift.UnsafeBufferPointer)
53 | public func intermediateDecode() -> Swift.String
54 | public func intermediateDecodeWithMetadata(numResults: Swift.Int) -> deepspeech_ios.DeepSpeechMetadata
55 | public func finishStream() -> Swift.String
56 | public func finishStreamWithMetadata(numResults: Swift.Int) -> deepspeech_ios.DeepSpeechMetadata
57 | }
58 | public class DeepSpeechModel {
59 | public init(modelPath: Swift.String) throws
60 | @objc deinit
61 | public func getBeamWidth() -> Swift.Int
62 | public func setBeamWidth(beamWidth: Swift.Int) throws
63 | public var sampleRate: Swift.Int {
64 | get
65 | }
66 | public func enableExternalScorer(scorerPath: Swift.String) throws
67 | public func disableExternalScorer() throws
68 | public func setScorerAlphaBeta(alpha: Swift.Float, beta: Swift.Float) throws
69 | public func speechToText(buffer: Swift.Array) -> Swift.String
70 | public func speechToText(buffer: Swift.UnsafeBufferPointer) -> Swift.String
71 | public func speechToTextWithMetadata(buffer: Swift.Array, numResults: Swift.Int) -> deepspeech_ios.DeepSpeechMetadata
72 | public func speechToTextWithMetadata(buffer: Swift.UnsafeBufferPointer, numResults: Swift.Int) -> deepspeech_ios.DeepSpeechMetadata
73 | public func createStream() throws -> deepspeech_ios.DeepSpeechStream
74 | }
75 | public func DeepSpeechVersion() -> Swift.String
76 |
--------------------------------------------------------------------------------
/ios/Frameworks/deepspeech_ios.framework/Modules/deepspeech_ios.swiftmodule/arm64-apple-ios.swiftmodule:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReLearnApp/react-native-transcription/8809e9ae01eca460ebf3e0184d77af961b3e39e2/ios/Frameworks/deepspeech_ios.framework/Modules/deepspeech_ios.swiftmodule/arm64-apple-ios.swiftmodule
--------------------------------------------------------------------------------
/ios/Frameworks/deepspeech_ios.framework/Modules/deepspeech_ios.swiftmodule/arm64.swiftdoc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReLearnApp/react-native-transcription/8809e9ae01eca460ebf3e0184d77af961b3e39e2/ios/Frameworks/deepspeech_ios.framework/Modules/deepspeech_ios.swiftmodule/arm64.swiftdoc
--------------------------------------------------------------------------------
/ios/Frameworks/deepspeech_ios.framework/Modules/deepspeech_ios.swiftmodule/arm64.swiftinterface:
--------------------------------------------------------------------------------
1 | // swift-interface-format-version: 1.0
2 | // swift-compiler-version: Apple Swift version 5.4 (swiftlang-1205.0.26.9 clang-1205.0.19.55)
3 | // swift-module-flags: -target arm64-apple-ios13.5 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name deepspeech_ios
4 | import Swift
5 | @_exported import deepspeech_ios
6 | import deepspeech_ios.libdeepspeech_Private
7 | public enum DeepSpeechError : Swift.Error {
8 | case noModel(errorCode: Swift.Int32)
9 | case invalidAlphabet(errorCode: Swift.Int32)
10 | case invalidShape(errorCode: Swift.Int32)
11 | case invalidScorer(errorCode: Swift.Int32)
12 | case modelIncompatible(errorCode: Swift.Int32)
13 | case scorerNotEnabled(errorCode: Swift.Int32)
14 | case scorerUnreadable(errorCode: Swift.Int32)
15 | case scorerInvalidLm(errorCode: Swift.Int32)
16 | case scorerNoTrie(errorCode: Swift.Int32)
17 | case scorerInvalidTrie(errorCode: Swift.Int32)
18 | case scorerVersionMismatch(errorCode: Swift.Int32)
19 | case failInitMmap(errorCode: Swift.Int32)
20 | case failInitSess(errorCode: Swift.Int32)
21 | case failInterpreter(errorCode: Swift.Int32)
22 | case failRunSess(errorCode: Swift.Int32)
23 | case failCreateStream(errorCode: Swift.Int32)
24 | case failReadProtobuf(errorCode: Swift.Int32)
25 | case failCreateSess(errorCode: Swift.Int32)
26 | case failCreateModel(errorCode: Swift.Int32)
27 | case invalidErrorCode(errorCode: Swift.Int32)
28 | }
29 | extension DeepSpeechError : Foundation.LocalizedError {
30 | public var errorDescription: Swift.String? {
31 | get
32 | }
33 | }
34 | public struct DeepSpeechTokenMetadata {
35 | public let text: Swift.String
36 | public let timestep: Swift.Int
37 | public let startTime: Swift.Float
38 | }
39 | public struct DeepSpeechCandidateTranscript {
40 | public var tokens: [deepspeech_ios.DeepSpeechTokenMetadata] {
41 | get
42 | }
43 | }
44 | public struct DeepSpeechMetadata {
45 | public var transcripts: [deepspeech_ios.DeepSpeechCandidateTranscript] {
46 | get
47 | }
48 | }
49 | @_hasMissingDesignatedInitializers public class DeepSpeechStream {
50 | @objc deinit
51 | public func feedAudioContent(buffer: Swift.Array)
52 | public func feedAudioContent(buffer: Swift.UnsafeBufferPointer)
53 | public func intermediateDecode() -> Swift.String
54 | public func intermediateDecodeWithMetadata(numResults: Swift.Int) -> deepspeech_ios.DeepSpeechMetadata
55 | public func finishStream() -> Swift.String
56 | public func finishStreamWithMetadata(numResults: Swift.Int) -> deepspeech_ios.DeepSpeechMetadata
57 | }
58 | public class DeepSpeechModel {
59 | public init(modelPath: Swift.String) throws
60 | @objc deinit
61 | public func getBeamWidth() -> Swift.Int
62 | public func setBeamWidth(beamWidth: Swift.Int) throws
63 | public var sampleRate: Swift.Int {
64 | get
65 | }
66 | public func enableExternalScorer(scorerPath: Swift.String) throws
67 | public func disableExternalScorer() throws
68 | public func setScorerAlphaBeta(alpha: Swift.Float, beta: Swift.Float) throws
69 | public func speechToText(buffer: Swift.Array) -> Swift.String
70 | public func speechToText(buffer: Swift.UnsafeBufferPointer) -> Swift.String
71 | public func speechToTextWithMetadata(buffer: Swift.Array, numResults: Swift.Int) -> deepspeech_ios.DeepSpeechMetadata
72 | public func speechToTextWithMetadata(buffer: Swift.UnsafeBufferPointer, numResults: Swift.Int) -> deepspeech_ios.DeepSpeechMetadata
73 | public func createStream() throws -> deepspeech_ios.DeepSpeechStream
74 | }
75 | public func DeepSpeechVersion() -> Swift.String
76 |
--------------------------------------------------------------------------------
/ios/Frameworks/deepspeech_ios.framework/Modules/deepspeech_ios.swiftmodule/arm64.swiftmodule:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReLearnApp/react-native-transcription/8809e9ae01eca460ebf3e0184d77af961b3e39e2/ios/Frameworks/deepspeech_ios.framework/Modules/deepspeech_ios.swiftmodule/arm64.swiftmodule
--------------------------------------------------------------------------------
/ios/Frameworks/deepspeech_ios.framework/Modules/module.modulemap:
--------------------------------------------------------------------------------
1 | framework module deepspeech_ios {
2 | umbrella header "deepspeech_ios.h"
3 |
4 | export *
5 | module * { export * }
6 |
7 | explicit module libdeepspeech_Private {
8 | header "deepspeech.h"
9 | export *
10 | link "deepspeech"
11 | }
12 | }
13 |
14 | module deepspeech_ios.Swift {
15 | header "deepspeech_ios-Swift.h"
16 | requires objc
17 | }
18 |
--------------------------------------------------------------------------------
/ios/Frameworks/deepspeech_ios.framework/PrivateHeaders/deepspeech.h:
--------------------------------------------------------------------------------
1 | #ifndef DEEPSPEECH_H
2 | #define DEEPSPEECH_H
3 |
4 | #ifdef __cplusplus
5 | extern "C" {
6 | #endif
7 |
8 | #ifndef SWIG
9 | #if defined _MSC_VER
10 | #define DEEPSPEECH_EXPORT __declspec(dllexport)
11 | #else
12 | #define DEEPSPEECH_EXPORT __attribute__ ((visibility("default")))
13 | #endif /*End of _MSC_VER*/
14 | #else
15 | #define DEEPSPEECH_EXPORT
16 | #endif
17 |
18 | typedef struct ModelState ModelState;
19 |
20 | typedef struct StreamingState StreamingState;
21 |
22 | /**
23 | * @brief Stores text of an individual token, along with its timing information
24 | */
25 | typedef struct TokenMetadata {
26 | /** The text corresponding to this token */
27 | const char* const text;
28 |
29 | /** Position of the token in units of 20ms */
30 | const unsigned int timestep;
31 |
32 | /** Position of the token in seconds */
33 | const float start_time;
34 | } TokenMetadata;
35 |
36 | /**
37 | * @brief A single transcript computed by the model, including a confidence
38 | * value and the metadata for its constituent tokens.
39 | */
40 | typedef struct CandidateTranscript {
41 | /** Array of TokenMetadata objects */
42 | const TokenMetadata* const tokens;
43 | /** Size of the tokens array */
44 | const unsigned int num_tokens;
45 | /** Approximated confidence value for this transcript. This is roughly the
46 | * sum of the acoustic model logit values for each timestep/character that
47 | * contributed to the creation of this transcript.
48 | */
49 | const double confidence;
50 | } CandidateTranscript;
51 |
52 | /**
53 | * @brief An array of CandidateTranscript objects computed by the model.
54 | */
55 | typedef struct Metadata {
56 | /** Array of CandidateTranscript objects */
57 | const CandidateTranscript* const transcripts;
58 | /** Size of the transcripts array */
59 | const unsigned int num_transcripts;
60 | } Metadata;
61 |
62 | // sphinx-doc: error_code_listing_start
63 |
64 | #define DS_FOR_EACH_ERROR(APPLY) \
65 | APPLY(DS_ERR_OK, 0x0000, "No error.") \
66 | APPLY(DS_ERR_NO_MODEL, 0x1000, "Missing model information.") \
67 | APPLY(DS_ERR_INVALID_ALPHABET, 0x2000, "Invalid alphabet embedded in model. (Data corruption?)") \
68 | APPLY(DS_ERR_INVALID_SHAPE, 0x2001, "Invalid model shape.") \
69 | APPLY(DS_ERR_INVALID_SCORER, 0x2002, "Invalid scorer file.") \
70 | APPLY(DS_ERR_MODEL_INCOMPATIBLE, 0x2003, "Incompatible model.") \
71 | APPLY(DS_ERR_SCORER_NOT_ENABLED, 0x2004, "External scorer is not enabled.") \
72 | APPLY(DS_ERR_SCORER_UNREADABLE, 0x2005, "Could not read scorer file.") \
73 | APPLY(DS_ERR_SCORER_INVALID_LM, 0x2006, "Could not recognize language model header in scorer.") \
74 | APPLY(DS_ERR_SCORER_NO_TRIE, 0x2007, "Reached end of scorer file before loading vocabulary trie.") \
75 | APPLY(DS_ERR_SCORER_INVALID_TRIE, 0x2008, "Invalid magic in trie header.") \
76 | APPLY(DS_ERR_SCORER_VERSION_MISMATCH, 0x2009, "Scorer file version does not match expected version.") \
77 | APPLY(DS_ERR_FAIL_INIT_MMAP, 0x3000, "Failed to initialize memory mapped model.") \
78 | APPLY(DS_ERR_FAIL_INIT_SESS, 0x3001, "Failed to initialize the session.") \
79 | APPLY(DS_ERR_FAIL_INTERPRETER, 0x3002, "Interpreter failed.") \
80 | APPLY(DS_ERR_FAIL_RUN_SESS, 0x3003, "Failed to run the session.") \
81 | APPLY(DS_ERR_FAIL_CREATE_STREAM, 0x3004, "Error creating the stream.") \
82 | APPLY(DS_ERR_FAIL_READ_PROTOBUF, 0x3005, "Error reading the proto buffer model file.") \
83 | APPLY(DS_ERR_FAIL_CREATE_SESS, 0x3006, "Failed to create session.") \
84 | APPLY(DS_ERR_FAIL_CREATE_MODEL, 0x3007, "Could not allocate model state.") \
85 | APPLY(DS_ERR_FAIL_INSERT_HOTWORD, 0x3008, "Could not insert hot-word.") \
86 | APPLY(DS_ERR_FAIL_CLEAR_HOTWORD, 0x3009, "Could not clear hot-words.") \
87 | APPLY(DS_ERR_FAIL_ERASE_HOTWORD, 0x3010, "Could not erase hot-word.")
88 |
89 | // sphinx-doc: error_code_listing_end
90 |
91 | enum DeepSpeech_Error_Codes
92 | {
93 | #define DEFINE(NAME, VALUE, DESC) NAME = VALUE,
94 | DS_FOR_EACH_ERROR(DEFINE)
95 | #undef DEFINE
96 | };
97 |
98 | /**
99 | * @brief An object providing an interface to a trained DeepSpeech model.
100 | *
101 | * @param aModelPath The path to the frozen model graph.
102 | * @param[out] retval a ModelState pointer
103 | *
104 | * @return Zero on success, non-zero on failure.
105 | */
106 | DEEPSPEECH_EXPORT
107 | int DS_CreateModel(const char* aModelPath,
108 | ModelState** retval);
109 |
110 | /**
111 | * @brief Get beam width value used by the model. If {@link DS_SetModelBeamWidth}
112 | * was not called before, will return the default value loaded from the
113 | * model file.
114 | *
115 | * @param aCtx A ModelState pointer created with {@link DS_CreateModel}.
116 | *
117 | * @return Beam width value used by the model.
118 | */
119 | DEEPSPEECH_EXPORT
120 | unsigned int DS_GetModelBeamWidth(const ModelState* aCtx);
121 |
122 | /**
123 | * @brief Set beam width value used by the model.
124 | *
125 | * @param aCtx A ModelState pointer created with {@link DS_CreateModel}.
126 | * @param aBeamWidth The beam width used by the model. A larger beam width value
127 | * generates better results at the cost of decoding time.
128 | *
129 | * @return Zero on success, non-zero on failure.
130 | */
131 | DEEPSPEECH_EXPORT
132 | int DS_SetModelBeamWidth(ModelState* aCtx,
133 | unsigned int aBeamWidth);
134 |
135 | /**
136 | * @brief Return the sample rate expected by a model.
137 | *
138 | * @param aCtx A ModelState pointer created with {@link DS_CreateModel}.
139 | *
140 | * @return Sample rate expected by the model for its input.
141 | */
142 | DEEPSPEECH_EXPORT
143 | int DS_GetModelSampleRate(const ModelState* aCtx);
144 |
145 | /**
146 | * @brief Frees associated resources and destroys model object.
147 | */
148 | DEEPSPEECH_EXPORT
149 | void DS_FreeModel(ModelState* ctx);
150 |
151 | /**
152 | * @brief Enable decoding using an external scorer.
153 | *
154 | * @param aCtx The ModelState pointer for the model being changed.
155 | * @param aScorerPath The path to the external scorer file.
156 | *
157 | * @return Zero on success, non-zero on failure (invalid arguments).
158 | */
159 | DEEPSPEECH_EXPORT
160 | int DS_EnableExternalScorer(ModelState* aCtx,
161 | const char* aScorerPath);
162 |
163 | /**
164 | * @brief Add a hot-word and its boost.
165 | *
166 | * Words that don't occur in the scorer (e.g. proper nouns) or strings that contain spaces won't be taken into account.
167 | *
168 | * @param aCtx The ModelState pointer for the model being changed.
169 | * @param word The hot-word.
170 | * @param boost The boost. Positive value increases and negative reduces chance of a word occuring in a transcription. Excessive positive boost might lead to splitting up of letters of the word following the hot-word.
171 | *
172 | * @return Zero on success, non-zero on failure (invalid arguments).
173 | */
174 | DEEPSPEECH_EXPORT
175 | int DS_AddHotWord(ModelState* aCtx,
176 | const char* word,
177 | float boost);
178 |
179 | /**
180 | * @brief Remove entry for a hot-word from the hot-words map.
181 | *
182 | * @param aCtx The ModelState pointer for the model being changed.
183 | * @param word The hot-word.
184 | *
185 | * @return Zero on success, non-zero on failure (invalid arguments).
186 | */
187 | DEEPSPEECH_EXPORT
188 | int DS_EraseHotWord(ModelState* aCtx,
189 | const char* word);
190 |
191 | /**
192 | * @brief Removes all elements from the hot-words map.
193 | *
194 | * @param aCtx The ModelState pointer for the model being changed.
195 | *
196 | * @return Zero on success, non-zero on failure (invalid arguments).
197 | */
198 | DEEPSPEECH_EXPORT
199 | int DS_ClearHotWords(ModelState* aCtx);
200 |
201 | /**
202 | * @brief Disable decoding using an external scorer.
203 | *
204 | * @param aCtx The ModelState pointer for the model being changed.
205 | *
206 | * @return Zero on success, non-zero on failure.
207 | */
208 | DEEPSPEECH_EXPORT
209 | int DS_DisableExternalScorer(ModelState* aCtx);
210 |
211 | /**
212 | * @brief Set hyperparameters alpha and beta of the external scorer.
213 | *
214 | * @param aCtx The ModelState pointer for the model being changed.
215 | * @param aAlpha The alpha hyperparameter of the decoder. Language model weight.
216 | * @param aLMBeta The beta hyperparameter of the decoder. Word insertion weight.
217 | *
218 | * @return Zero on success, non-zero on failure.
219 | */
220 | DEEPSPEECH_EXPORT
221 | int DS_SetScorerAlphaBeta(ModelState* aCtx,
222 | float aAlpha,
223 | float aBeta);
224 |
225 | /**
226 | * @brief Use the DeepSpeech model to convert speech to text.
227 | *
228 | * @param aCtx The ModelState pointer for the model to use.
229 | * @param aBuffer A 16-bit, mono raw audio signal at the appropriate
230 | * sample rate (matching what the model was trained on).
231 | * @param aBufferSize The number of samples in the audio signal.
232 | *
233 | * @return The STT result. The user is responsible for freeing the string using
234 | * {@link DS_FreeString()}. Returns NULL on error.
235 | */
236 | DEEPSPEECH_EXPORT
237 | char* DS_SpeechToText(ModelState* aCtx,
238 | const short* aBuffer,
239 | unsigned int aBufferSize);
240 |
241 | /**
242 | * @brief Use the DeepSpeech model to convert speech to text and output results
243 | * including metadata.
244 | *
245 | * @param aCtx The ModelState pointer for the model to use.
246 | * @param aBuffer A 16-bit, mono raw audio signal at the appropriate
247 | * sample rate (matching what the model was trained on).
248 | * @param aBufferSize The number of samples in the audio signal.
249 | * @param aNumResults The maximum number of CandidateTranscript structs to return. Returned value might be smaller than this.
250 | *
251 | * @return Metadata struct containing multiple CandidateTranscript structs. Each
252 | * transcript has per-token metadata including timing information. The
253 | * user is responsible for freeing Metadata by calling {@link DS_FreeMetadata()}.
254 | * Returns NULL on error.
255 | */
256 | DEEPSPEECH_EXPORT
257 | Metadata* DS_SpeechToTextWithMetadata(ModelState* aCtx,
258 | const short* aBuffer,
259 | unsigned int aBufferSize,
260 | unsigned int aNumResults);
261 |
262 | /**
263 | * @brief Create a new streaming inference state. The streaming state returned
264 | * by this function can then be passed to {@link DS_FeedAudioContent()}
265 | * and {@link DS_FinishStream()}.
266 | *
267 | * @param aCtx The ModelState pointer for the model to use.
268 | * @param[out] retval an opaque pointer that represents the streaming state. Can
269 | * be NULL if an error occurs.
270 | *
271 | * @return Zero for success, non-zero on failure.
272 | */
273 | DEEPSPEECH_EXPORT
274 | int DS_CreateStream(ModelState* aCtx,
275 | StreamingState** retval);
276 |
277 | /**
278 | * @brief Feed audio samples to an ongoing streaming inference.
279 | *
280 | * @param aSctx A streaming state pointer returned by {@link DS_CreateStream()}.
281 | * @param aBuffer An array of 16-bit, mono raw audio samples at the
282 | * appropriate sample rate (matching what the model was trained on).
283 | * @param aBufferSize The number of samples in @p aBuffer.
284 | */
285 | DEEPSPEECH_EXPORT
286 | void DS_FeedAudioContent(StreamingState* aSctx,
287 | const short* aBuffer,
288 | unsigned int aBufferSize);
289 |
290 | /**
291 | * @brief Compute the intermediate decoding of an ongoing streaming inference.
292 | *
293 | * @param aSctx A streaming state pointer returned by {@link DS_CreateStream()}.
294 | *
295 | * @return The STT intermediate result. The user is responsible for freeing the
296 | * string using {@link DS_FreeString()}.
297 | */
298 | DEEPSPEECH_EXPORT
299 | char* DS_IntermediateDecode(const StreamingState* aSctx);
300 |
301 | /**
302 | * @brief Compute the intermediate decoding of an ongoing streaming inference,
303 | * return results including metadata.
304 | *
305 | * @param aSctx A streaming state pointer returned by {@link DS_CreateStream()}.
306 | * @param aNumResults The number of candidate transcripts to return.
307 | *
308 | * @return Metadata struct containing multiple candidate transcripts. Each transcript
309 | * has per-token metadata including timing information. The user is
310 | * responsible for freeing Metadata by calling {@link DS_FreeMetadata()}.
311 | * Returns NULL on error.
312 | */
313 | DEEPSPEECH_EXPORT
314 | Metadata* DS_IntermediateDecodeWithMetadata(const StreamingState* aSctx,
315 | unsigned int aNumResults);
316 |
317 | /**
318 | * @brief Compute the final decoding of an ongoing streaming inference and return
319 | * the result. Signals the end of an ongoing streaming inference.
320 | *
321 | * @param aSctx A streaming state pointer returned by {@link DS_CreateStream()}.
322 | *
323 | * @return The STT result. The user is responsible for freeing the string using
324 | * {@link DS_FreeString()}.
325 | *
326 | * @note This method will free the state pointer (@p aSctx).
327 | */
328 | DEEPSPEECH_EXPORT
329 | char* DS_FinishStream(StreamingState* aSctx);
330 |
331 | /**
332 | * @brief Compute the final decoding of an ongoing streaming inference and return
333 | * results including metadata. Signals the end of an ongoing streaming
334 | * inference.
335 | *
336 | * @param aSctx A streaming state pointer returned by {@link DS_CreateStream()}.
337 | * @param aNumResults The number of candidate transcripts to return.
338 | *
339 | * @return Metadata struct containing multiple candidate transcripts. Each transcript
340 | * has per-token metadata including timing information. The user is
341 | * responsible for freeing Metadata by calling {@link DS_FreeMetadata()}.
342 | * Returns NULL on error.
343 | *
344 | * @note This method will free the state pointer (@p aSctx).
345 | */
346 | DEEPSPEECH_EXPORT
347 | Metadata* DS_FinishStreamWithMetadata(StreamingState* aSctx,
348 | unsigned int aNumResults);
349 |
350 | /**
351 | * @brief Destroy a streaming state without decoding the computed logits. This
352 | * can be used if you no longer need the result of an ongoing streaming
353 | * inference and don't want to perform a costly decode operation.
354 | *
355 | * @param aSctx A streaming state pointer returned by {@link DS_CreateStream()}.
356 | *
357 | * @note This method will free the state pointer (@p aSctx).
358 | */
359 | DEEPSPEECH_EXPORT
360 | void DS_FreeStream(StreamingState* aSctx);
361 |
362 | /**
363 | * @brief Free memory allocated for metadata information.
364 | */
365 | DEEPSPEECH_EXPORT
366 | void DS_FreeMetadata(Metadata* m);
367 |
368 | /**
369 | * @brief Free a char* string returned by the DeepSpeech API.
370 | */
371 | DEEPSPEECH_EXPORT
372 | void DS_FreeString(char* str);
373 |
374 | /**
375 | * @brief Returns the version of this library. The returned version is a semantic
376 | * version (SemVer 2.0.0). The string returned must be freed with {@link DS_FreeString()}.
377 | *
378 | * @return The version string.
379 | */
380 | DEEPSPEECH_EXPORT
381 | char* DS_Version();
382 |
383 | /**
384 | * @brief Returns a textual description corresponding to an error code.
385 | * The string returned must be freed with @{link DS_FreeString()}.
386 | *
387 | * @return The error description.
388 | */
389 | DEEPSPEECH_EXPORT
390 | char* DS_ErrorCodeToErrorMessage(int aErrorCode);
391 |
392 | #undef DEEPSPEECH_EXPORT
393 |
394 | #ifdef __cplusplus
395 | }
396 | #endif
397 |
398 | #endif /* DEEPSPEECH_H */
399 |
--------------------------------------------------------------------------------
/ios/Frameworks/deepspeech_ios.framework/_CodeSignature/CodeResources:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | files
6 |
7 | Headers/deepspeech_ios-Swift.h
8 |
9 | HdHhtwXx2EVoYzDH8IkqH21Tw4c=
10 |
11 | Headers/deepspeech_ios.h
12 |
13 | +yLtvBxXo20e9TmpFWEjr5O7HFo=
14 |
15 | Info.plist
16 |
17 | 9i1ifMZJhaDdO4QM6Bn6IWm4enw=
18 |
19 | Modules/deepspeech_ios.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo
20 |
21 | bKbLnhW+N68iztuadR1hrqBgTMA=
22 |
23 | Modules/deepspeech_ios.swiftmodule/Project/arm64.swiftsourceinfo
24 |
25 | bKbLnhW+N68iztuadR1hrqBgTMA=
26 |
27 | Modules/deepspeech_ios.swiftmodule/arm64-apple-ios.swiftdoc
28 |
29 | vD95bAuHYc5dghU0A9x3mheLyMg=
30 |
31 | Modules/deepspeech_ios.swiftmodule/arm64-apple-ios.swiftinterface
32 |
33 | ygPpP5eLR0at/40g1t2TbYdXbwY=
34 |
35 | Modules/deepspeech_ios.swiftmodule/arm64-apple-ios.swiftmodule
36 |
37 | 9vQbMMWZYLPcwfNRpn4wKWOyz4g=
38 |
39 | Modules/deepspeech_ios.swiftmodule/arm64.swiftdoc
40 |
41 | vD95bAuHYc5dghU0A9x3mheLyMg=
42 |
43 | Modules/deepspeech_ios.swiftmodule/arm64.swiftinterface
44 |
45 | ygPpP5eLR0at/40g1t2TbYdXbwY=
46 |
47 | Modules/deepspeech_ios.swiftmodule/arm64.swiftmodule
48 |
49 | 9vQbMMWZYLPcwfNRpn4wKWOyz4g=
50 |
51 | Modules/module.modulemap
52 |
53 | iu3NsOSjRujnk/v4N8UcmCxFkn4=
54 |
55 | PrivateHeaders/deepspeech.h
56 |
57 | YHq0Z15iZ/ndtHoNefOes/uGOkg=
58 |
59 |
60 | files2
61 |
62 | Headers/deepspeech_ios-Swift.h
63 |
64 | hash2
65 |
66 | seHNN3rrj9vLqHC6IGrTXWM5rP+cWwniRKbkLbam3mw=
67 |
68 |
69 | Headers/deepspeech_ios.h
70 |
71 | hash2
72 |
73 | PDqpHg0s7/hiXhReCFf/JRhovmJDJxMx9QN4lsmz70M=
74 |
75 |
76 | Modules/deepspeech_ios.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo
77 |
78 | hash2
79 |
80 | aUxFbI+71zSEWowEi7PD7LiCiMVRaRNPEeh4iCzKHzo=
81 |
82 |
83 | Modules/deepspeech_ios.swiftmodule/Project/arm64.swiftsourceinfo
84 |
85 | hash2
86 |
87 | aUxFbI+71zSEWowEi7PD7LiCiMVRaRNPEeh4iCzKHzo=
88 |
89 |
90 | Modules/deepspeech_ios.swiftmodule/arm64-apple-ios.swiftdoc
91 |
92 | hash2
93 |
94 | ql2MRJaFq/h8YxBK5aaTDCAgBqAmWv6z5rqq/WL3MFw=
95 |
96 |
97 | Modules/deepspeech_ios.swiftmodule/arm64-apple-ios.swiftinterface
98 |
99 | hash2
100 |
101 | tLPn7HhmiWLoD8bWBbiOgO61z0v0TSKjhLfWx/KwG3s=
102 |
103 |
104 | Modules/deepspeech_ios.swiftmodule/arm64-apple-ios.swiftmodule
105 |
106 | hash2
107 |
108 | XOuXGxviu8mZW71KWcuidxYrVE9Vsd6LyH5lmzmGqpc=
109 |
110 |
111 | Modules/deepspeech_ios.swiftmodule/arm64.swiftdoc
112 |
113 | hash2
114 |
115 | ql2MRJaFq/h8YxBK5aaTDCAgBqAmWv6z5rqq/WL3MFw=
116 |
117 |
118 | Modules/deepspeech_ios.swiftmodule/arm64.swiftinterface
119 |
120 | hash2
121 |
122 | tLPn7HhmiWLoD8bWBbiOgO61z0v0TSKjhLfWx/KwG3s=
123 |
124 |
125 | Modules/deepspeech_ios.swiftmodule/arm64.swiftmodule
126 |
127 | hash2
128 |
129 | XOuXGxviu8mZW71KWcuidxYrVE9Vsd6LyH5lmzmGqpc=
130 |
131 |
132 | Modules/module.modulemap
133 |
134 | hash2
135 |
136 | qGyFyOjMREVcKiMLklU4ERzYa7Hbd43q0Z9Y5JF6dU8=
137 |
138 |
139 | PrivateHeaders/deepspeech.h
140 |
141 | hash2
142 |
143 | GRnWuU7+biCmqnIoRNtGagqKhT9y3aQO1vUg8JTFzDk=
144 |
145 |
146 |
147 | rules
148 |
149 | ^.*
150 |
151 | ^.*\.lproj/
152 |
153 | optional
154 |
155 | weight
156 | 1000
157 |
158 | ^.*\.lproj/locversion.plist$
159 |
160 | omit
161 |
162 | weight
163 | 1100
164 |
165 | ^Base\.lproj/
166 |
167 | weight
168 | 1010
169 |
170 | ^version.plist$
171 |
172 |
173 | rules2
174 |
175 | .*\.dSYM($|/)
176 |
177 | weight
178 | 11
179 |
180 | ^(.*/)?\.DS_Store$
181 |
182 | omit
183 |
184 | weight
185 | 2000
186 |
187 | ^.*
188 |
189 | ^.*\.lproj/
190 |
191 | optional
192 |
193 | weight
194 | 1000
195 |
196 | ^.*\.lproj/locversion.plist$
197 |
198 | omit
199 |
200 | weight
201 | 1100
202 |
203 | ^Base\.lproj/
204 |
205 | weight
206 | 1010
207 |
208 | ^Info\.plist$
209 |
210 | omit
211 |
212 | weight
213 | 20
214 |
215 | ^PkgInfo$
216 |
217 | omit
218 |
219 | weight
220 | 20
221 |
222 | ^embedded\.provisionprofile$
223 |
224 | weight
225 | 20
226 |
227 | ^version\.plist$
228 |
229 | weight
230 | 20
231 |
232 |
233 |
234 |
235 |
--------------------------------------------------------------------------------
/ios/Frameworks/deepspeech_ios.framework/deepspeech_ios:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReLearnApp/react-native-transcription/8809e9ae01eca460ebf3e0184d77af961b3e39e2/ios/Frameworks/deepspeech_ios.framework/deepspeech_ios
--------------------------------------------------------------------------------
/ios/Transcription-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 |
--------------------------------------------------------------------------------
/ios/Transcription.m:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 | @interface RCT_EXTERN_MODULE(Transcription, RCTEventEmitter)
4 |
5 | RCT_EXTERN_METHOD(multiply:(float)a withB:(float)b
6 | withResolver:(RCTPromiseResolveBlock)resolve
7 | withRejecter:(RCTPromiseRejectBlock)reject)
8 | RCT_EXTERN_METHOD(transcribeWav:(NSString *)wavPath withB:(NSString *)modelPath withC:(NSString *)scorerPath)
9 |
10 | @end
11 |
--------------------------------------------------------------------------------
/ios/Transcription.swift:
--------------------------------------------------------------------------------
1 | import deepspeech_ios
2 | import Foundation
3 | import AVFoundation
4 | import AudioToolbox
5 | import Accelerate
6 |
7 | @objc(Transcription)
8 | class Transcription: RCTEventEmitter {
9 |
10 | @objc(multiply:withB:withResolver:withRejecter:)
11 | func multiply(a: Float, b: Float, resolve:RCTPromiseResolveBlock,reject:RCTPromiseRejectBlock) -> Void {
12 | resolve(a*b)
13 | }
14 | private var model: DeepSpeechModel?
15 | private var stream: DeepSpeechStream?
16 |
17 | @objc(transcribeWav:withB:withC:)
18 | func transcribeWav(wavPath: String, modelPath: String, scorerPath: String) {
19 | //let modelPath = Bundle.main.path(forResource: "deepspeech-0.8.0-models", ofType: "tflite")!
20 | //let scorerPath = Bundle.main.path(forResource: "deepspeech-0.8.0-models", ofType: "scorer")!
21 |
22 | model = try! DeepSpeechModel(modelPath: modelPath)
23 | try! model!.enableExternalScorer(scorerPath: scorerPath)
24 | //try! model!.setScorerAlphaBeta(alpha: 0.931289039105002, beta: 1.1834137581510284)
25 |
26 | recognizeFile(audioPath: wavPath)
27 | }
28 |
29 | // MARK: Audio file recognition
30 |
31 | private func render(audioContext: AudioContext?, stream: DeepSpeechStream) {
32 | guard let audioContext = audioContext else {
33 | fatalError("Couldn't create the audioContext")
34 | }
35 |
36 | let sampleRange: CountableRange = 0..?
73 | CMBlockBufferGetDataPointer(readBuffer,
74 | atOffset: 0,
75 | lengthAtOffsetOut: &readBufferLength,
76 | totalLengthOut: nil,
77 | dataPointerOut: &readBufferPointer)
78 | sampleBuffer.append(UnsafeBufferPointer(start: readBufferPointer, count: readBufferLength))
79 | CMSampleBufferInvalidate(readSampleBuffer)
80 |
81 | let totalSamples = sampleBuffer.count / MemoryLayout.size
82 | print("read \(totalSamples) samples")
83 |
84 | sampleBuffer.withUnsafeBytes { (samples: UnsafeRawBufferPointer) in
85 | let unsafeBufferPointer = samples.bindMemory(to: Int16.self)
86 | stream.feedAudioContent(buffer: unsafeBufferPointer)
87 | }
88 |
89 | sampleBuffer.removeAll()
90 | }
91 |
92 | // if (reader.status == AVAssetReaderStatusFailed || reader.status == AVAssetReaderStatusUnknown)
93 | guard reader.status == .completed else {
94 | fatalError("Couldn't read the audio file")
95 | }
96 | }
97 |
98 | private func recognizeFile(audioPath: String) {
99 | let url = URL(fileURLWithPath: audioPath)
100 |
101 | let stream = try! model!.createStream()
102 | print("\(audioPath)")
103 | let start = CFAbsoluteTimeGetCurrent()
104 | AudioContext.load(fromAudioURL: url, completionHandler: { audioContext in
105 | guard let audioContext = audioContext else {
106 | fatalError("Couldn't create the audioContext")
107 | }
108 | self.render(audioContext: audioContext, stream: stream)
109 | // HACK: workaround for finishWithMetadata resulting in a malloc free of a pointer already freed.
110 | let result = stream.intermediateDecodeWithMetadata(numResults: 1)
111 | let string = stream.finishStream()
112 | let end = CFAbsoluteTimeGetCurrent()
113 | print("\"\(audioPath)\": \(end - start) - (result)")
114 |
115 |
116 | self.sendTranscription(decoded: result, event: "onWavTranscribed")
117 | // Free model
118 | self.model = nil
119 | })
120 | }
121 |
122 | private func sendTranscription(decoded: DeepSpeechMetadata, event: String) {
123 | let transcriptCandidate = decoded.transcripts[0].tokens
124 | var words = [String]()
125 | var timestamps = [Int]()
126 |
127 | var workingString = ""
128 | var lastTimestamp = -1
129 | for token in transcriptCandidate {
130 | let text = token.text
131 | let timestamp = token.startTime
132 | if(lastTimestamp == -1){
133 | lastTimestamp = Int(timestamp)
134 | }
135 | if(text == " "){
136 | // Append timestamp, reset string, reset timestamp to -1
137 | words.append(workingString)
138 | timestamps.append(lastTimestamp)
139 | workingString = ""
140 | lastTimestamp = -1
141 | }else{
142 | workingString.append(text)
143 | }
144 | }
145 | words.append(workingString)
146 | timestamps.append(lastTimestamp)
147 | self.sendEvent(withName: event, body: ["words": words, "timestamps": timestamps])
148 | //map.putArray("words", words)
149 | //map.putArray("timestamps", timestamps)
150 | return;
151 | }
152 |
153 |
154 | override func supportedEvents() -> [String]! {
155 | return ["onRecordingCompletion", "onRecordingChange", "onWavTranscribed", "onWavChange"]
156 | }
157 |
158 |
159 | override static func requiresMainQueueSetup() -> Bool {
160 | return false
161 | }
162 | }
163 |
--------------------------------------------------------------------------------
/ios/Transcription.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 8A67C69A257E051800802835 /* deepspeech_ios.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8A67C699257E051800802835 /* deepspeech_ios.framework */; };
11 | 8A8F94E924F72C4A00DF8B3F /* AudioContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A8F94E824F72C4A00DF8B3F /* AudioContext.swift */; };
12 | F4FF95D7245B92E800C19C63 /* Transcription.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4FF95D6245B92E800C19C63 /* Transcription.swift */; };
13 | /* End PBXBuildFile section */
14 |
15 | /* Begin PBXCopyFilesBuildPhase section */
16 | 58B511D91A9E6C8500147676 /* CopyFiles */ = {
17 | isa = PBXCopyFilesBuildPhase;
18 | buildActionMask = 2147483647;
19 | dstPath = "include/$(PRODUCT_NAME)";
20 | dstSubfolderSpec = 16;
21 | files = (
22 | );
23 | runOnlyForDeploymentPostprocessing = 0;
24 | };
25 | /* End PBXCopyFilesBuildPhase section */
26 |
27 | /* Begin PBXFileReference section */
28 | 8A67C699257E051800802835 /* deepspeech_ios.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = deepspeech_ios.framework; path = Frameworks/deepspeech_ios.framework; sourceTree = ""; };
29 | 8A8F94E724F72C3600DF8B3F /* libTranscription.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = libTranscription.a; path = "/Users/ryantremblay/react-native-transcription/ios/build/Debug-iphoneos/libTranscription.a"; sourceTree = ""; };
30 | 8A8F94E824F72C4A00DF8B3F /* AudioContext.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AudioContext.swift; sourceTree = ""; };
31 | B3E7B5891CC2AC0600A0062D /* Transcription.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Transcription.m; sourceTree = ""; };
32 | F4FF95D5245B92E700C19C63 /* Transcription-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Transcription-Bridging-Header.h"; sourceTree = ""; };
33 | F4FF95D6245B92E800C19C63 /* Transcription.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Transcription.swift; sourceTree = ""; };
34 | /* End PBXFileReference section */
35 |
36 | /* Begin PBXFrameworksBuildPhase section */
37 | 58B511D81A9E6C8500147676 /* Frameworks */ = {
38 | isa = PBXFrameworksBuildPhase;
39 | buildActionMask = 2147483647;
40 | files = (
41 | 8A67C69A257E051800802835 /* deepspeech_ios.framework in Frameworks */,
42 | );
43 | runOnlyForDeploymentPostprocessing = 0;
44 | };
45 | /* End PBXFrameworksBuildPhase section */
46 |
47 | /* Begin PBXGroup section */
48 | 58B511D21A9E6C8500147676 = {
49 | isa = PBXGroup;
50 | children = (
51 | 8A8F94E824F72C4A00DF8B3F /* AudioContext.swift */,
52 | F4FF95D6245B92E800C19C63 /* Transcription.swift */,
53 | B3E7B5891CC2AC0600A0062D /* Transcription.m */,
54 | F4FF95D5245B92E700C19C63 /* Transcription-Bridging-Header.h */,
55 | 8A5034DA24FEB4D700DEB741 /* Frameworks */,
56 | );
57 | sourceTree = "";
58 | };
59 | 8A5034DA24FEB4D700DEB741 /* Frameworks */ = {
60 | isa = PBXGroup;
61 | children = (
62 | 8A67C699257E051800802835 /* deepspeech_ios.framework */,
63 | );
64 | name = Frameworks;
65 | sourceTree = "";
66 | };
67 | /* End PBXGroup section */
68 |
69 | /* Begin PBXNativeTarget section */
70 | 58B511DA1A9E6C8500147676 /* Transcription */ = {
71 | isa = PBXNativeTarget;
72 | buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "Transcription" */;
73 | buildPhases = (
74 | 58B511D71A9E6C8500147676 /* Sources */,
75 | 58B511D81A9E6C8500147676 /* Frameworks */,
76 | 58B511D91A9E6C8500147676 /* CopyFiles */,
77 | );
78 | buildRules = (
79 | );
80 | dependencies = (
81 | );
82 | name = Transcription;
83 | productName = RCTDataManager;
84 | productReference = 8A8F94E724F72C3600DF8B3F /* libTranscription.a */;
85 | productType = "com.apple.product-type.library.static";
86 | };
87 | /* End PBXNativeTarget section */
88 |
89 | /* Begin PBXProject section */
90 | 58B511D31A9E6C8500147676 /* Project object */ = {
91 | isa = PBXProject;
92 | attributes = {
93 | LastUpgradeCheck = 0920;
94 | ORGANIZATIONNAME = Facebook;
95 | TargetAttributes = {
96 | 58B511DA1A9E6C8500147676 = {
97 | CreatedOnToolsVersion = 6.1.1;
98 | };
99 | };
100 | };
101 | buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "Transcription" */;
102 | compatibilityVersion = "Xcode 3.2";
103 | developmentRegion = English;
104 | hasScannedForEncodings = 0;
105 | knownRegions = (
106 | English,
107 | en,
108 | );
109 | mainGroup = 58B511D21A9E6C8500147676;
110 | productRefGroup = 58B511D21A9E6C8500147676;
111 | projectDirPath = "";
112 | projectRoot = "";
113 | targets = (
114 | 58B511DA1A9E6C8500147676 /* Transcription */,
115 | );
116 | };
117 | /* End PBXProject section */
118 |
119 | /* Begin PBXSourcesBuildPhase section */
120 | 58B511D71A9E6C8500147676 /* Sources */ = {
121 | isa = PBXSourcesBuildPhase;
122 | buildActionMask = 2147483647;
123 | files = (
124 | 8A8F94E924F72C4A00DF8B3F /* AudioContext.swift in Sources */,
125 | F4FF95D7245B92E800C19C63 /* Transcription.swift in Sources */,
126 | );
127 | runOnlyForDeploymentPostprocessing = 0;
128 | };
129 | /* End PBXSourcesBuildPhase section */
130 |
131 | /* Begin XCBuildConfiguration section */
132 | 58B511ED1A9E6C8500147676 /* Debug */ = {
133 | isa = XCBuildConfiguration;
134 | buildSettings = {
135 | ALWAYS_SEARCH_USER_PATHS = NO;
136 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
137 | CLANG_CXX_LIBRARY = "libc++";
138 | CLANG_ENABLE_MODULES = YES;
139 | CLANG_ENABLE_OBJC_ARC = YES;
140 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
141 | CLANG_WARN_BOOL_CONVERSION = YES;
142 | CLANG_WARN_COMMA = YES;
143 | CLANG_WARN_CONSTANT_CONVERSION = YES;
144 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
145 | CLANG_WARN_EMPTY_BODY = YES;
146 | CLANG_WARN_ENUM_CONVERSION = YES;
147 | CLANG_WARN_INFINITE_RECURSION = YES;
148 | CLANG_WARN_INT_CONVERSION = YES;
149 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
150 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
151 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
152 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
153 | CLANG_WARN_STRICT_PROTOTYPES = YES;
154 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
155 | CLANG_WARN_UNREACHABLE_CODE = YES;
156 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
157 | COPY_PHASE_STRIP = NO;
158 | ENABLE_STRICT_OBJC_MSGSEND = YES;
159 | ENABLE_TESTABILITY = YES;
160 | GCC_C_LANGUAGE_STANDARD = gnu99;
161 | GCC_DYNAMIC_NO_PIC = NO;
162 | GCC_NO_COMMON_BLOCKS = YES;
163 | GCC_OPTIMIZATION_LEVEL = 0;
164 | GCC_PREPROCESSOR_DEFINITIONS = (
165 | "DEBUG=1",
166 | "$(inherited)",
167 | );
168 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
169 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
170 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
171 | GCC_WARN_UNDECLARED_SELECTOR = YES;
172 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
173 | GCC_WARN_UNUSED_FUNCTION = YES;
174 | GCC_WARN_UNUSED_VARIABLE = YES;
175 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
176 | MTL_ENABLE_DEBUG_INFO = YES;
177 | ONLY_ACTIVE_ARCH = YES;
178 | SDKROOT = iphoneos;
179 | };
180 | name = Debug;
181 | };
182 | 58B511EE1A9E6C8500147676 /* Release */ = {
183 | isa = XCBuildConfiguration;
184 | buildSettings = {
185 | ALWAYS_SEARCH_USER_PATHS = NO;
186 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
187 | CLANG_CXX_LIBRARY = "libc++";
188 | CLANG_ENABLE_MODULES = YES;
189 | CLANG_ENABLE_OBJC_ARC = YES;
190 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
191 | CLANG_WARN_BOOL_CONVERSION = YES;
192 | CLANG_WARN_COMMA = YES;
193 | CLANG_WARN_CONSTANT_CONVERSION = YES;
194 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
195 | CLANG_WARN_EMPTY_BODY = YES;
196 | CLANG_WARN_ENUM_CONVERSION = YES;
197 | CLANG_WARN_INFINITE_RECURSION = YES;
198 | CLANG_WARN_INT_CONVERSION = YES;
199 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
200 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
201 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
202 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
203 | CLANG_WARN_STRICT_PROTOTYPES = YES;
204 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
205 | CLANG_WARN_UNREACHABLE_CODE = YES;
206 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
207 | COPY_PHASE_STRIP = YES;
208 | ENABLE_NS_ASSERTIONS = NO;
209 | ENABLE_STRICT_OBJC_MSGSEND = YES;
210 | GCC_C_LANGUAGE_STANDARD = gnu99;
211 | GCC_NO_COMMON_BLOCKS = YES;
212 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
213 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
214 | GCC_WARN_UNDECLARED_SELECTOR = YES;
215 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
216 | GCC_WARN_UNUSED_FUNCTION = YES;
217 | GCC_WARN_UNUSED_VARIABLE = YES;
218 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
219 | MTL_ENABLE_DEBUG_INFO = NO;
220 | SDKROOT = iphoneos;
221 | VALIDATE_PRODUCT = YES;
222 | };
223 | name = Release;
224 | };
225 | 58B511F01A9E6C8500147676 /* Debug */ = {
226 | isa = XCBuildConfiguration;
227 | buildSettings = {
228 | FRAMEWORK_SEARCH_PATHS = (
229 | "$(inherited)",
230 | "$(PROJECT_DIR)",
231 | "$(PROJECT_DIR)/Frameworks",
232 | );
233 | HEADER_SEARCH_PATHS = (
234 | "$(inherited)",
235 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
236 | "$(SRCROOT)/../../../React/**",
237 | "$(SRCROOT)/../../react-native/React/**",
238 | );
239 | LIBRARY_SEARCH_PATHS = "$(inherited)";
240 | OTHER_LDFLAGS = "-ObjC";
241 | PRODUCT_NAME = Transcription;
242 | SKIP_INSTALL = YES;
243 | SWIFT_OBJC_BRIDGING_HEADER = "Transcription-Bridging-Header.h";
244 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
245 | SWIFT_VERSION = 5.0;
246 | };
247 | name = Debug;
248 | };
249 | 58B511F11A9E6C8500147676 /* Release */ = {
250 | isa = XCBuildConfiguration;
251 | buildSettings = {
252 | FRAMEWORK_SEARCH_PATHS = (
253 | "$(inherited)",
254 | "$(PROJECT_DIR)",
255 | "$(PROJECT_DIR)/Frameworks",
256 | );
257 | HEADER_SEARCH_PATHS = (
258 | "$(inherited)",
259 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
260 | "$(SRCROOT)/../../../React/**",
261 | "$(SRCROOT)/../../react-native/React/**",
262 | );
263 | LIBRARY_SEARCH_PATHS = "$(inherited)";
264 | OTHER_LDFLAGS = "-ObjC";
265 | PRODUCT_NAME = Transcription;
266 | SKIP_INSTALL = YES;
267 | SWIFT_OBJC_BRIDGING_HEADER = "Transcription-Bridging-Header.h";
268 | SWIFT_VERSION = 5.0;
269 | };
270 | name = Release;
271 | };
272 | /* End XCBuildConfiguration section */
273 |
274 | /* Begin XCConfigurationList section */
275 | 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "Transcription" */ = {
276 | isa = XCConfigurationList;
277 | buildConfigurations = (
278 | 58B511ED1A9E6C8500147676 /* Debug */,
279 | 58B511EE1A9E6C8500147676 /* Release */,
280 | );
281 | defaultConfigurationIsVisible = 0;
282 | defaultConfigurationName = Release;
283 | };
284 | 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "Transcription" */ = {
285 | isa = XCConfigurationList;
286 | buildConfigurations = (
287 | 58B511F01A9E6C8500147676 /* Debug */,
288 | 58B511F11A9E6C8500147676 /* Release */,
289 | );
290 | defaultConfigurationIsVisible = 0;
291 | defaultConfigurationName = Release;
292 | };
293 | /* End XCConfigurationList section */
294 | };
295 | rootObject = 58B511D31A9E6C8500147676 /* Project object */;
296 | }
297 |
--------------------------------------------------------------------------------
/ios/Transcription.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Transcription.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-native-transcription",
3 | "version": "0.1.0",
4 | "description": "Transcribe live and recorded audio on Android and iOS",
5 | "main": "lib/commonjs/index",
6 | "module": "lib/module/index",
7 | "types": "lib/typescript/src/index.d.ts",
8 | "react-native": "src/index",
9 | "source": "src/index",
10 | "files": [
11 | "src",
12 | "lib",
13 | "android",
14 | "ios",
15 | "cpp",
16 | "react-native-transcription.podspec",
17 | "!lib/typescript/example",
18 | "!**/__tests__",
19 | "!**/__fixtures__",
20 | "!**/__mocks__"
21 | ],
22 | "scripts": {
23 | "test": "jest",
24 | "typescript": "tsc --noEmit",
25 | "lint": "eslint \"**/*.{js,ts,tsx}\"",
26 | "prepare": "bob build",
27 | "release": "release-it",
28 | "example": "yarn --cwd example",
29 | "pods": "cd example && pod-install --quiet",
30 | "bootstrap": "yarn example && yarn && yarn pods"
31 | },
32 | "keywords": [
33 | "react-native",
34 | "ios",
35 | "android"
36 | ],
37 | "repository": "https://github.com/zaptrem/react-native-transcription",
38 | "author": "Ryan Tremblay (https://relearn.fyi)",
39 | "license": "MIT",
40 | "bugs": {
41 | "url": "https://github.com/zaptrem/react-native-transcription/issues"
42 | },
43 | "homepage": "https://github.com/zaptrem/react-native-transcription#readme",
44 | "devDependencies": {
45 | "@commitlint/config-conventional": "^8.3.4",
46 | "@react-native-community/bob": "^0.16.2",
47 | "@react-native-community/eslint-config": "^2.0.0",
48 | "@release-it/conventional-changelog": "^1.1.4",
49 | "@types/jest": "^26.0.0",
50 | "@types/react": "^16.9.19",
51 | "@types/react-native": "0.62.13",
52 | "commitlint": "^8.3.5",
53 | "eslint": "^7.2.0",
54 | "eslint-config-prettier": "^6.11.0",
55 | "eslint-plugin-prettier": "^3.1.3",
56 | "jest": "^26.0.1",
57 | "pod-install": "^0.1.0",
58 | "prettier": "^2.0.5",
59 | "react": "16.11.0",
60 | "react-native": "0.62.2",
61 | "release-it": "^13.5.8",
62 | "typescript": "^3.8.3"
63 | },
64 | "peerDependencies": {
65 | "react": "*",
66 | "react-native": "*"
67 | },
68 | "jest": {
69 | "preset": "react-native",
70 | "modulePathIgnorePatterns": [
71 | "/example/node_modules",
72 | "/lib/"
73 | ]
74 | },
75 | "husky": {
76 | "hooks": {
77 | "commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
78 | "pre-commit": "yarn lint && yarn typescript"
79 | }
80 | },
81 | "commitlint": {
82 | "extends": [
83 | "@commitlint/config-conventional"
84 | ]
85 | },
86 | "release-it": {
87 | "git": {
88 | "commitMessage": "chore: release ${version}",
89 | "tagName": "v${version}"
90 | },
91 | "npm": {
92 | "publish": true
93 | },
94 | "github": {
95 | "release": true
96 | },
97 | "plugins": {
98 | "@release-it/conventional-changelog": {
99 | "preset": "angular"
100 | }
101 | }
102 | },
103 | "eslintConfig": {
104 | "extends": [
105 | "@react-native-community",
106 | "prettier"
107 | ],
108 | "rules": {
109 | "prettier/prettier": [
110 | "error",
111 | {
112 | "quoteProps": "consistent",
113 | "singleQuote": true,
114 | "tabWidth": 2,
115 | "trailingComma": "es5",
116 | "useTabs": false
117 | }
118 | ]
119 | }
120 | },
121 | "eslintIgnore": [
122 | "node_modules/",
123 | "lib/"
124 | ],
125 | "prettier": {
126 | "quoteProps": "consistent",
127 | "singleQuote": true,
128 | "tabWidth": 2,
129 | "trailingComma": "es5",
130 | "useTabs": false
131 | },
132 | "@react-native-community/bob": {
133 | "source": "src",
134 | "output": "lib",
135 | "targets": [
136 | "commonjs",
137 | "module",
138 | "typescript"
139 | ]
140 | }
141 | }
142 |
--------------------------------------------------------------------------------
/react-native-transcription.podspec:
--------------------------------------------------------------------------------
1 | require "json"
2 |
3 | package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4 |
5 | Pod::Spec.new do |s|
6 | s.name = "react-native-transcription"
7 | s.version = package["version"]
8 | s.summary = package["description"]
9 | s.homepage = package["homepage"]
10 | s.license = package["license"]
11 | s.authors = package["author"]
12 |
13 | s.platforms = { :ios => "13.5" }
14 | s.source = { :git => "https://github.com/zaptrem/react-native-transcription.git", :tag => "#{s.version}" }
15 |
16 |
17 | s.source_files = "ios/*.{h,m,mm,swift}"
18 | s.vendored_frameworks = ['ios/Frameworks/deepspeech_ios.framework']
19 | #s.swift_versions = ['5.1.3']
20 |
21 | s.dependency "React"
22 | end
23 |
--------------------------------------------------------------------------------
/src/__tests__/index.test.tsx:
--------------------------------------------------------------------------------
1 | it.todo('write a test');
2 |
--------------------------------------------------------------------------------
/src/index.tsx:
--------------------------------------------------------------------------------
1 | import { NativeModules } from 'react-native';
2 |
3 | type TranscriptionType = {
4 | multiply(a: number, b: number): Promise;
5 | };
6 |
7 | const { Transcription } = NativeModules;
8 |
9 | export default Transcription as TranscriptionType;
10 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "baseUrl": ".",
4 | "paths": {
5 | "react-native-transcription": [
6 | "./src/index"
7 | ]
8 | },
9 | "allowUnreachableCode": false,
10 | "allowUnusedLabels": false,
11 | "esModuleInterop": true,
12 | "importsNotUsedAsValues": "error",
13 | "forceConsistentCasingInFileNames": true,
14 | "jsx": "react",
15 | "lib": [
16 | "esnext"
17 | ],
18 | "module": "esnext",
19 | "allowJs": true /* Allow javascript files to be compiled. */,
20 | "checkJs": false /* Report errors in .js files. */,
21 | "moduleResolution": "node",
22 | "noFallthroughCasesInSwitch": true,
23 | "noImplicitReturns": true,
24 | "noImplicitUseStrict": false,
25 | "noStrictGenericChecks": false,
26 | "noUnusedLocals": true,
27 | "noUnusedParameters": true,
28 | "resolveJsonModule": true,
29 | "skipLibCheck": true,
30 | "strict": true,
31 | "target": "esnext"
32 | }
33 | }
--------------------------------------------------------------------------------