Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature request] Define functions for changing the playback while audio is playing #70

Closed
rodrigomorales1 opened this issue Jun 23, 2024 · 2 comments

Comments

@rodrigomorales1
Copy link

rodrigomorales1 commented Jun 23, 2024

My use case: I'm currently editing subtitles for audios in my native language. While I'm editing subtitles, I have noticed that some parts in the audio are very easy to understand for me, so in these parts I wish I could set the playback speed to something very fast (e.g. (setq subed-playback-speed-while-not-typing 4)) in order to better use my time. Some parts in the audio are very difficult to understand (e.g. for some reason the speaker decided to speak faster than usual), so in these parts I wish I could set the the playback speed to the normal speed (i.e. (setq subed-playback-speed-while-not-typing 1)).

The current master branch supports setting subed-playback-speed-while-not-typing and this option is only used for new instances of mpv that subed launches. As far as I know, there is no subed functions for changing the subed-playback-speed-while-not-typing while mpv is already playing the media file.

I wish I could have a function that would let me change the playback for an already mpv instance which was opened by subed.

@rodrigomorales1
Copy link
Author

rodrigomorales1 commented Jun 23, 2024

After writing the issue, I just realized that there is a function for changing the playback speed for the current mpv instance. The function is called subed-mpv-playback-speed. These are the functions that I defined:

(defun my-subed-mpv-playback-speed-1 () (interactive) (subed-mpv-playback-speed 1))
(defun my-subed-mpv-playback-speed-2 () (interactive) (subed-mpv-playback-speed 2))
(defun my-subed-mpv-playback-speed-3 () (interactive) (subed-mpv-playback-speed 3))
(defun my-subed-mpv-playback-speed-4 () (interactive) (subed-mpv-playback-speed 4))

The following shows how I mapped the functions:

(define-minor-mode
  my-subed-custom-keys-minor-mode
  "Custom keys for `subed-mode'."
  :keymap (let ((map (make-sparse-keymap)))
            (define-key map (kbd "M-1") 'my-subed-mpv-playback-speed-1)
            (define-key map (kbd "M-2") 'my-subed-mpv-playback-speed-2)
            (define-key map (kbd "M-3") 'my-subed-mpv-playback-speed-3)
            (define-key map (kbd "M-4") 'my-subed-mpv-playback-speed-4)
            map))

@sachac
Copy link
Owner

sachac commented Jun 27, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants