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

Seeking by timestamp, not by byte #10

Open
TonalidadeHidrica opened this issue May 3, 2019 · 12 comments
Open

Seeking by timestamp, not by byte #10

TonalidadeHidrica opened this issue May 3, 2019 · 12 comments
Assignees
Labels

Comments

@TonalidadeHidrica
Copy link
Contributor

Are there any way to seek by specifying timestamp (for example, seek to 1:17 (1 min 17 secs) point or something)? Currently I can only find seek() function that receives byte index...

@goxr3plus
Copy link
Owner

I have implemented this kind of advanced stuff in XR3PLAYER code, i will get some of there and add it here. Well hm we need a little bit of planning about implementing this because what if the audio doesn't have 1:17, there are different cases.

@TonalidadeHidrica
Copy link
Contributor Author

I see. I'll take a look at your XR3PLAYER source code so that I can temporarily implement that feature into my own project, without considering so much about error handling. But I hope more robust one will be implemented in the near future :)

@goxr3plus
Copy link
Owner

Yes i will take care of implementing it maybe even today :).

@goxr3plus
Copy link
Owner

goxr3plus commented May 4, 2019

To tell the truth my knowledge of Java 11 Modular system is not that good, can you guide me what to read to master it?

@TonalidadeHidrica
Copy link
Contributor Author

Modular system was introduced in Java 9, and unfortunately, what I think the easiest guide to understand is not written in English :(

@goxr3plus
Copy link
Owner

@TonalidadeHidrica Do you want to give it a try to implement this feature , i will help you these days . I am thinking of making a new release 9.1.0 soon , including this feature .

@goxr3plus
Copy link
Owner

I release also https://github.com/goxr3plus/java-stream-player/releases/tag/9.0.3 based on your pom :)

@TonalidadeHidrica
Copy link
Contributor Author

Thanks for offering, but I'm being busy these days and cannot spare time for this so much, I'm very sorry. But I would really appreciate if it was implemented!

@goxr3plus
Copy link
Owner

I did it for you @TonalidadeHidrica today , now we have :

1)seekBytes(long bytes);
2)seekSeconds(int seconds); //Skip plus seconds from the current position
3)seekToSeconds(int seconds); //From the beggining of Audio

//TODO

//HH:MM:SS not that hard to implement just converting all to seconds and
//calling seekSeconds(int seconds);
4)seek(String pattern); 

//HH:MM:SS not that hard to implement just converting all to seconds and
//calling seekTo(int seconds);
5)seekTo(String pattern); 

One thing to have in mind.

I am thinking of seekSeconds(int seconds) to accept both negative and positive .

For negative it will go backwards and for non negative it will go forward.

Let me know your opinion :)

@TonalidadeHidrica
Copy link
Contributor Author

Thank you veeeeery much!
I think seekSeconds and seekToSeconds methods should accept double instead of int. Also, I think it's good idea to accept negative values for seekSeconds.

@goxr3plus
Copy link
Owner

Hmso what they will skeep x seconds and y milliseconds?

@goxr3plus
Copy link
Owner

goxr3plus commented May 13, 2019

Tell me something should this method be like this ?

//HH:mm:ss.SSS not that hard to implement just converting all to seconds and
//calling seekTo(int seconds);
5)seekTo(String pattern); 

I should create a validator and parser hm.

So about your seconds request .

i will create one more method called

seekSeconds(int seconds,int milliseconds);
//HH:mm:ss.SSS not that hard to implement just converting all to seconds and

and 2.

//calling seekTo(int seconds);
seekTo(String pattern); 

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

No branches or pull requests

2 participants