mirror of
https://github.com/sun-guannan/CapCutAPI.git
synced 2025-11-25 03:15:00 +08:00
fix add audio effect bug
This commit is contained in:
@@ -120,24 +120,32 @@ def add_audio_track(
|
|||||||
|
|
||||||
if IS_CAPCUT_ENV:
|
if IS_CAPCUT_ENV:
|
||||||
# In CapCut environment, look for effects in CapCut_Voice_filters_effect_type
|
# In CapCut environment, look for effects in CapCut_Voice_filters_effect_type
|
||||||
effect_type = getattr(CapCut_Voice_filters_effect_type, effect_name)
|
try:
|
||||||
# If not found in Voice_filters, continue searching in other CapCut effect types
|
effect_type = getattr(CapCut_Voice_filters_effect_type, effect_name)
|
||||||
if effect_type is None:
|
except AttributeError:
|
||||||
# Look for effects in CapCut_Voice_characters_effect_type
|
try:
|
||||||
effect_type = getattr(CapCut_Voice_characters_effect_type, effect_name)
|
# Look for effects in CapCut_Voice_characters_effect_type
|
||||||
# If still not found, look for effects in CapCut_Speech_to_song_effect_type
|
effect_type = getattr(CapCut_Voice_characters_effect_type, effect_name)
|
||||||
if effect_type is None:
|
except AttributeError:
|
||||||
effect_type = getattr(CapCut_Speech_to_song_effect_type, effect_name)
|
# If still not found, look for effects in CapCut_Speech_to_song_effect_type
|
||||||
|
try:
|
||||||
|
effect_type = getattr(CapCut_Speech_to_song_effect_type, effect_name)
|
||||||
|
except AttributeError:
|
||||||
|
effect_type = None
|
||||||
else:
|
else:
|
||||||
# In JianYing environment, look for effects in Audio_scene_effect_type
|
# In JianYing environment, look for effects in Audio_scene_effect_type
|
||||||
effect_type = getattr(Audio_scene_effect_type, effect_name)
|
try:
|
||||||
# If not found in Audio_scene_effect_type, continue searching in other effect types
|
effect_type = getattr(Audio_scene_effect_type, effect_name)
|
||||||
if effect_type is None:
|
except AttributeError:
|
||||||
effect_type = getattr(Tone_effect_type, effect_name)
|
# If not found in Audio_scene_effect_type, continue searching in other effect types
|
||||||
# If still not found, look for effects in Speech_to_song_type
|
try:
|
||||||
if effect_type is None:
|
effect_type = getattr(Tone_effect_type, effect_name)
|
||||||
effect_type = getattr(Speech_to_song_type, effect_name)
|
except AttributeError:
|
||||||
# Additional effect type lookup logic can be added here as needed
|
# If still not found, look for effects in Speech_to_song_type
|
||||||
|
try:
|
||||||
|
effect_type = getattr(Speech_to_song_type, effect_name)
|
||||||
|
except AttributeError:
|
||||||
|
effect_type = None
|
||||||
|
|
||||||
# If corresponding effect type is found, add it to the audio segment
|
# If corresponding effect type is found, add it to the audio segment
|
||||||
if effect_type:
|
if effect_type:
|
||||||
|
|||||||
Reference in New Issue
Block a user