Redesign wavefile handling using gem wavefile