Try explaining the requirement, not the implementation. Apparently you want to play different sound files and need to specify them by name. It's not at all clear why, or what's wrong with the solution you were given.
Try explaining the requirement, not the implementation. Apparently you want to play different sound files and need to specify them by name. It's not at all clear why, or what's wrong with the solution you were given.