Coder Social home page Coder Social logo

martinnobis / react-native-transcribe Goto Github PK

View Code? Open in Web Editor NEW

This project forked from northwesternmutual/react-native-transcribe

0.0 0.0 0.0 1.2 MB

License: MIT License

Shell 0.32% JavaScript 14.93% Ruby 2.81% C 0.22% Objective-C 7.88% Java 30.84% TypeScript 19.23% Swift 23.75%

react-native-transcribe's Introduction

react-native-transcribe

library to send raw microphone data (array) for AWS Transcribe

You can use this library to send to any speech to text service, this one includes a sample AWS Lambda function for AWS Transcribe.

Installation

npm install react-native-transcribe

Usage

import Transcribe from 'react-native-transcribe';

// ...

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

Get started with the project:

$ yarn bootstrap

Run the example app on iOS:

$ yarn example ios

Run the example app on Android:

$ yarn example android

iOS This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSSpeechRecognitionUsageDescription key with a string value explaining to the user how the app uses this data.

Android AndroidManifest.xml

  <uses-permission android:name="android.permission.RECORD_AUDIO" />

Note: Special settings for mic on android (adb emu avd hostmicon) emulator -avd Pixel_3a_API_30_x86 -qemu -allow-host-audio https://developer.android.com/studio/run/emulator-commandline https://gist.github.com/wswebcreation/80f5536ab1592aff0c25a9dbd9cc1451

Running the example

Setup

In the root directory /react-native-transcribe, run

npm install

Next, change to example directory and install packages

cd /react-native-transcribe/example/
npm install

Running ios

  1. Install cocoa pods
cd /react-native-transcribe/example/ios
pod install
  1. Start react-native example project
cd /react-native-transcribe/example
npm run start
  1. Start ios Project.
    Open the TranscribeExample.xcworkspace file from ../example/ios in XCode Click Build and Run

Running Android

  1. Start react-native example project
cd /react-native-transcribe/example
npm run start
  1. Ensure your emulator command works properly. https://developer.android.com/studio/run/emulator-commandline
  2. Open Android emulator from the Terminal with the emulator command:
user@host ~ $ emulator -list-avds
Pixel_4_API_30

#emulator -avd [EMULATOR_NAME] -qemu -allow-host-audio

user@host ~ $  emulator -avd Pixel_4_API_30 -qemu -allow-host-audio
  1. Toggle (in a different terminal) the microphone ON
#adb emu avd hostmicon
user@host ~ $ adb emu avd hostmicon 
OK

** You can also use the simulator's extended menu (...) to allow headset microphones **

  1. In Android Studio, open project and naviagate to /react-native-transcribe/example/android
  2. Build

Troubleshooting Android:

If you try to start your emulator and you receive this in the terminal:

audio: Failed to create voice `dac'
coreaudio: Could not initialize record
coreaudio: Could not set samplerate 44100
coreaudio: Reason: kAudioDeviceUnsupportedFormatError
coreaudio: Could not initialize record
coreaudio: Could not set samplerate 44100
coreaudio: Reason: kAudioDeviceUnsupportedFormatError

Mac: Make sure your audio is set to your system default (MacBook Pro Speakers and MacBook Pro Microphone)

react-native-transcribe's People

Contributors

ryanfurness avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.