cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to get properties of a music file from metadata (Swift 5)

How to get properties of a music file from metadata (Swift 5)

VyacheslavB
Helpful | Level 5
Go to solution

I'd like to get such properties of a music file as its artwork, duration, file size. But I do not find these properties in "entry" in the "result.entries" array.

Screen Shot 2020-08-25 at 09.53.58.png

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

The Dropbox API does not extract and return media information such as artwork and duration for audio files, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though. That being the case, to access this information, you'd need to download the file and extract the desired information from the audio file data.

 

The Dropbox API does return file size information, but you'll need to cast the Metadata as FileMetadata first, like in this example, to access the properties specific to FileMetadata. Then you can access FileMetadata.size.

View solution in original post

1 Reply 1

Greg-DB
Dropbox Staff
Go to solution

The Dropbox API does not extract and return media information such as artwork and duration for audio files, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though. That being the case, to access this information, you'd need to download the file and extract the desired information from the audio file data.

 

The Dropbox API does return file size information, but you'll need to cast the Metadata as FileMetadata first, like in this example, to access the properties specific to FileMetadata. Then you can access FileMetadata.size.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?