-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
enhancementNew feature or requestNew feature or requestuser reportedA user raised this issue.A user raised this issue.
Description
A user has requested the ability to start/stop SayPi recording via a keyboard shortcut even when the Pi tab is not active.
User Request
"I often switch between Pi and other sites while talking to it, and it's GREAT that it continues recording in the background! However, I frequently forget to turn off the microphone (end the convo). A shortcut to start and stop recording while I'm browsing another website on another tab would be much more convenient than going back on the Pi tab and clicking the green/red call icon!"
Technical Assessment
This is technically feasible using Chrome's Extension Commands API:
- Add commands to manifest.json:
"commands": {
"toggle-call": {
"suggested_key": {
"default": "Ctrl+Shift+9"
},
"description": "Toggle call recording"
}
}- Add a command listener in the background script:
chrome.commands.onCommand.addListener((command) => {
if (command === "toggle-call") {
// Send message to Pi tab to toggle recording
chrome.tabs.query({url: "https://pi.ai/*"}, (tabs) => {
if (tabs.length > 0) {
chrome.tabs.sendMessage(tabs[0].id, {action: "toggle-recording"});
}
});
}
});- Implement message handling in the content script:
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
if (message.action === "toggle-recording") {
// Determine current state and toggle
if (/*recording is active*/) {
EventBus.emit("audio:stopRecording");
} else {
EventBus.emit("audio:startRecording");
}
}
});Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestuser reportedA user raised this issue.A user raised this issue.