diff options
author | Leon Rische <leon.rische@me.com> | 2020-09-29 10:56:11 +0200 |
---|---|---|
committer | Leon Rische <leon.rische@me.com> | 2020-09-29 10:56:11 +0200 |
commit | 3bcac4ef4d11296f0d53fb4536430120683c6fb6 (patch) | |
tree | 14c332fd86a0dee81308bb1413442c917d121731 /org-fc-audio.el | |
parent | b1310db985df48d10b2c3bebb98cb014347bf4ff (diff) |
Add speed argument for audio replay
Diffstat (limited to 'org-fc-audio.el')
-rw-r--r-- | org-fc-audio.el | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/org-fc-audio.el b/org-fc-audio.el index 950c836..ed3d6fe 100644 --- a/org-fc-audio.el +++ b/org-fc-audio.el @@ -59,18 +59,19 @@ (if (org-fc-entry-p) (org-set-property org-fc-audio-property-after file))) -(cl-defun org-fc-audio-play (property) +(defun org-fc-audio-play (property &optional speed) "Play the audio of the current card. -Look up the file from PROPERTY." +Look up the file from PROPERTY. If SPEED is non-nil, play back +the file at the given speed." (if-let ((file (org-entry-get (point) property))) - (org-fc-audio-play-file file))) + (org-fc-audio-play-file file (or speed 1.0)))) -(defun org-fc-audio-play-file (file) - "Play the audio file FILE." +(defun org-fc-audio-play-file (file speed) + "Play the audio FILE at SPEED." (start-process-shell-command "org-fc audio" nil - (format "mpv %s" file))) + (format "mpv %s --speed=%f" file speed))) (add-hook 'org-fc-before-setup-hook |