Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions vue/src/charts/package/AudioChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ const audioData = computed(() => {
return stepData[sources.value[0]].map(({ filename, caption }) => {
return {
audioBuffer: audiosData[filename],
audioBlob: blobsData[filename],
title: filename,
caption
}
Expand All @@ -176,6 +177,7 @@ const audioData = computed(() => {
const temp = stepData[exp][currentInnerIndex.value]
data.push({
audioBuffer: audiosData[temp.filename],
audioBlob: blobsData[temp.filename],
title: temp.filename,
caption: temp.caption,
color: projectStore.colorMap[exp],
Expand Down Expand Up @@ -263,8 +265,10 @@ const handleTurn = (direction, value) => {

// 关联 step 与数据
const stepsData = {}
// 缓存
// blob 转 audioBuffer 后的缓存
const audiosData = reactive({})
// blob缓存
const blobsData = {}

/**
* 解析 log 数据
Expand Down Expand Up @@ -316,7 +320,10 @@ const debounceGetAudiosData = debounce(async (stepData) => {
promises.push(
new Promise((resolve) => {
const runid = isMulti.value ? run_id.value[source] : run_id.value
UTILS.media.get(filename, runid, props.title).then((blob) => resolve(transformBlob(blob, filename)))
UTILS.media.get(filename, runid, props.title).then((blob) => {
blobsData[filename] = blob
resolve(transformBlob(blob, filename))
})
})
)
}
Expand Down
2 changes: 1 addition & 1 deletion vue/src/layouts/main/components/HeaderBar.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="w-full h-full bg-dimmest text-dimmest flex justify-between items-center px-6">
<!-- logo and version -->
<div class="flex items-center gap-1.5">
<div class="flex items-center gap-1.5 hover:cursor-pointer" @click="$router.push('/')">
<!-- icon -->
<HeaderIcon />
<!-- version -->
Expand Down