Replace the O(n) wav pool lookup with an O(1) lookup.