Android Loading & Playing Sound Based on String

Posted by Chance on Stack Overflow See other posts from Stack Overflow or by Chance
Published on 2011-01-12T02:13:04Z Indexed on 2011/01/12 2:54 UTC
Read the original article Hit count: 165

Filed under:
|
|
|
|

I'm currently working on a simple Android app, and right now I am trying to get it to load in and play sounds. The problem I am faced with is that I want the sound it uses to be based on a string (With the same name as the sound file). The reason for this is simplicity in both the code and adding on to it.

Now unfortunately I can't just slap a string in place of referencing the actual sound, but is there some way for me to compare a string to the entire raw folder to find the matching sound, or some other alternative short of defining every sound manually?

Thank you for your time.

© Stack Overflow or respective owner

Related posts about android

Related posts about string