Speech recognition concatenates multiple results and gives wrong output
noook opened this issue · comments
Neil Richter commented
Describe the bug
When using useSpeechRecognition()
with interimResults: true
, the output is malformed and joins multiple times the same sentence.
The issue only happens on mobile, because the APIs don't seem to be the same. Open the link to reproduction on mobile.
More info here: https://stackoverflow.com/questions/50953900/speech-to-text-web-api-returns-different-result-on-desktop-vs-mobile
Reproduction
https://stackblitz.com/edit/vitejs-vite-ywbonf?file=src%2FApp.vue
System Info
System:
OS: macOS 14.0
CPU: (10) arm64 Apple M1 Pro
Memory: 100.30 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.11.0 - ~/.nvm/versions/node/v20.11.0/bin/node
npm: 10.2.4 - ~/.nvm/versions/node/v20.11.0/bin/npm
pnpm: 8.15.3 - ~/work/vueuse/node_modules/.bin/pnpm
bun: 1.0.6 - ~/.bun/bin/bun
Browsers:
Chrome: 123.0.6312.59
Safari: 17.0
npmPackages:
@vueuse/core: file:../../packages/core/dist => 10.8.0
@vueuse/metadata: file:../../packages/metadata/dist => 10.8.0
@vueuse/shared: file:../../packages/shared/dist => 10.8.0
vue: ^3.4.19 => 3.4.20
Used Package Manager
npm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a VueUse issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion.
- The provided reproduction is a minimal reproducible example of the bug.