Skip to content

Commit

Permalink
commit index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
cdinea committed Oct 12, 2024
1 parent 3f8c71c commit 0d64fbe
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions applications/ehr_query_llm/lmm/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,25 @@
<script type='text/javascript' src='/static/websocket.js'></script>
<script type='text/javascript' src='/static/audio.js'></script>

<script>
let audioContext;

function initAudioContext() {
try {
audioContext = new (window.AudioContext || window.webkitAudioContext)();
console.log('AudioContext initialized successfully');
} catch (e) {
console.error('Failed to create AudioContext:', e);
}
}

// Initialize on user interaction
document.addEventListener('click', function() {
if (!audioContext) initAudioContext();
}, { once: true });
</script>

<button id="initAudioButton">Initialize Audio</button>
<script type="text/javascript">

function onChatMessageKey(event) { // https://stackoverflow.com/a/49389811
Expand All @@ -56,6 +75,8 @@
sendWebsocket({'chat_history_reset': true});
}



function onVoiceSelect() {
const voice = document.getElementById('voice-select').value;
console.log(`select voice: ${voice}`);
Expand Down

0 comments on commit 0d64fbe

Please sign in to comment.