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

make playback interactive (respond to keypresses, etc) #15

Open
1dancook opened this issue Nov 21, 2023 · 1 comment
Open

make playback interactive (respond to keypresses, etc) #15

1dancook opened this issue Nov 21, 2023 · 1 comment

Comments

@1dancook
Copy link
Owner

It would be better if playback could respond to keypresses.

If the playback backend continues to be mpv, there may be a way to send messages to mpv based on keypresses. Keypresses would have to be captured using something like prompt-toolkit.

This would require a basic re-write (to make the entire app a prompt-toolkit app).

@1dancook
Copy link
Owner Author

Some ideas:

This could be a prompt that iterates through a list of audio files.

For the CURRENT audio file:

  • prompt for input
  • parse input
  • do the action

While an audio file is playing, having keybinds for:

  • play / pause / stop
  • next / previous (?)
  • marking the start and end (live cutting)

Other notes:

Interactive mode would have to disable everything else (narration, tones, delays).

Marking start/end times while listening

Another thing to think about would be how to mark a start and ending point.

I'm thinking about how, while in class, it is often the case that I need to mark a start and end point to use to playback again. Some audio files are not cut, but I need to repeat one section of it.

an AudioFile object should carry with it a start_mark and end_mark.

There should be some key bindings to set these like s/e as well as something to reset it.

    mark start = m s
    mark end   = m e
    mark reset = m r

Potential list of commands to parse from a prompt

play   / p / enter?  # play the current file 
repeat 1  # set repeat to 1
delay 10    # set delay (between repeats) to n seconds
next / > # go to next file
previous / < # go to previous file
mark start 5  / ms 5  # mark start @ 5s (current file)
mark end 10  / me 40  # mark end   @ 40s (current file)
mark reset   / mr     # reset marks for current file
quit

Ideas about the display

It should show a list of the files that shows certain information:

  • the currently selected file
  • the length of the file
  • start/end marks
  • how many times the file has been played

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

1 participant