Recording output audio with Swift

Tags: ios audio swift
Question!

Is it possible to record output audio in an app using Swift? So, for example, say I'm listening to a podcast, and I want to, within a separate app, record a small segment of the podcast's audio. Is there any way to do that?

I've looked around but have only been able to find information on recording microphone recording and such.



Answers
It depends on how you are producing the audio. If the production of the audio is within your control, you can put a tap on the output and record to a file as it plays. The easiest way is with the new AVAudioEngine feature (there are other ways, but AVAudioEngine is basically an easy front end for them).

Of course, if the real problem is to take a copy of a podcast, then obviously all you have to do is download the podcast as opposed to listening to it. Similarly, you could buffer and save streaming audio to a file. There are many apps that do this. But this is not because the device's output is being hijacked; it is, again, because we have control of the sound data itself.

By : matt


I believe you'll have to write a kernel extension to do that

https://developer.apple.com/library/mac/documentation/Darwin/Conceptual/KEXTConcept/KEXTConceptIOKit/iokit_tutorial.html

You'd have to make your own audio driver to record it

It appears as though

That is how softonic made soundflowerbed.

http://features.en.softonic.com/how-to-record-internal-sound-on-a-mac

By : Paul Wand


This video can help you solving your question :)
By: admin