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

Sound speed on Android #9

Open
franap opened this issue Dec 22, 2014 · 1 comment
Open

Sound speed on Android #9

franap opened this issue Dec 22, 2014 · 1 comment

Comments

@franap
Copy link

franap commented Dec 22, 2014

When I added android_api in my sketch, speed for playing wav files was not normal.

Basically I tried this code:

Maxim maxim;
AudioPlayer player;
...
maxim = new Maxim(this);
player = maxim.loadFile("test.wav");
player.setLooping(false);
...
player.play();

However, the audio file is beeing played too quickly in my phone. It is more than twice times the normal speed (I tried player.speed(0.5) and even then it was too fast).

@franap
Copy link
Author

franap commented Dec 23, 2014

I've discovered a solution to the problem. The real problem is that maxim only works fine for 705kbps bitrate. The audio file that I was testing had only 256kbps and it was played as it was of 705kbps. So the speed in wich it was playing the audio was 705/256.

I have actually 2 solutions:

  1. Modify the audio file bitrate
  2. Set speed every time as (wav bitrate/705)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant