diff --git a/front/API.ts b/front/API.ts index bb8bdbd..f2be7cf 100644 --- a/front/API.ts +++ b/front/API.ts @@ -72,7 +72,6 @@ function getBaseAPIUrl() { } return '/api'; } - console.log(process.env.EXPO_PUBLIC_API_URL); if (process.env.EXPO_PUBLIC_API_URL) { return process.env.EXPO_PUBLIC_API_URL; } @@ -782,7 +781,6 @@ export default class API { } public static getPartitionMelodyUrl(songId: number): string { - // return 'https://cdn.discordapp.com/attachments/717080637038788731/1193948941914488862/Short1.mp3?ex=65ae929a&is=659c1d9a&hm=ea21e4b67f8f04388b67fe70e8de11e0110a1ac5c9b13714e21d921a08300992&'; return `${API.baseUrl}/song/${songId}/assets/melody`; } } diff --git a/front/components/Play/PartitionMagic.tsx b/front/components/Play/PartitionMagic.tsx index d0402f7..a3d95e6 100644 --- a/front/components/Play/PartitionMagic.tsx +++ b/front/components/Play/PartitionMagic.tsx @@ -101,6 +101,7 @@ const PartitionMagic = ({ if (melodySound.current) { melodySound.current.pauseAsync(); melodySound.current.unloadAsync(); + melodySound.current = null; } if (piano.current) { piano.current.stop(); @@ -138,18 +139,6 @@ const PartitionMagic = ({ return; } if (shouldPlay) { - melodySound.current.getStatusAsync().then((status) => { - const lastCur = data!.cursors[data!.cursors.length - 1]!; - const maxTs = lastCur.timestamp + lastCur.timing; - //@ts-expect-error error in the type - const newRate = status.durationMillis! / maxTs; - console.log('newRate', newRate); - if (newRate < 0 || newRate > 2) { - console.error('wrong rate'); - } else { - melodySound.current?.setRateAsync(newRate, false); - } - }); melodySound.current.playAsync().then(onPlay).catch(console.error); } else { melodySound.current.pauseAsync().then(onPause).catch(console.error); @@ -176,7 +165,6 @@ const PartitionMagic = ({ currentCurIdx.current, timestamp + transitionDuration, (cursor, idx) => { - console.log('cursor', cursor, status); currentCurIdx.current = idx; partitionOffset.value = withTiming( -(cursor.x - data!.cursors[0]!.x) / partitionDims[0], @@ -199,7 +187,6 @@ const PartitionMagic = ({ currentCurIdx.current, timestamp + transitionDuration, (cursor, idx) => { - console.log('cursor', cursor); currentCurIdx.current = idx; partitionOffset.value = withTiming( -(cursor.x - data!.cursors[0]!.x) / partitionDims[0],