Commit fead0580 authored by ali's avatar ali

feat: 新增视频数字人

parent 8a4126f1
...@@ -10,7 +10,7 @@ const router = useRouter() ...@@ -10,7 +10,7 @@ const router = useRouter()
const route: any = useRoute() const route: any = useRoute()
const { settings } = useStore() const { settings } = useStore()
const setting = storeToRefs(settings) const setting = storeToRefs(settings)
let vconsole: VConsole | null = null; let vconsole: VConsole | null = null
settings.tts === 'xf_tts' && settings.getSource() settings.tts === 'xf_tts' && settings.getSource()
...@@ -31,7 +31,7 @@ function init() { ...@@ -31,7 +31,7 @@ function init() {
}) })
if (setting.vConsole.value) { if (setting.vConsole.value) {
vconsole = new VConsole(); vconsole = new VConsole()
} }
} }
init() init()
...@@ -99,9 +99,9 @@ async function changeOpenDevTools() { ...@@ -99,9 +99,9 @@ async function changeOpenDevTools() {
async function changeOpenVConsole() { async function changeOpenVConsole() {
if (setting.vConsole.value) { if (setting.vConsole.value) {
vconsole = new VConsole(); vconsole = new VConsole()
} else if (vconsole) { } else if (vconsole) {
vconsole.destroy(); vconsole.destroy()
} }
} }
......
...@@ -412,7 +412,7 @@ async function runAudioPlay() { ...@@ -412,7 +412,7 @@ async function runAudioPlay() {
runAudioPlay() runAudioPlay()
} }
await audio.play() await audio.play()
loadVideo(new URL('/libai/10.mp4', import.meta.url).href) loadVideo(role!.playUrl)
videos[1].value!.loop = true videos[1].value!.loop = true
videos[1].value!.muted = true videos[1].value!.muted = true
......
...@@ -65,7 +65,7 @@ const useSettingsStore = defineStore('settings', { ...@@ -65,7 +65,7 @@ const useSettingsStore = defineStore('settings', {
llmToTTSSliceLength: 20, llmToTTSSliceLength: 20,
voskWsLUrl: 'ws://127.0.0.1:2700', voskWsLUrl: 'ws://127.0.0.1:2700',
liveHost: 'http://122.51.32.12:9000', liveHost: 'http://122.51.32.12:9000',
vConsole: true, vConsole: true
}) as ISettings, }) as ISettings,
getters: {}, getters: {},
actions: { actions: {
......
import { defineStore } from 'pinia' import { defineStore } from 'pinia'
type IVideo = { type IVideo = {
list: { url: string; poster: string; name: string; qa: { url: string; q: string; a: string }[] }[] list: {
playUrl: string
url: string
poster: string
name: string
qa: { url: string; q: string; a: string }[]
}[]
} }
const useVideoStore = defineStore('video', { const useVideoStore = defineStore('video', {
...@@ -13,6 +19,7 @@ const useVideoStore = defineStore('video', { ...@@ -13,6 +19,7 @@ const useVideoStore = defineStore('video', {
url: new URL('/libai/wait.mp4', import.meta.url).href, url: new URL('/libai/wait.mp4', import.meta.url).href,
poster: new URL('/libai/poster.jpg', import.meta.url).href, poster: new URL('/libai/poster.jpg', import.meta.url).href,
name: '李白', name: '李白',
playUrl: new URL('/libai/10.mp4', import.meta.url).href,
qa: [ qa: [
{ {
url: new URL('/libai/1.mp4', import.meta.url).href, url: new URL('/libai/1.mp4', import.meta.url).href,
...@@ -69,6 +76,7 @@ const useVideoStore = defineStore('video', { ...@@ -69,6 +76,7 @@ const useVideoStore = defineStore('video', {
{ {
url: new URL('/suhe/wait.mov', import.meta.url).href, url: new URL('/suhe/wait.mov', import.meta.url).href,
poster: new URL('/suhe/poster.jpg', import.meta.url).href, poster: new URL('/suhe/poster.jpg', import.meta.url).href,
playUrl: new URL('/suhe/5.mov', import.meta.url).href,
name: '苏荷', name: '苏荷',
qa: [ qa: [
{ {
...@@ -95,7 +103,7 @@ const useVideoStore = defineStore('video', { ...@@ -95,7 +103,7 @@ const useVideoStore = defineStore('video', {
url: new URL('/suhe/5.mov', import.meta.url).href, url: new URL('/suhe/5.mov', import.meta.url).href,
q: '怎样才能提高工作效率?', q: '怎样才能提高工作效率?',
a: '提高工作效率的方法包括设置具体目标、规划任务清单、减少干扰、使用时间管理技巧,以及保持工作场所的整洁和组织。' a: '提高工作效率的方法包括设置具体目标、规划任务清单、减少干扰、使用时间管理技巧,以及保持工作场所的整洁和组织。'
}, }
] ]
} }
] ]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment