Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Audio Metering levels with AVPlayer

Is there a way to have the audio metering levels from the AVPlayer class?

I know that AVAudioPlayer does that, but it doesn't play streamed http .m3u8 urls , like AVPlayer does.

like image 983
neowinston Avatar asked Feb 28 '12 20:02

neowinston


1 Answers

I do not know, specifically, if they privatized what you're looking for, but I do know the various high-level classes are usually just the tops of the pyramid for the lower level AV items. In any case, I do have good news...

Remember an AVPlayer uses an AVPlayerItem. The AVPlayerItem has assets (and an AVAudioMix). The AVAssets have the properties for modifying audio and video.

Unfortunately, the properties indicate they are "suggestions", not absolutes, but try this:

preferredVolume

If you reference the docs, AVPlayer->AVPlayerItem->AVAsset and voila. It might be what you're after.

Hope it's enough

like image 199
Stephen J Avatar answered Nov 13 '22 09:11

Stephen J