|
@@ -26,10 +26,10 @@ export const audioData = reactive({
|
|
|
banSongEle: null as HTMLAudioElement | null,
|
|
|
mingSongEle: null as HTMLAudioElement | null,
|
|
|
beatSongEle: null as HTMLAudioElement | null,
|
|
|
- betaBackgroundEle: null as HTMLAudioElement | null,
|
|
|
- betaFanSongEle: null as HTMLAudioElement | null,
|
|
|
- betaBanSongEle: null as HTMLAudioElement | null,
|
|
|
- betaMingSongEle: null as HTMLAudioElement | null
|
|
|
+ beatBackgroundEle: null as HTMLAudioElement | null,
|
|
|
+ beatFanSongEle: null as HTMLAudioElement | null,
|
|
|
+ beatBanSongEle: null as HTMLAudioElement | null,
|
|
|
+ beatMingSongEle: null as HTMLAudioElement | null
|
|
|
},
|
|
|
midiRender: false,
|
|
|
progress: 0, // midi播放进度(单位:秒)
|
|
@@ -150,10 +150,10 @@ export const toggleMutePlayAudio = (source: IPlayState, muted: boolean) => {
|
|
|
};
|
|
|
|
|
|
/** 切换节拍器音源 */
|
|
|
-export const changeSongSourceByBate = (isDisBate:boolean) => {
|
|
|
+export const changeSongSourceByBeat = (isDisBeat:boolean) => {
|
|
|
const currentTime = getAudioCurrentTime()
|
|
|
- // isDisBate 为true 切换到不带节拍的,为false 切换到带节拍的
|
|
|
- if (isDisBate) {
|
|
|
+ // isDisBeat 为true 切换到不带节拍的,为false 切换到带节拍的
|
|
|
+ if (isDisBeat) {
|
|
|
if(state.playType === "play"){
|
|
|
audioData.songEle = audioData.songCollection.songEle
|
|
|
audioData.backgroundEle = audioData.songCollection.backgroundEle
|
|
@@ -166,11 +166,11 @@ export const changeSongSourceByBate = (isDisBate:boolean) => {
|
|
|
// 没有节拍器资源的时候 用 不带节拍器的资源,防止播放不了
|
|
|
if(state.playType === "play"){
|
|
|
audioData.songEle = audioData.songCollection.beatSongEle || audioData.songCollection.songEle
|
|
|
- audioData.backgroundEle = audioData.songCollection.betaBackgroundEle || audioData.songCollection.backgroundEle
|
|
|
+ audioData.backgroundEle = audioData.songCollection.beatBackgroundEle || audioData.songCollection.backgroundEle
|
|
|
} else {
|
|
|
- audioData.songEle = audioData.songCollection.betaFanSongEle || audioData.songCollection.fanSongEle
|
|
|
- audioData.backgroundEle = audioData.songCollection.betaBanSongEle || audioData.songCollection.banSongEle
|
|
|
- audioData.mingSongEle = audioData.songCollection.betaMingSongEle || audioData.songCollection.mingSongEle
|
|
|
+ audioData.songEle = audioData.songCollection.beatFanSongEle || audioData.songCollection.fanSongEle
|
|
|
+ audioData.backgroundEle = audioData.songCollection.beatBanSongEle || audioData.songCollection.banSongEle
|
|
|
+ audioData.mingSongEle = audioData.songCollection.beatMingSongEle || audioData.songCollection.mingSongEle
|
|
|
}
|
|
|
}
|
|
|
// 设置进度
|
|
@@ -197,7 +197,7 @@ export const changeMingSongType = () =>{
|
|
|
if(mingSongEle&&mingSongGirlEle){
|
|
|
const mingSongType = audioData.mingSongType
|
|
|
audioData.songCollection.mingSongEle = mingSongType === 1 ? mingSongEle : mingSongGirlEle
|
|
|
- audioData.songCollection.betaMingSongEle = mingSongType === 1 ? beatMingSongEle : beatMingSongGirlEle
|
|
|
+ audioData.songCollection.beatMingSongEle = mingSongType === 1 ? beatMingSongEle : beatMingSongGirlEle
|
|
|
}
|
|
|
}
|
|
|
export default defineComponent({
|
|
@@ -387,9 +387,9 @@ export default defineComponent({
|
|
|
const [beatMusic, beatAccompany, beatFanSong, beatBanSong, beatMingSong, beatMingSongGirl] = await loadBeatAudio()
|
|
|
Object.assign(audioData.songCollection, {
|
|
|
beatSongEle:beatMusic,
|
|
|
- betaBackgroundEle:beatAccompany,
|
|
|
- betaFanSongEle:beatFanSong,
|
|
|
- betaBanSongEle:beatBanSong,
|
|
|
+ beatBackgroundEle:beatAccompany,
|
|
|
+ beatFanSongEle:beatFanSong,
|
|
|
+ beatBanSongEle:beatBanSong,
|
|
|
beatMingSongEle:beatMingSong
|
|
|
})
|
|
|
Object.assign(audioData.mingSongTypeCollection, {
|