Skip to content

Fix transcription and data saving#8

Open
becky-gilbert wants to merge 9 commits into
teonbrooks:mainfrom
becky-gilbert:dev-transformers-config
Open

Fix transcription and data saving#8
becky-gilbert wants to merge 9 commits into
teonbrooks:mainfrom
becky-gilbert:dev-transformers-config

Conversation

@becky-gilbert

Copy link
Copy Markdown
Contributor

This PR fixes the transcription and data saving.

  • Adds two new properties to the plugin's data:
    • transcript: the full Whisper transcript text
    • transcript_chunks: word-level timestamps from Whisper
  • Adds a module-level _transcriber variable and getTranscriber() function so the Whisper model is loaded once and reused across trials, rather than reloaded on every call.
  • Changes the class's data property to be a Blob and removes the arrayBuffer property (the intermediate FileReader/ArrayBuffer step is not needed (array buffer is created in transcribe but it doesn't need to be stored on the class instance)
  • transcribe function now takes the audio Blob instead of a URL, decodes, resamples, downmixes, and passes it to transcriber, then writes the transcript/chunks into the trial data passed to finishTrial. Everything is wrapped in try/catch.
  • endTrial has been updated to use the new call signature for transcribe
  • Removes WaveFile import (no longer used), commented-out code, and hard-coded URLs

@becky-gilbert becky-gilbert changed the title Fix Fix transcription and data saving Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants