jjmaldonis / obsidian-audio-notes

Easily take notes on podcasts and other audio files using Obsidian Audio Notes.
MIT License
146 stars 2 forks source link

[Feature Request] Live update subtitles #12

Closed josephdong1000 closed 1 year ago

josephdong1000 commented 1 year ago

I want to say that I'm a great fan of this plugin and use it especially when I'm rewatching university lectures. It's helpful to listen back to the lecture audio with subtitles on the side.

It would be nice to have the option for subtitles to live update based on where you are in the recording. It would be immensely helpful if there was some option like liveupdate: true that would overwrite the subtitles below the recording based on the playback position. This might be a CPU-intensive function, but just being able to see in real-time the words being spoken would improve the QOL of this plugin by a lot!

Cheers!

jjmaldonis commented 1 year ago

Hey glad you like the plugin!

This is a cool idea and it ended up being fun to implement. You can try it out in the latest release, v0.5.0.

I haven't documented the feature yet, but you can enable it by setting liveUpdate: true (note the capitol U) in the code block.

I was able to keep CPU usage low by hooking directly into the audio's HTML element.

Let me know what you think when you give it a try :)

josephdong1000 commented 1 year ago

This is perfect! The subtitles show up exactly as I imagined, thank you!

A small thing to note for documentation is that I had to add --- below the audio note description for the subtitles to show. Also, the subtitles don't update automatically when skipping through the audio backward, I had to pause and play for them to update properly. But this is great!