Skip to content

Android SoundPlayer: setSpeed(), getPosition() #1714

@thiagohersan

Description

@thiagohersan

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...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions