Apologies for necro-posting but I thought I might as well post the fix
I found for the non-looping sounds
in the code TJerkW posted.
Essentially setLoop() takes the Id of the instance of the sound that
is being played not the Id of the loaded sound.
So it should look something like this:
I've been able to work around most of the current bugs in SoundPool
while developing a step-sequencer app, but my sticking point is
stopping a non-looping sound once it's started. I've seen this code
suggested here and in a few other threads as a workaround for the
pause/stop bug:
mSoundPool.s
On Sun, Feb 15, 2009 at 12:00 AM, Sundog wrote:
>
> I am using your class and setting it up as you indicate, but having
> the same difficulty I did last time I tried to use SoundPool; I have
> seven one-shot sounds that trigger from buttons and in the emulator it
> works every time, but on the ph
By the way: try to use .ogg files, they are played better by android.
Also i had problems with playLoop(int resid),
sometimes the sample is looped, and sometimes it is not.
A possible usage of the SoundEffects class is by subclassing it.
The code from my example ( i am making a col game! :-
Is the API of the SoundPool the same in cupcake?
I hope so.
For all the people who need a reliable soundpool, i have made a class
that handles the details with soundpool and is easy to use:
import java.util.HashMap;
import android.content.Context;
import android.media.AudioManager;
import andro
There are a lot of fixes to SoundPool coming in the Cupcake release.
I need to check on the crash you mentioned - I don't recall seeing
that before and it should give you an error, not crash. The range is
dependent on the ratio of the sample rate of the source and the
hardware output.
On Feb 13,
I am using your class and setting it up as you indicate, but having
the same difficulty I did last time I tried to use SoundPool; I have
seven one-shot sounds that trigger from buttons and in the emulator it
works every time, but on the phone itself, occasionally all 7 work but
usually only a rand
Increasing the capacity of the SoundPool solved the problem. Thank
you!
On Feb 13, 5:34 pm, Marco Nelissen wrote:
> There is a known problem (fixed in cupcake) with SoundPool that will cause
> it to lock up if you try to play more simultaneous sounds than the capacity
> of the SoundPool. If you
One more thing you need to know:
Soundpool crashes if you change the pitch over 1.5 or under .5. I
created multiple "engine" samples for higher and higher pitches, so no
matter how high you hear the engine on light racer, it never goes
above 1.5 playback rate. Soundpool is actually a really nic
There is a known problem (fixed in cupcake) with SoundPool that will cause
it to lock up if you try to play more simultaneous sounds than the capacity
of the SoundPool. If you specify the capacity of the SoundPool to be higher
than the largest number of sounds you will ever play at the same time, t
Wow! Thanks very much!
On Feb 13, 6:29 am, "tasos.klei...@gmail.com"
wrote:
> I have written a class that utilises MediaPlayer and SoundPool
> objects. MediaPlayer is used to play looping music and SoundPool is
> used for sound effects. Have a look at my
> bloghttp://tkcodesharing.blogspot.co
I have written a class that utilises MediaPlayer and SoundPool
objects. MediaPlayer is used to play looping music and SoundPool is
used for sound effects. Have a look at my blog
http://tkcodesharing.blogspot.com/2009/02/class-for-playing-music-and-sound.html
--~--~-~--~~~-
Thanks for information.
I'm already using OGG files totaling about 200kB. The original
uncompressed WAV files are 1.4MB. I'll try to further reduce number of
files and the total size. Also, I'm not using stop/pause as it crashes
the application instantly :)
Robert, are you saying that your appli
You need to ask Robert for the details, but I think SoundPool.play's
method has an argument controlling pitch (I don't remember which if
the 3rd to 5th argument that was).
On Fri, Feb 13, 2009 at 11:14 AM, Markus Junginger wrote:
>
>
> On Feb 13, 9:04 am, Stoyan Damov wrote:
>> Listen to Robert
On Feb 13, 9:04 am, Stoyan Damov wrote:
> Listen to Robert's advice, and most importantly, if you don't have a
> need to manipulate the sounds during the game (e.g. Robert changes the
> pitch dynamically in his game) ...
How does Robert implement pitching? Is there a recommended lib?
A nice sou
I think I might be able to decouple the pool from my game and get rid
of some entropy which sneaked in over the months, and then I don't
mind posting it here. Only it's Friday 13th and I don't release on
this date :P Seriously though my daughter turned 1 today, so I don't
think I'll work in the ev
Has anyone been kind enough to create a sound/media pool using
MediaPlayer instances and made it open source for the rest of us to
use? It seems like it is a pretty common problem that many developers
could take advantage of some well written and tested code.
Peter
On Feb 13, 12:04 am, Stoyan D
Listen to Robert's advice, and most importantly, if you don't have a
need to manipulate the sounds during the game (e.g. Robert changes the
pitch dynamically in his game) stay away from the SoundPool.
Simply build your own sound pool based on MediaPlayer instances - I
know it works. It probably co
David,
Please search and read about all my soundpool tests. Basically you
must use OGGs totalling under 1MB and you can't call the stop or pause
methods. Many of us use it but you must be careful.
On Feb 12, 3:11 pm, djp wrote:
> Hi,
>
> there seems to be a dead-lock problem when using sound
19 matches
Mail list logo