-
Notifications
You must be signed in to change notification settings - Fork 379
Realtime ASR widget #120
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
Realtime ASR widget #120
Conversation
| @@ -0,0 +1,38 @@ | |||
| class AudioDataExtractor extends AudioWorkletProcessor { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Pierrci regarding this comment, i'm using js rather than ts because microsoft/TypeScript#28308
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you try adding https://www.npmjs.com/package/@types/audioworklet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added @types/audioworklet and the following issues I'm facing are:
- when it becomes
js/static/audioProcessor.ts, it does not get transpiled to js (looking into why, possible error in adapter-static) - to solve number 1, I've moved
js/static/audioProcessor.ts->js/src/lib/components/InferenceWidget/shared/WidgetRealtimeRecorder/audioProcessor.ts. In this case, I'm getting errorReferenceError: AudioWorkletProcessor is not defined(probably due to SSR) - to solve number 2, I've put the entire context of
js/static/audioProcessor.jsinside WidgetRealtimeRecorder.svelteonMountfunction. Still gotReferenceError: AudioWorkletProcessor is not definedinside the browser log.
I might be missing something here. Please let me know if you have any ideas
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes ok, this is 💩
The ReferenceError you were getting was probably because you're were trying to import the audio processor outside of the audioWorklet.addModule fn (AudioWorkletProcessor is only available inside the AudioWorkletGlobalScope)
When audioProcessor.ts is moved in the /shared dir, using imports as URL works correctly w/ the static adapter, but it doesn't work in moon-landing (obviously).
So I think we can keep it in /static (and as .js), and for it to work in moon-landing we will need to add an additional express static handler pointing to this file (which I'm not a fan of, but I don't see any other alternative?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, indeed, we do need that /static handler on moon-landing
Pierrci
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well! 👍
|
@gary149 Hiding the other btns of AutomaticSpeechRecognitionWidget when realtime asr is live Testing: |
|
Is there a netlify link I can try out? https://app.netlify.com/sites/huggingface-widgets/deploys/6274de11534f4a451af9c3ac does not seem to work 😢 |
|
this is cool but it looks like it was a LOT of work, let's make sure we maximize the impact by having as many people as possible use it Any idea on how to best promote this? |


Add
realtimecapability to ASR widget(attempt number 3 😊)
asrdemo.mov
Testing:
wav2vec2-base-960h-english 🇬🇧
wav2vec2-large-xlsr-53-french 🇫🇷
wav2vec2-large-xlsr-mongolian 🇲🇳
Screenshots