0

I want to get the m4a audio playback time without player implementation.

I found AVAsset implementation but didn't worked for me.

Irfan Gul
  • 1,579
  • 13
  • 23
  • Try to get the duration like this `AVURLAsset* audioAsset = [AVURLAsset URLAssetWithURL:audioFileURL options:nil]; CMTime duration = audioAsset.duration; float audioDurationSeconds = CMTimeGetSeconds(duration);` – Weizhi Oct 20 '14 at 07:54

1 Answers1

1

playbacktime can only be used when using MPMediaPalyback

From AVAsset you can get only the duration of the Asset not the playback time.

below is a refernce link

How to get the duration of an audio file in iOS?

You can access the duration property of the audio file but you cannot get the playback time.

Playback time will only be available when you are using a player. :-)

Community
  • 1
  • 1
Ganesh
  • 1,059
  • 1
  • 10
  • 28