Currently I’m allowing user to record their own voice for a duration no longer than 30 seconds. Once they are finished recording their audio, I grab the duration of their audio. I run this quick math (SixtySeconds-TheirAudioDuraion) = TimeNeededToFill. Basically I need to end up with a precise 1-minute track in the end. Some portion of which is actual Audio, the remainder is Silent Audio. Im currently using AVAudioPlayer to do all of my audio recording. Is there a programatic way to accomplish this vs. some brute-force hack where I start cramming silent audio track files together to create a single file?
Simple brilliance needed and would be appreciated.
My Best to all.
I would have a 60 second recording of silence already “recorded”, append that to the users recording, and then trim the total length to 60 seconds.
This SO question avaudiorecorder-avaudioplayer-append-recording-to-file has some references to appending sound files in Siddarth’s answer.
This SO question trim-audio-with-ios has information about trimming sound files.