Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

result and segments are empty #34

Open
illusion77 opened this issue Apr 26, 2023 · 3 comments
Open

result and segments are empty #34

illusion77 opened this issue Apr 26, 2023 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@illusion77
Copy link

illusion77 commented Apr 26, 2023

For this code

const filePath = `${RNFS.DocumentDirectoryPath}/whisper/ggml-tiny.en.bin`
const sampleFilePath = `${RNFS.DocumentDirectoryPath}/youtube_audio_3LopI4YeC4I.wav`

const whisperContext = await initWhisper({ filePath })

const options = { language: 'en' }
const { stop, promise } = whisperContext.transcribe(sampleFilePath, options)

const { result, segments } = await promise
// result: (The inference text result from audio file)

console.log('---result---', result);
console.log('---segments---',segments);

I got this print

---result---
---segments--- Array []

This audio file is a English content, and the pronunciation is pretty clear
I do not know why got this.

Thanks!
@jhen0409

@illusion77
Copy link
Author

illusion77 commented Apr 26, 2023

I found that the count might be normal

image_2023-04-26_18-34-25

But the n_segments are 0, this is wrong

image_2023-04-26_18-57-42

Actually, I met the same situation (n_segments = 0) when I use whisper.cpp.swift, it is fixed after I configured 'Copy Bundle Resources', but I do not why for this

@jhen0409
Copy link
Member

You can check the WAV file is 16khz mono first, only this format is currently supported in whisper.cpp.

Otherwise, you can also try to find related issues in whisper.cpp repo.

@illusion77
Copy link
Author

Thanks, my process is to download the audio file in webm format, then use ffmpeg-kit-react-native to convert it into the same metadata as jfk.wav, it still doesn't work...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants