Skip to content

Commit

Permalink
视频合成效果优化
Browse files Browse the repository at this point in the history
  • Loading branch information
wayne committed Jun 20, 2024
1 parent e41ec6b commit 796ec2a
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 24 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ https://www.bilibili.com/video/BV16VVGefEp1/?spm_id_from=333.999.0.0&vd_source=a

# 更新列表

- 20240620 优化视频合成效果,让视频结束更加自然。
- 20240619 语音识别和语音合成**支持腾讯云**。 需要开通腾讯云语音合成和语音识别这两个功能
- 20240615 语音识别和语音合成**支持阿里云**。 需要开通阿里云智能语音交互功能--必须开通语音合成和录音文件识别(极速版)这两个功能
- 20240614 资源库支持pixabay,支持语音试听功能,修复一些bug
Expand Down
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from services.resource.pixabay_service import PixabayService
from services.video.video_service import get_audio_duration, VideoService
from tools.tr_utils import tr
from tools.utils import random_with_system_time, get_must_session_option
from tools.utils import random_with_system_time, get_must_session_option, extent_audio

# 获取当前脚本的绝对路径
script_path = os.path.abspath(__file__)
Expand Down Expand Up @@ -117,7 +117,7 @@ def main_generate_video_dubbing():
audio_voice,
audio_rate)
# 语音扩展2秒钟,防止突然结束很突兀
# extent_audio(audio_output_file, 2)
extent_audio(audio_output_file, 2)
print("main_generate_video_dubbing end")


Expand Down
8 changes: 0 additions & 8 deletions services/audio/azure_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@

sys.exit(1)

# audio_provider = my_config['audio']['provider']
# speech_key = my_config['audio']['Azure']['speech_key']
# service_region = my_config['audio']['Azure']['service_region']



class AzureAudioService(AudioService):

Expand Down Expand Up @@ -102,10 +97,7 @@ def speech_synthesis_with_voice(self, text, voice):

def speech_synthesis_with_voice_ssml(self, ssml):
speech_config = speechsdk.SpeechConfig(subscription=self.speech_key, region=self.service_region)
# voice = "zh-CN-XiaoyiNeural"
# speech_config.speech_synthesis_voice_name = voice
speech_synthesizer = speechsdk.SpeechSynthesizer(speech_config=speech_config)

result = speech_synthesizer.speak_ssml_async(ssml).get()
# Check result
if result.reason == speechsdk.ResultReason.SynthesizingAudioCompleted:
Expand Down
14 changes: 0 additions & 14 deletions services/video/texiao_service.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
import streamlit as st

# fade_duration = 1
# transition_type = 'fade'
# fade_list = ['fade', 'smoothleft', 'smoothright', 'smoothup', 'smoothdown', 'circlecrop', 'rectcrop', 'circleclose',
# 'circleopen', 'horzclose', 'horzopen', 'vertclose',
# 'vertopen', 'diagbl', 'diagbr', 'diagtl', 'diagtr', 'hlslice', 'hrslice', 'vuslice', 'vdslice', 'dissolve',
# 'pixelize', 'radial', 'hblur',
# 'wipetl', 'wipetr', 'wipebl', 'wipebr', 'zoomin', 'hlwind', 'hrwind', 'vuwind', 'vdwind', 'coverleft',
# 'coverright', 'covertop', 'coverbottom', 'revealleft', 'revealright', 'revealup', 'revealdown']

# transition_type = st.session_state["video_transition_effect_type"]
# transition_value = st.session_state["video_transition_effect_value"]
# transition_duration = st.session_state["video_transition_effect_duration"]


def gen_filter(segments, target_width, target_height,transition_type, transition_value, transition_duration ,with_audio=False):
video_fades = ""
audio_fades = ""
Expand Down

0 comments on commit 796ec2a

Please sign in to comment.