Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Audio visualisation using AVPlayer

I am trying to do an audio visualisation for a stream. The audio has to play in the background and currently I am playing it with an AVPlayer but I cannot get the metering from it. How can I get the metering and make the visualisation? Any suggestions?

like image 683
frkncngz Avatar asked Sep 18 '13 12:09

frkncngz


People also ask

What is an avplayer object?

An AVPlayer is a controller object used to manage the playback and timing of a media asset. You can use an AVPlayer to play local and remote file-based media, such as QuickTime movies and MP3 audio files, as well as audiovisual media served using HTTP Live Streaming.

How to play videos using avplayer in Xamarin iOS?

The steps given below are required to be followed in order to play videos using AVPlayer in Xamarin iOS. Step 1 Go To Xamarin Studio. Click New Solution—> select iOS—>select App--> choose Single View App. Afterwards, click Next. Step 2 In this step, configure your app. Give the App Name (Ex: sample) and Organization Identifier.

How do I use avasset with an avplayer?

You use an AVPlayer to play media assets, which AVFoundation models using the AVAsset class. AVAsset only models the static aspects of the media, such as its duration or creation date, and on its own, is unsuitable for playback with an AVPlayer. To play an asset, you need to create an instance of its dynamic counterpart found in AVPlayerItem.

How to synchronize AVKit and avplayerlayer with the player’s timing?

Alongside the visual content presented with AVKit or AVPlayerLayer, you can also present animated content synchronized with the player’s timing using AVSynchronizedLayer. Use the synchronized layer to confer the current player timing onto its layer subtree.


1 Answers

  • Here you have an example with waveforms: A cocoa audio player component which displays the waveform of the audio file

  • Here you have a LED bar gauge and another example how can be used: ATTabandHoldAudioRecord

  • Apple, also have SpeakHere example - the code includes a LevelView .. but this Apple sample code is anything but simple to implement ...

like image 98
TonyMkenu Avatar answered Sep 20 '22 21:09

TonyMkenu