refactor sound module, fix some bugs