openframeworks / openframeworks/openFrameworks
Android SoundPlayer: setSpeed(), getPosition()
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 10.4k
- Forks
- 2.6k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 9
Description
This is what I found while running the androidSoundPlayerExample: for each of the 3 audio players, at any given time, either setSpeed( ) works, or getPosition( ) works, but never both.
I think it has to do with the stream variable and multiplay functionality. And whether the sound is beng played with the MediaPlayer object, or the SoundPool.
Looking at getPosition() you can see that if stream is not true, and we're using a SoundPool, it always returns zero for the position.
And in setSpeed(...), if stream is true, and we're using a MediaPlayer, it doesn't really use the speed variable anywhere.
Is this some limitation of Android? MediaPlayer doesn't seem to have a setSpeed method, and SoundPool doesn't have a getPosition...
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with androidSoundPlayerExample and the getPosition() and setSpeed() methods in addons/ofxAndroid/ofAndroidLib/src/cc/openframeworks/OFAndroidSoundPlayer.java. Compare the MediaPlayer and SoundPool paths, including stream and multiplay behavior, against the Android MediaPlayer and SoundPool APIs. Done means the supported behavior for setSpeed() and getPosition() is consistent or clearly represented in the implementation and example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, cpp, java
- Domain
- audio-video-rtc, mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100