refine code, use macro for hls resample audio