Skip to content

Commit

Permalink
fix: 오디오 중단 & 재시작 시 , 음성 표시 바가 초기화되지 않는 문제 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
yuncheol-AHN committed Dec 5, 2024
1 parent 7c4c687 commit f027ed6
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,27 @@ final class CreateAudioViewController: UIViewController {
}
}

private func setupBarsDefault() {
let width = 300 / numberOfBars - 5
let barSpacing = 5

for index in 0..<numberOfBars {
upBarLayers[index].frame = CGRect(
x: index * (width + barSpacing),
y: Int(volumeHalfHeight),
width: width,
height: -2
)

downBarLayers[index].frame = CGRect(
x: index * (width + barSpacing),
y: 0,
width: width,
height: 2
)
}
}

// MARK: - bind
private func bind() {
let output = viewModel?.transform(input: input.eraseToAnyPublisher())
Expand Down Expand Up @@ -285,6 +306,7 @@ final class CreateAudioViewController: UIViewController {
}

private func startRecording() {
setupBarsDefault()
try? audioSession.setActive(true)

timeTextLabel.text = "00:00"
Expand Down

0 comments on commit f027ed6

Please sign in to comment.