diff --git a/APPRO/APPRO/Views/Stretchings/Hand/HandRollingStretchingView.swift b/APPRO/APPRO/Views/Stretchings/Hand/HandRollingStretchingView.swift index b9e7a84..23c4d17 100644 --- a/APPRO/APPRO/Views/Stretchings/Hand/HandRollingStretchingView.swift +++ b/APPRO/APPRO/Views/Stretchings/Hand/HandRollingStretchingView.swift @@ -104,14 +104,14 @@ struct HandRollingStretchingView: View { let colorValueChangedTo = min (newValue * 2, 6) viewModel.getDifferentRingColor(viewModel.rightGuideRing, intChangeTo: Int32(colorValueChangedTo)) Task { - await viewModel.playRotationChangeRingSound(newValue) + await viewModel.playRotationChangeRingSound(newValue, chirality: .right) } } .onChange(of: viewModel.leftRotationCount, initial: false ) { _, newValue in let colorValueChangedTo = min (newValue * 2 + 1, 7) viewModel.getDifferentRingColor(viewModel.leftGuideRing, intChangeTo: Int32(colorValueChangedTo)) Task { - await viewModel.playRotationChangeRingSound(newValue) + await viewModel.playRotationChangeRingSound(newValue, chirality: .left) } } .onChange(of: viewModel.rightHitCount, initial: false ) { oldNumber, newNumber in diff --git a/APPRO/APPRO/Views/Stretchings/Hand/HandRollingStretchingViewModel+UpdateTransform.swift b/APPRO/APPRO/Views/Stretchings/Hand/HandRollingStretchingViewModel+UpdateTransform.swift index 9961189..cb3512d 100644 --- a/APPRO/APPRO/Views/Stretchings/Hand/HandRollingStretchingViewModel+UpdateTransform.swift +++ b/APPRO/APPRO/Views/Stretchings/Hand/HandRollingStretchingViewModel+UpdateTransform.swift @@ -123,13 +123,15 @@ extension HandRollingStretchingViewModel { return previous + (current - previous) * factor } - func playRotationChangeRingSound(_ newValue: Int) async { + func playRotationChangeRingSound(_ newValue: Int, chirality : Chirality) async { + + let guideRing = chirality == .left ? leftGuideRing : rightGuideRing if newValue >= 3 { - try? await playSpatialAudio(rightGuideRing, audioInfo: AudioFindHelper.handRotationThreeTimes) + try? await playSpatialAudio(guideRing, audioInfo: AudioFindHelper.handRotationThreeTimes) } else if newValue == 2 { - try? await playSpatialAudio(rightGuideRing, audioInfo: AudioFindHelper.handRotationTwice) + try? await playSpatialAudio(guideRing, audioInfo: AudioFindHelper.handRotationTwice) } else if newValue == 1 { - try? await playSpatialAudio(rightGuideRing, audioInfo: AudioFindHelper.handRotationOnce) + try? await playSpatialAudio(guideRing, audioInfo: AudioFindHelper.handRotationOnce) } } }