-
Notifications
You must be signed in to change notification settings - Fork 229
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
Dictation API #109
Dictation API #109
Conversation
- Allows simply_voice_handle_packet to return before dictation completes
@@ -13,7 +13,7 @@ Pebble.js applications run on your phone. They have access to all the resources | |||
|
|||
## Getting Started | |||
|
|||
* In CloudPebble | |||
* In CloudPebble |
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.
Extra whitespace
…confirmation screen
SimplyPebble.window = WindowStack.top(); | ||
|
||
// Set the callback and send the packet | ||
SimplyPebble.dictationCallback = callback; |
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.
Use an array of callbacks similar to SimplyPebble.accelPeek
. Packets are guaranteed order, so you know the first callback is always the one to call when a Packet comes in from the watch.
You'll probably want to start more information than just the callback, such as the top window, so you would have something like:
dictationListenerInfos.push({ callback: callback, window: WindowStack.top() });
SimplyPebble.voiceDictationSession = function(callback) { | ||
// If there's a transcription in progress | ||
if (SimplyPebble.dictationCallback) { | ||
callback( { 'status': -1, 'transcription': null } ); |
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.
No spaces for round parens, but the spaces for curly is good. I have to admit I'm not sure what you'd call this style. No quotes necessary, but you did use the right kind of quotes!
callback({ status: -1, transcription: null });
Awesome, this is great, thank you for this! Let me know if you need any help or clarification. If you also don't have the time to fix it up, let me know as well and I can pick up the slack of necessary. |
@Meiguro - I think I've addressed all your concerns.. take a look and let me know what you think 😸 |
|
||
struct __attribute__((__packed__)) VoiceStartPacket { | ||
Packet packet; | ||
bool enableConfirmation; |
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.
Should be enable_confirmation
👍 The only concern is that the docs are grabbed from master, so you may have to separate the doc improvements in a separate PR to be merged once cloudpebble has the updated pebble.js |
Added support for dictation API (#102)