diff --git a/Audio-Transcription-Chrome/README.md b/Audio-Transcription-Chrome/README.md index 4e5fa8c..0d40290 100644 --- a/Audio-Transcription-Chrome/README.md +++ b/Audio-Transcription-Chrome/README.md @@ -23,6 +23,13 @@ This Chrome extension allows you to send audio from your browser to a server for ### Capturing Audio To capture the audio in the current tab, we used the chrome `tabCapture` API to obtain a `MediaStream` object of the current tab. +### Options +When using the Audio Transcription extension, you have the following options: + - **Use Collabora Server**: We provide a demo server which runs the whisper small model. + - **Use Multilingual Model**: Enable this option to utilize the multilingual capabilities of OpenAI-whisper. + - **Language**: Select the target language for transcription or translation. You can choose from a variety of languages supported by OpenAI-whisper. + - **Task:** Choose the specific task to perform on the audio. You can select either "transcribe" for transcription or "translate" to translate the audio to English. + ### Getting Started - Make sure the transcription server is running properly. To know more about how to start the server, see the [documentation here](https://github.com/collabora/whisper-live). - Just click on the Chrome Extension which should show 2 options @@ -33,3 +40,6 @@ To capture the audio in the current tab, we used the chrome `tabCapture` API to ## Limitations This extension requires an internet connection to stream audio and receive transcriptions. The accuracy of the transcriptions may vary depending on the audio quality and the performance of the server-side transcription service. The extension may consume additional system resources while running, especially when streaming audio. +## Note +The extension relies on a properly running transcription server with multilingual support. Please follow the server documentation for setup and configuration. + diff --git a/Audio-Transcription-Chrome/background.js b/Audio-Transcription-Chrome/background.js index 09de7dc..e21b04f 100644 --- a/Audio-Transcription-Chrome/background.js +++ b/Audio-Transcription-Chrome/background.js @@ -150,7 +150,14 @@ async function startCapture(options) { await sendMessageToTab(optionTab.id, { type: "start_capture", - data: { currentTabId: currentTab.id, host: options.host, port: options.port }, + data: { + currentTabId: currentTab.id, + host: options.host, + port: options.port, + multilingual: options.useMultilingual, + language: options.language, + task: options.task + }, }); } else { console.log("No Audio"); diff --git a/Audio-Transcription-Chrome/options.js b/Audio-Transcription-Chrome/options.js index ad7dfb1..ac2862c 100644 --- a/Audio-Transcription-Chrome/options.js +++ b/Audio-Transcription-Chrome/options.js @@ -79,11 +79,16 @@ async function startRecord(option) { stream.oninactive = () => { window.close(); }; - const socket = new WebSocket(`ws://${option.host}:${option.port}/`); let isServerReady = false; socket.onopen = function(e) { - socket.send("handshake"); + socket.send( + JSON.stringify({ + multilingual: option.multilingual, + language: option.language, + task: option.task + }) + ); }; socket.onmessage = async (event) => { diff --git a/Audio-Transcription-Chrome/popup.html b/Audio-Transcription-Chrome/popup.html index 5777929..4f2b6ec 100644 --- a/Audio-Transcription-Chrome/popup.html +++ b/Audio-Transcription-Chrome/popup.html @@ -15,5 +15,121 @@ +