-
Notifications
You must be signed in to change notification settings - Fork 362
[Android] Speech recognition example #236
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
Conversation
This reverts commit 6f340dc.
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.
LGTM. Great example:)
|
||
// Disable audio buttons first. | ||
// The stop button will be enabled by the recording task. | ||
disableAudioButtons() |
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.
wondering why do we need this "disable" state handling of the audio button?
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.
since pressing this button starts some work in another thread, I didn't want to allow it to be pressed again before the recording is done and have to worry about keeping state consistent.
return OnnxTensor.createTensor(env, FloatBuffer.wrap(data), shape) | ||
} | ||
|
||
internal fun tensorShape(vararg dims: Long) = longArrayOf(*dims) |
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.
Good to know there's a vararg
keyword in kotlin.
assuming it is safe to pass in zero elements and also only works for the same type series of arguments?
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.
Add speech recognition example for Android using Whisper model.
Thanks @MaanavD for help with the UI.