Skip to content

Commit

Permalink
Recieve command's response with haptic feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
beastoin committed Nov 27, 2024
1 parent eee958f commit 42c35f2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/lib/providers/capture_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ class CaptureProvider extends ChangeNotifier
return file;
}

void _processVoiceCommandBytes(List<List<int>> data) async {
void _processVoiceCommandBytes(String deviceId, List<List<int>> data) async {
if (data.isEmpty) {
debugPrint("voice frames is empty");
return;
Expand All @@ -205,6 +205,7 @@ class CaptureProvider extends ChangeNotifier
debugPrint("Command respond: ${messages.map((m) => m.text).join(" | ")}");
if (messages.isNotEmpty) {
messageProvider?.refreshMessages();
_playSpeakerHaptic(deviceId, 2);
}
} catch (e) {
debugPrint(e.toString());
Expand All @@ -228,7 +229,7 @@ class CaptureProvider extends ChangeNotifier
_voiceCommandSession = null; // end session
var data = List<List<int>>.from(_commandBytes);
_commandBytes = [];
_processVoiceCommandBytes(data);
_processVoiceCommandBytes(deviceId, data);
}
});
}
Expand All @@ -254,7 +255,7 @@ class CaptureProvider extends ChangeNotifier
_voiceCommandSession = null; // end session
var data = List<List<int>>.from(_commandBytes);
_commandBytes = [];
_processVoiceCommandBytes(data);
_processVoiceCommandBytes(deviceId, data);
}
});
}
Expand Down

0 comments on commit 42c35f2

Please sign in to comment.