branch: elpa/subed
commit 27a745f806581884a7b2d36b76be78ff8f302ac2
Author: Sacha Chua <[email protected]>
Commit: Sacha Chua <[email protected]>
subed-word-data: Include speaker diarization if available
* subed/subed-word-data.el
(subed-word-data--extract-words-from-youtube-vtt):
Include speaker diarization if available.
---
subed/subed-word-data.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/subed/subed-word-data.el b/subed/subed-word-data.el
index adb86abfb9..377d36f162 100644
--- a/subed/subed-word-data.el
+++ b/subed/subed-word-data.el
@@ -87,7 +87,7 @@ Return a list of ((start . ?), (end . ?) (text . ?))."
(defun subed-word-data--extract-words-from-youtube-vtt (file &optional
from-string)
"Extract the timing from FILE which is a VTT from YouTube.
-Return a list of ((start . ?), (end . ?) (text . ?)).
+Return a list of ((start . ?), (end . ?) (text . ?) (speaker . ?)).
If FROM-STRING is non-nil, treat FILE as the data itself."
(with-temp-buffer
(subed-vtt-mode)
@@ -140,6 +140,7 @@ If FROM-STRING is non-nil, treat FILE as the data itself."
`((start . ,(and .start (* 1000
.start)))
(end . ,(and .end (* 1000 .end)))
(text . ,(identity .word))
+ (speaker . ,(identity .speaker))
(score . ,(identity .score)))))
(alist-get 'words segment)))
(alist-get
'segments data)))