Wav file

I’m building an app that allows users to sample .wav files.

What is the best way to have RoR play sounds?

I was just going to do something like this, but am wondering if there is
a better way.

Thanks!