1

I am trying to create a recording app that has the ability to stop and start a audio recording.

My idea to achieve this is to have AudioKit record and save a new file(.aac) every time the stop button is clicked. Then when it goes to play the full recording back it would essentially concatenate all the different aac’s together.(My understanding is that I can't continue recording to the end of a file once it's saved) Example:

Records three different recordings, in directory folder is [1.acc, 2.acc, 3.acc]. When played the user would think it’s one file.

To achieve this do I use a single AKPlayer or multiple? I would need a single playback slider and also a playback time label, both these would have to correlate to the ‘single concatenation’ file of [1.acc, 2.acc, 3.acc].

This is the first time I have used AudioKit, I really appreciate any advice or solutions to this. Thanks!

a.wip
  • 69
  • 12
  • You have a goo idea how to do this, what is not working? – Lu_ May 31 '19 at 05:14
  • I'm wanting to know if I can use a single AVPlayer or need multiple? What actual class I need to use in AudioKit... – a.wip May 31 '19 at 05:17
  • read about `AVAssetExportSession` it is used to make operations on files so you will be able to merge two files into one and then you can play it with one player. Also here are some examples https://stackoverflow.com/questions/30479403/concatenate-two-audio-files-in-swift-and-play-them – Lu_ May 31 '19 at 05:20
  • I am trying to accomplish this in AudioKit not in AVFoundation as I think I am limited to having to export a file version instead of playing them on the fly. – a.wip May 31 '19 at 06:38
  • AudioKit cannot do everything alone. You can always create queue with couple of files and single AKPlayer is enough, but you will have to work some trouble with sliders then – Lu_ May 31 '19 at 06:45
  • My issue with the `AVAssetExportSession` is that I don't want to save a file. Is there a way to just merge them and then just load it into the audio player with a local variable on either AudioKit or AVPlayer without exporting a new 'combined' file every time? – a.wip May 31 '19 at 06:53
  • if you don't save file you will have to limit recording time because devices RAM will explode this way – Lu_ May 31 '19 at 06:55
  • So I can't play for example 5 different saved files one after another. it will not work unless I save and play a single file? – a.wip May 31 '19 at 06:58
  • you can play 5 different saved files, in my previous comments I did mention making a queue with recordings that will play one after another – Lu_ May 31 '19 at 07:01
  • So I can create a queue but not a queue where I would get the total timestamps and slider bar... – a.wip May 31 '19 at 07:02
  • you would need to calculate time and implement slider – Lu_ May 31 '19 at 07:09

0 Answers0