Rewind
Rewind

Reputation: 2814

File in assets folder needs a resId to be used

I am new to Android, so this is probably a dumb question.

I have a sound file in my assets folder:

app|assets|www|sounds|hooray.ogg

Now I want to load it into my SoundPool

// THIS IS NOT RIGHT and is underlined in wavy error-red
mySoundPool.load(m_Context,
                "file:///android_asset/www/sounds/hooray.ogg",
                1);

It is saying the "file:///android..." etc should be a resId.

How do I assign a resId to this file?

Upvotes: 0

Views: 147

Answers (1)

CommonsWare
CommonsWare

Reputation: 1006614

How do I assign a resId to this file?

You can't. A resource ID is for resources, not assets.

Either:

Upvotes: 1

Related Questions