Skip to content

Commit

Permalink
feat: audio-clip support change volume
Browse files Browse the repository at this point in the history
  • Loading branch information
caohongz committed Jan 21, 2025
1 parent ddb7bbd commit 26c259d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
"@vue/shared": "^3.5.13",
"@vueuse/core": "^9.13.0",
"@vueuse/rxjs": "^11.2.0",
"@webav/av-canvas": "1.0.11",
"@webav/av-cliper": "1.0.11",
"@webav/internal-utils": "1.0.11",
"@webav/av-canvas": "1.0.12",
"@webav/av-cliper": "1.0.12",
"@webav/internal-utils": "1.0.12",
"animate.css": "^4.1.1",
"axios": "^0.27.2",
"concurrently": "^8.2.2",
Expand Down
10 changes: 6 additions & 4 deletions src/views/clipPage/clipPlayer/Player.vue
Original file line number Diff line number Diff line change
Expand Up @@ -315,10 +315,12 @@ const initClip = async (clip: TrackClip) => {
audioClip = newStartClips[1];
}
}
// audioClip.tickInterceptor = async (time, tickRet) => {
// tickRet.audio = tickRet.audio.map((value) => value = value * (clip.volume / 100))
// return tickRet
// }
audioClip.tickInterceptor = async (time, tickRet) => {
tickRet.audio = tickRet.audio.map(
(value) => new Float32Array(value.map((v) => v * (clip.volume / 100)))
);
return tickRet;
};
spr = new VisibleSprite(audioClip);
spr.visible = false;
break;
Expand Down

0 comments on commit 26c259d

Please sign in to comment.