- use cached audio before backend's one
This commit is contained in:
parent
26098649f2
commit
6afb7f9f12
|
|
@ -312,14 +312,14 @@ def run_caller_task(t):
|
||||||
os.remove(LOADED_AUDIO)
|
os.remove(LOADED_AUDIO)
|
||||||
|
|
||||||
audio_id = t["audio_id"]
|
audio_id = t["audio_id"]
|
||||||
if not BackendServer.load_audio(audio_id, LOADED_AUDIO):
|
if CACHE.get_reference_audio(audio_id, LOADED_AUDIO):
|
||||||
utils.log_error(f'Failed to load reference audio with ID {audio_id}.')
|
utils.log(f'Reference audio {audio_id} found in cache.')
|
||||||
if CACHE.get_reference_audio(audio_id, LOADED_AUDIO):
|
|
||||||
utils.log(f' Found in cache.')
|
|
||||||
else:
|
|
||||||
utils.log(f' Failed to find the audio in cache.')
|
|
||||||
raise RuntimeError(f'Reference audio (ID: {audio_id}) is not available.')
|
|
||||||
else:
|
else:
|
||||||
|
utils.log(f'Reference audio {audio_id} not found in cache.')
|
||||||
|
if not BackendServer.load_audio(audio_id, LOADED_AUDIO):
|
||||||
|
utils.log_error(f'Failed to load reference audio with ID {audio_id}.')
|
||||||
|
raise RuntimeError(f'Reference audio (ID: {audio_id}) is not available.')
|
||||||
|
|
||||||
# Cache loaded audio
|
# Cache loaded audio
|
||||||
CACHE.add_reference_audio(audio_id, LOADED_AUDIO)
|
CACHE.add_reference_audio(audio_id, LOADED_AUDIO)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue