djmango / obsidian-transcription

Obsidian plugin to create high-quality transcriptions from markdown linked audio files
https://swiftink.io
MIT License
156 stars 17 forks source link

Fix for new Whisper ASR response format #55

Closed bscholer closed 6 months ago

bscholer commented 6 months ago

Work done

In a recent change, it seems as though Whisper ASR's JSON response format has changed, but only when ASR_ENGINE=openai_whisper.

Thankfully, the part that we care about (segments) changed to respond in a format close to the format that we were already translating the old responses to, so this is a pretty small PR.

For more details, please see the short writeup on the original issue.

Worth noting that when ASR_ENGINE=faster_whisper, it still responds in the old format. Because of this, we need to handle this format as well, which is done with a ternary.

Note: I opened an issue on the Whisper ASR repo to fix this issue. If/when this gets done, it should work here without issue.

fixes #52, replaces #54

dahifi commented 6 months ago

Thank you ser