cheofusi / just_playback

A small library for playing audio files in python, with essential playback functionality.
MIT License
64 stars 7 forks source link

Add start position for "play" function #23

Closed PrajwalVandana closed 1 year ago

PrajwalVandana commented 1 year ago

I wanted to add a stop too, but I have no idea how to do that in a nice way

Let me know if this is inefficient or buggy

cheofusi commented 1 year ago

Hi Praj,

Thanks for the Pull request and sorry about the delay in responding.

Is this necessary ?? Adding a starting position as an argument to the play() would duplicate functionality already provided by seek(). Allowing this would make seek() only useful for changing the position when playback is paused.

I believe the feature you're requesting is this, where we have play(start_pos, end_pos). But duplicating functionality is the reason I'd rather leave this to the user.

What do you think?

PrajwalVandana commented 1 year ago

Yeah, that's true ... it would duplicate functionality ... my reasoning is that it would make sense for people thinking "how can I start 5 seconds in" for that to be an option directly in the play method, but if you think that is an unnecessary level of abstraction feel free to close the PR

Thanks for the response though!