Closed IamMrandrew closed 2 years ago
So the recording does not have a time limit? If so this is my proposed implementation: (in AudioViewModel.swift
// update the last captured amplitude
self.audio.lastAmplitude = Double(amplitude[0])
if (self.isRecording){
self.audio.recordedAmplitudes.append(self.audio.lastAmplitude) // store the Amplitude data
}
func recordingToggle(){ // triggered when user click the record button
if (!self.isRecording){ // clear the recorded audio when user starts a new recording
self.resetRecording()
}
self.isRecording.toggle()}
func resetRecording(){
self.audio.recordedAmplitudes = []
}
@JohnYeung-dojjy I think this might work. Let's try😂
Currently on Sound view, amplitude of audio are stored only on
audio.lastAmplitude
Core/Components/Visuals/Amplitudes.swift