void destroy_dictation() { dictation_session_destroy(s_dictation_session); s_dictation_session = NULL; if (dictation_result) { free(dictation_result); } }
static void dictation_session_callback(DictationSession *session, DictationSessionStatus status, char *transcription, void *context){ // send the message to the phone if successfull if (status==DictationSessionStatusSuccess){ DictionaryIterator *iter; app_message_outbox_begin(&iter); Tuplet value = TupletCString(1, transcription); dict_write_tuplet(iter, &value); app_message_outbox_send(); } else { } dictation_session_stop(session); dictation_session_destroy(session); }
static void window_unload(Window *window) { numOfNotifications = 0; nw_ui_unload(); #ifdef PBL_COLOR if (bitmapReceivingBuffer != NULL) { free(bitmapReceivingBuffer); bitmapReceivingBuffer = NULL; } if (notificationBitmap != NULL) { gbitmap_destroy(notificationBitmap); notificationBitmap = NULL; } #endif #ifdef PBL_MICROPHONE if (dictationSession != NULL) dictation_session_destroy(dictationSession); #endif accel_tap_service_unsubscribe(); bluetooth_connection_service_unsubscribe(); tick_timer_service_unsubscribe(); window_destroy(window); if (main_noMenu && config_dontClose) { closeApp(); } if (main_noMenu) closingMode = true; for (int i = 0; i < NOTIFICATION_SLOTS; i++) { destroy_notification(notificationData[i]); } }
static void onDictation(DictationSession *session, DictationSessionStatus status, char *transcription, void *context) { if (status == DictationSessionStatusSuccess) { APP_LOG(APP_LOG_LEVEL_DEBUG, "Dictation text: %s", transcription); comms_addItem(activeShoppingListID, transcription); } else { APP_LOG(APP_LOG_LEVEL_DEBUG, "Dictation result: %d", status); msgwin_show("Dictation failed"); } dictation_session_destroy(dictSession); }
/* * Close away voice control */ EXTFN void tidy_voice() { if (ds != NULL) { dictation_session_destroy(ds); } }