React Native implementation of OpenAI's Whisper automatic speech recognition (ASR) model
npm install react-native-whisperThis is a proof of concept of a JSI library for OpenAI Whisper , it combines a C++ port of Whisper from whisper.cpp and a JSI template from this blog.
``js
import Whisper from 'react-native-whisper'
Whisper.transcribeWavToText(pathOfModel,pathOfAudio,(text)=>{alert(text)})
`
You can specify the location of the model or .wav audio file by providing either its full path (e.g., file:///path/to/file) or its Unix-style path (e.g., /path/to/file).
This project is in no way stable or complete!! Feel free to contribute.
`sh`
npm install react-native-whisper
`sh`
yarn add react-native-whisper
For iOS also run pod install in /ios folder.
If you are using with Expo, run
`sh`
expo prebuild
file.
`ts
helloWorld():string; multiplyWithCallback(x:number,y:number,callback:(z:number) => void):void
multiply(x:number,y:number):number
`$3
The relevant code on android is in android/cpp-adapter.cpp and ios/SimpleJsi.mm on iOS.
`ts
getDeviceName():string
setItem(key:string,value:string):boolean getItem(key:string):string
`Basic usage example
`tsx
import simpleJsiModule from "react-native-jsi-template";simpleJsiModule.helloWorld() // returns helloworld.
``- react-native-mmkv
- react-native-reanimated
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT