I'd like to allow audio to keep working when the screen lock is activated. I.e. the computer should not sleep, really, but I want the security of automatic locking.
I'm on OSX 10.8.5, if it matters.
This should work: go to System Preferences > Mission Control > Hot Corners… (button on the lower left). On one of the drop down menus (I recommend the lower left), select Put Display to Sleep. To lock the screen you now just have to place the mouse in the corner you designated, but the time it takes for the lock to engage is determined in the Security and Privacy panel of System Preferences > General. Now when your screen is locked music/audio will continue to play (including Airplay music streaming), also downloads will continue, etc., but a password will be required to turn your screen back on.