Hi there,

I am facing an "Unable to load sample: (null)" error with the SoundPool,
while trying to load a sample (not surprising, yeah?).

I have discarded all common flaws that should raise that kind of error,
so the file does exists (I can see it there), the file is readable
(assets manager seems to read it with no problem), and the file is not
corrupt (I can reproduce it with a wav player without problems).

So I do not know what could be the cause of this error. Here is the code
snippet:

        try {
            AssetFileDescriptor assetDescriptor = assets.openFd(filename);
            int soundId = soundPool.load(assetDescriptor, 0);
            return new AndroidSound(soundPool, soundId);
        } catch (IOException e) {
            throw new RuntimeException("Couldn't load sound '" +
filename + "'");
        }

assets is an AssetManager instance, and it loads pretty well other
samples in the same directory. It does not raises an IOException, so it
is pretty clear that the file is there and it is readable, but when
executing the soundPool.load line, it complains with the error "Unable
to load sample: (null)".

Any ideas?

Thanks a million,

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to