React 钩头,适用于带有语音录音、实时转录和静音消除功能的 OpenAI Whisper
对 React Native 的 useWhisper 正在开发中。 存储库: https://github.com/chengsokdara/use-whisper-native 进度: https://github.com/chengsokdara/use-whisper-native/issues/1
npm i @chengsokdara/use-whisperyarn add @chengsokdara/use-whisperimport { useWhisper } from '@chengsokdara/use-whisper'
const App = () => {
const {
recording,
speaking,
transcribing,
transcript,
pauseRecording,
startRecording,
stopRecording,
} = useWhisper({
apiKey: process.env.OPENAI_API_TOKEN, // YOUR_OPEN_AI_TOKEN
})
return (
)
}…import { useWhisper } from '@chengsokdara/use-whisper'
const App = () => {
const { transcript } = useWhisper({
apiKey: process.env.OPENAI_API_TOKEN, // YOUR_OPEN_AI_TOKEN
streaming: true,
timeSlice: 1_000, // 1 second
whisperConfig: {
language: 'en',
},
})
return (
)
}import { useWhisper } from '@chengsokdara/use-whisper'
const App = () => {
const { transcript } = useWhisper({
apiKey: process.env.OPENAI_API_TOKEN, // YOUR_OPEN_AI_TOKEN
// use ffmpeg-wasp to remove silence from recorded speech
removeSilence: true,
})
return (
)
}import { useWhisper } from '@chengsokdara/use-whisper'
const App = () => {
const { transcript } = useWhisper({
apiKey: process.env.OPENAI_API_TOKEN, // 你的 OpenAI 令牌
// 组件安装后会自动开始录音
autoStart: true,
})暂无开放 Issues,或尚未同步最近议题。