Sync and background music code implement