Record audio output using Swift

Is it possible to record the output sound in an application using Swift? So, for example, let's say I listen to a podcast, and I want to record a small segment of the podcast sound in a separate application. Is there any way to do this?

I looked around, but was able to find information about recording microphone recordings, etc.

+5
source share
2 answers

It depends on how you create the audio. If the production of sound is under your control, you can place the tap at the output and write to the file as it plays. The easiest way is the new AVAudioEngine feature (there are other ways, but AVAudioEngine is basically an easy interface for them).

Of course, if the real problem is to take a copy of the podcast, then obviously all you have to do is download the podcast and not listen to it. Similarly, you can buffer and save streaming audio to a file. These are many applications. But this is not because the device is displayed on the screen; this is again because we ourselves control the audio data ourselves.

+2
source

I believe you will have to write a kernel extension to do this

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

You will need to make your own sound driver to record it.

It seems that

The way the salty sound sounded.

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

+1
source

Source: https://habr.com/ru/post/1210602/


All Articles