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

Is it possible to change the playback speed? #14

Open
Wyctus opened this issue Jul 24, 2020 · 4 comments
Open

Is it possible to change the playback speed? #14

Wyctus opened this issue Jul 24, 2020 · 4 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@Wyctus
Copy link

Wyctus commented Jul 24, 2020

Can I change the playback speed directly through the library, or should I implement it myself?

Thank you for the help and the great library!

@CasperPas
Copy link
Owner

I think you implement it yourself would be a better solution. You can apply multiple filters to the raw audio data before sending it to the player.

Cheers!

@CasperPas CasperPas added the question Further information is requested label Jul 26, 2020
@Wyctus
Copy link
Author

Wyctus commented Jul 26, 2020

Thank you!
But I think changing the playback speed is not a raw audio manipulation, but some setting on the underlying Android/iOS player. So maybe it would be a nice feature to have on this library.

What do you think?

@CasperPas
Copy link
Owner

I think the easiest way to achieve that without any raw data manipulation is setting the player's frequency higher or lower the recording frequency. However, that would cause a pitch-changed side effect.
I'll look into this anyway, hope it wouldn't add too much overhead to the lib 😁

@Wyctus
Copy link
Author

Wyctus commented Jul 27, 2020

On Android, you can use the setPlaybackParams(PlaybackParams params) method of the Audiotrack to change the speed, without affecting the pitch. I guess something similar exists on iOS too.

Update: On iOS you can use the mAudioEngine.connect(...) method to attach an AVAudioUnitVarispeed.

Hope this helps!

@CasperPas CasperPas added the enhancement New feature or request label Jul 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants