Skip to content

feat: Audio Playback #529

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

Closed
wants to merge 2 commits into from
Closed

feat: Audio Playback #529

wants to merge 2 commits into from

Conversation

csponge
Copy link
Contributor

@csponge csponge commented Sep 29, 2024

This PR adds the ability to play audio files. Additionally, it adds a few new UI elements for interacting with audio. Below is a list of the newly added elements:

  • Slider (used for changing the current position in the file)
  • Play/Pause
  • Mute/Unmute

NOTE: There are a few bugs to work out, but I think they would be better suited for new issues because they affect more than just the audio player.

Refs: #450

* Add the ablity to play audio files defined in the AUDIO_TYPES list.

* Add a slider to seek through an audio file.

* Add play/pause and mute/unmute buttons for audio files.

Refs: #450
@CyanVoxel CyanVoxel added Type: Enhancement New feature or request Type: UI/UX User interface and/or user experience labels Oct 1, 2024
@CyanVoxel CyanVoxel mentioned this pull request Oct 2, 2024
3 tasks
@CyanVoxel CyanVoxel added the Status: Review Needed A review of this is needed label Oct 2, 2024
@CyanVoxel CyanVoxel self-assigned this Oct 7, 2024
@csponge csponge closed this by deleting the head repository Nov 1, 2024
@CyanVoxel
Copy link
Member

Any reason why this was closed?

@Nginearing
Copy link
Contributor

Nginearing commented Nov 1, 2024

Any reason why this was closed?

Seems like they didn't realise deleting their fork would close the commit. @csponge

@csponge
Copy link
Contributor Author

csponge commented Nov 4, 2024

Ah, that's my bad. Didn't realize that would happen.

Would it be possible to fix this by recreating the branch? If not, maybe I can open a new PR?

Sorry for the confusion.

@CyanVoxel
Copy link
Member

Ah, that's my bad. Didn't realize that would happen.

Would it be possible to fix this by recreating the branch? If not, maybe I can open a new PR?

Sorry for the confusion.

I believe a new PR would be needed if the original fork and/or branch is deleted, unless there's a way to undo that in a way that GitHub is pleased with that I'm unaware of

@csponge
Copy link
Contributor Author

csponge commented Nov 5, 2024

Okay, I'll work on making a new PR.

Again, sorry for the confusion.

csponge added a commit to csponge/TagStudio that referenced this pull request Nov 6, 2024
Add the ability to play audio files.

Add a slider to seek through an audio file.

Add play/pause and mute/unmute buttons for audio files.

Note: This is a continuation of a mistakenly closed PR:
Ref: TagStudioDev#529

While redoing the changes, I made a couple of improvements.
When the end of the track is reached, the pause button will
swap to the play button and allow the track to be replayed.

Here is the original feature request:
Ref: TagStudioDev#450
@csponge csponge mentioned this pull request Nov 6, 2024
CyanVoxel pushed a commit that referenced this pull request Nov 29, 2024
* feat: Audio Playback

Add the ability to play audio files.

Add a slider to seek through an audio file.

Add play/pause and mute/unmute buttons for audio files.

Note: This is a continuation of a mistakenly closed PR:
Ref: #529

While redoing the changes, I made a couple of improvements.
When the end of the track is reached, the pause button will
swap to the play button and allow the track to be replayed.

Here is the original feature request:
Ref: #450

* fix: prevent autoplay on new track when paused

* refactor: Add MediaPlayer base class.

Added a MediaPlayer base class per some suggestions
in the PR comments. Hopefully this reduces duplicate code
between the audio/video player in the future.

* refactor: add controls to base MediaPlayer class

Move media controls from the AudioPlayer widget
to the MediaPlayer base class. This removes the need
for a separate AudioPlayer class, and allows the
video player to reuse the media controls.

* fix: position_label update with slider

Update the position_label when the slider is moving.

* fix: replace platform dependent time formatting

Replace the use of `-` in the time format since this
is not availabile on all platforms.

Update initial `position_label` value to '0:00'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Review Needed A review of this is needed Type: Enhancement New feature or request Type: UI/UX User interface and/or user experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants