u/Due-Following-116

I'm working on a little soundboard app for fun. Using AVFoundation, how can I ensure audio is at max loudness without there being a risk of blowing out the speakers? The sound clips have varying loudness.

I'm just doing a little side project.

When importing different audio clips, they have varying volume levels, which makes sense.

What I'd like to know is how can I determine the max (safe) loudness I can play these clips at, and also clamp everything down so they can't play louder than "max?" and blow out the speakers.

I know in AVFoundation, the volume range value is 0.0-1.0, but with the clips having varying starting loudness, I need to bring them up to max and make sure they can't go passed it.

reddit.com
u/Due-Following-116 — 8 days ago