Play a sound when key is pressed, stop when no longer pressing.

Yep, this is correct. Also, if you want to have more gentle transitions, you can use the Fade In function to play the sound with a defined linear fade-in time, and the Fade Out function, which will execute a linear fade-out of the audio over a specified time and then stop.
Best-
Zak