How to handle collection of sounds for a game?
<p>We are working on a number of games that have a variety of sound effects as well as spoken phrases and expressions.  The current design stores the sound snippets as individual numbered files.  A set of #defines maps a human-readable name to the file name.  For example:</p>

<pre><code>#define SOUND_COOL              @"0038"  // Cool!
#define SOUND_YOU_GOT_IT        @"0039"  // You got it!
#define SOUND_FANTASTIC_1       @"0040"  // Fantastic! version 1
#define SOUND_FANTASTIC_2       @"0041"  // Fantastic! version 2
</code></pre>

<p>One advantage of this approach is that the code becomes very readable.  You can see what sound will play just by reading.</p>

<p>One of the problems with this is that we have many intonations or versions of some phrases.  Whenever appropriate, a hand-coded switch statement randomly chooses from among the available versions.  </p>

<p>It would be nice to generalize this and have the option to play a random version if more than one is available.  One option here could be to abandon the #define approach and create a proper database table with fields that allow for selection of all sound files matching a given criteria.  A class and methods would then encapsulate the desired functionality.  </p>

<p>What are some of the other ideas for organizing/cataloging sound in applications that might have hundreds of sound files?</p>
