I'm working on a rhythm game and one of its features is the backing track increases its playback speed every time a round has cleared. Currently, I'm generating different pcm files with different tempos for each backing track. Unfortunately, this can significantly increase the size of the app. I was thinking if there is any way I can use oboe to change its playback speed? Has anyonen tried this? Can you please point me to the right direction on how to do this using ndk? Appreciate the help
Asked
Active
Viewed 543 times
2 Answers
0
The RhythmGame sample can now use FFmpeg which supports resampling when extracting a compressed asset (full article here).
You could specify a different sample rate here and re-extract the compressed audio on each round.
Another solution would be to use libresample from FFmpeg to resample the already extracted audio on the fly.

donturner
- 17,867
- 8
- 59
- 81
-
Thanks for the reply @donturner! I will try your suggestions – Mike Diente Apr 03 '19 at 19:55
0
Wouldn't it be possible to increase the amount of data you skip when rendering the sampledata in your onAudioReady callback? For example, if you wanted to run at twice the speed, skip alternate samples. Fixed point maths would allow you to select any output rate.

Steven Haggerty
- 308
- 3
- 15