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

Playback speed control #1

Closed
yringler opened this issue Dec 1, 2019 · 15 comments
Closed

Playback speed control #1

yringler opened this issue Dec 1, 2019 · 15 comments
Assignees
Projects

Comments

@yringler
Copy link

yringler commented Dec 1, 2019

A way to change the playback speed would be great.
This is a much requested feature in my app.

@ryanheise ryanheise self-assigned this Dec 2, 2019
@ryanheise
Copy link
Owner

Hi @yringler

This is definitely an important feature.

Preferably I'd want to forego the built-in time stretching APIs in iOS and Android and do something that will give high quality results that are optimised for speech. I assume you probably also want this for speech since that's the most common use case for time stretching, but if not, this approach should also be fine for music.

I'd probably implement this approach for Android first where I already have an idea of how to do things, and use the built-in APIs for iOS at least in the short term until I learn more about the necessary low level APIs.

@yringler
Copy link
Author

yringler commented Dec 2, 2019

Yup, my use case is classes - just speech.

@ryanheise
Copy link
Owner

I've just implemented time stretching on the Android side if you'd like to test it. I'll publish it after implementing and testing the iOS side. I'd like to eventually use the same time stretching algorithm on iOS that I'm using on Android, but for now I plan to just use the native playback rate feature in the iOS APIs.

Are you using this on Android or iOS or both?

@yringler
Copy link
Author

yringler commented Dec 25, 2019

My app (still in public beta) which uses this plugin is currently running on both android and iOS devices.

@ryanheise
Copy link
Owner

OK, I'd say this plugin is still pre-beta on the iOS side which gives me some urgency to try to finish its implementation. One thing I noticed so far with the iOS implementation is that the state gets confused when reaching the end of the track. I hope to fix this while I'm working on the other iOS things, in particular, the iOS implementation of time stretching. Once I'm done, I'll let you know so that you can try it out.

@ryanheise
Copy link
Owner

I've just implemented the iOS side and fixed the updating of state after stopping. If you have an iPhone or iPhone simulator, I would be interested to know if the time stretching works. The documentation says that time stretching will not work for streamed media such as that used in my demo example, however the API calls I'm making to detect whether time stretching is supported are telling me that it is supported even though the audio is being streamed.

@yringler
Copy link
Author

The documentation says that time stretching will not work for streamed media such as that used in my demo example, however the API calls I'm making to detect whether time stretching is supported are telling me that it is supported even though the audio is being streamed.

Interesting. Currently, I'm playing from URL. Eventually, I'd like to switch to progressive download.

If you have an iPhone or iPhone simulator, I would be interested to know if the time stretching works.

I'm out of town until January 2nd. The week of January 5th I hope to get back into things.

OK, I'd say this plugin is still pre-beta on the iOS side which gives me some urgency to try to finish its implementation.

I haven't yet added play speed UI to my app. I have a small list of things to do until I release to the app/play store. If you have a preference, I can either implement speed control next, or push it off until after the other things are done.

@yringler
Copy link
Author

If you have an iPhone or iPhone simulator, I would be interested to know if the time stretching works.

I have a free license from the nice folks at browserstack. It can be used to test apps on real devices in the cloud.
If you want, I can add you as a user, or you could drop them a line and get an account. They love open source

@ryanheise
Copy link
Owner

@yringler That sounds really interesting! I'm definitely going to look into it. How would the workflow work given that this plugin example would not be published on the app store?

@yringler
Copy link
Author

You can also an APK. It gets saved in your account, and can later quickly be used to run the app.
I'm sure it's possible to set up some CI to do things automatically, but I never looked into it.

@ryanheise
Copy link
Owner

Speaking mainly in terms of iOS, does browserstack build the app executable or do I build that on my own mac (i.e. MacInCloud or Codemagic) and then upload that to browserstack so that it can do some sort of side loading to get it onto the iPhone?

@yringler
Copy link
Author

You would build it on your own and then upload the ipa.
You can create a free account with like 30 minutes of cloud phone usage, and after your application for a free opensource account is approved, you can send them your account ID and they'll activate it.

In regards to audio_service - I don't know if the iOS functionality needed for it is enabled, but if it isn't you can try reaching out to them and see what they say.

@yringler
Copy link
Author

yringler commented Mar 1, 2020

I just recently added speed control to my app.
I developed it on iOS (with an emulator), and it worked there, so it probably works.
It hasn't been used extensively yet, though.
(Yes, I released to end users without extensive testing 😞 )

@yringler
Copy link
Author

yringler commented Mar 1, 2020

Closing this issue. As far as I can tell, speed control works great on android and iOS, and any other bugs which might arise could be a new issue.
Thank you!

@github-actions
Copy link

github-actions bot commented Nov 8, 2021

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs, or use StackOverflow if you need help with just_audio.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
No open projects
just_audio
  
Done
Development

No branches or pull requests

2 participants