Su Windows puoi usare le funzioni PlaySound e GetAsyncKeyState.