Refactor audio player, add retry timeout

Fixes #442.