diff --git a/.changeset/pink-ducks-think.md b/.changeset/pink-ducks-think.md new file mode 100644 index 0000000000..5c37e4b03e --- /dev/null +++ b/.changeset/pink-ducks-think.md @@ -0,0 +1,5 @@ +--- +"@jspsych/plugin-html-audio-response": patch +--- + +uses mimetype of audio recorded for playback instead of defaulting to webm diff --git a/packages/plugin-html-audio-response/src/index.ts b/packages/plugin-html-audio-response/src/index.ts index a5205ecec5..5071985e83 100644 --- a/packages/plugin-html-audio-response/src/index.ts +++ b/packages/plugin-html-audio-response/src/index.ts @@ -182,7 +182,7 @@ class HtmlAudioResponsePlugin implements JsPsychPlugin { }; this.stop_event_handler = () => { - const data = new Blob(this.recorded_data_chunks, { type: "audio/webm" }); + const data = new Blob(this.recorded_data_chunks, { type: this.recorded_data_chunks[0].type }); this.audio_url = URL.createObjectURL(data); const reader = new FileReader(); reader.addEventListener("load", () => {