def sync_survey_audio(s, machine_id): is_cached = True for p in Prompt.objects.filter(survey=s): if p.dependson: ''' # generate filenames based on possible options of the depending (i.e. earlier in survey) prompt # Don't consider no-input since its ambiguous what to play for question X # if it is dependent on question Y when Y gets no input ''' for opt in Option.objects.filter(prompt=p.dependson).exclude(number=''): is_cached = is_cached and audio_utils.cache_audio(str(p.file) + str(opt.number) + audio_utils.SOUND_EXT) else: is_cached = is_cached and audio_utils.cache_audio(str(p.file)) return is_cached
def sync_survey_audio(s, machine_id): is_cached = True for p in Prompt.objects.filter(survey=s): if p.dependson: ''' # generate filenames based on possible options of the depending (i.e. earlier in survey) prompt # Don't consider no-input since its ambiguous what to play for question X # if it is dependent on question Y when Y gets no input ''' for opt in Option.objects.filter(prompt=p.dependson).exclude( number=''): is_cached = is_cached and audio_utils.cache_audio( str(p.file) + str(opt.number) + audio_utils.SOUND_EXT) else: is_cached = is_cached and audio_utils.cache_audio(str(p.file)) return is_cached
def sync_audio_file(file, machine_id, overwrite=False): audio_utils.cache_audio(file, overwrite)