Fix a loop bug in soundplay.