0

I have to let the Smart phone vibrate and simultaneously play a sound.

I tried something like this:

soundPool.play(sID, 1.0f, 1.0f, 1, 0,1.0f);
vibrator.vibrate(90);

The Problem is that the Phone vibrates instantly but the soundpool starts with a little delay.

Linger
  • 14,942
  • 23
  • 52
  • 79

1 Answers1

0

You can use vibrator.vibrate(long[] pattern, int repeat) method. The first value in the pattern array indicates the number of milliseconds to wait before turning the vibrator on.

vasart
  • 6,692
  • 38
  • 39
  • Thank you, but I don't want to wait. Both feedback types have to start instantly! – Markus Masquerade Sep 07 '12 at 14:15
  • Have a look at this thread https://groups.google.com/forum/?fromgroups=#!topic/android-developers/1QOMyoJU7bU – vasart Sep 07 '12 at 14:19
  • I found it by myself a while ago. No solution for me I always test on hardware. The mysterious thing is: Galaxy Nexus S has no delay, HTC desire has delay. But I have to use the Desire because of the stronger vibrator... – Markus Masquerade Sep 07 '12 at 14:23