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

Dictation API #109

Merged
merged 28 commits into from
Nov 14, 2015
Merged

Dictation API #109

merged 28 commits into from
Nov 14, 2015

Conversation

cat-haines
Copy link

Added support for dictation API (#102)

@@ -13,7 +13,7 @@ Pebble.js applications run on your phone. They have access to all the resources

## Getting Started

* In CloudPebble
* In CloudPebble
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra whitespace

SimplyPebble.window = WindowStack.top();

// Set the callback and send the packet
SimplyPebble.dictationCallback = callback;
Copy link

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 } );
Copy link

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 });

@Meiguro
Copy link

Meiguro commented Nov 13, 2015

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.

@cat-haines
Copy link
Author

@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;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be enable_confirmation

@Meiguro
Copy link

Meiguro commented Nov 14, 2015

👍 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

cat-haines added a commit that referenced this pull request Nov 14, 2015
@cat-haines cat-haines merged commit 7243018 into pebble:master Nov 14, 2015
@cat-haines cat-haines deleted the dictation branch November 14, 2015 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants