Kodeco Forums

Beginning Audio with AVFoundation Part 1: Recording & Playback

In this video you'll learn the essentials of recording and playback of audio using AVFoundation.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/3879-beginning-audio-with-avfoundation/lessons/2

This is extremely high level and doesn’t explain much of the code that appears very quickly. Forgive my ignorance here but I don’t really feel I have understood much. I don’t want to just copy paste the code and I’m sure it will work but then i’m not really learning. Am I missing some fundamental part here or a previous series leading up to this one that is a prerequisite? I am really trying to understand how to use AVFoundation, but I’m not really grasping this. Any additional input is welcome.

I Disagree with @jaymutzafi
Excellent tutorial straight to the point.

The thing is AVFoundation is a bit low level API, and as such the API itself is less neat to use.
The API is not built for swift. it uses constants instead of enums etc.

Thanks for the tutorial, looking forward to the next ones on the series and on the video series.

Hi Michael,

Thank you, enjoyed the first part of the series, understanding was good until the last part with handling of the notifications, I get the general idea and what the functions do, but left feeling I have no idea how you came up with the necessary lines of code to do it. I stuck with it and typed in the whole lot pausing the video to do that, expect once I have repeated this part a couple more times and had a nose at the API docs my confidence will grow.

Will also try running the code and pulling the headphones with a suitable breakpoint to try and get more of this to stick.

Paul

Thanks for the tutorial!
I want to ask you, will you show how to show/draw equaliser while we record or play an audio? And is there in RayWenderlich any tutorials for KVO? If no, can you please provide one, because you’ve used it in your code.

For me, way too much code that isn’t explained. How can I implement this myself when there is so much boiler code that is left unexplained.

Very frustrating.

thanks for the tutorials but
doesn’t explain much of the code because we copy the code and paste it
we need more explanation

Hi Lesson 2 plays till 6:17 and then keeps spinning, can this be fixed asap please.

  • Thanks

My XCode version complains that Swift example code version if 2 and too low for my
XCode to have any translation options. XCode recommends I install an older XCode version and
perform a step translation to a higher version that my XCode version can translate further…

XCode 9 says: “The target “PenguinPet” contains source code developed with Swift 2.x. Xcode 9 does not support building or migrating Swift 2.x targets. Use Xcode 8.x to migrate the code to Swift 3.”

So these tutorials may be victim of Apple evolving APIs quicker than the tutorial editors can keep up.

@skyrocketsw Can you please help with this when you get a chance? Thank you - much appreciated! :]