Tamam, geç ve çok şık olmayabilir ama bu bir mp3 dosyasının süresi için benim çözümümdü. MusicProperties Sınıfını kullandım. Bu sınıfla, dosyadaki herhangi bir müzik etiketi bilgisi için erişim elde edersiniz. Dize
Dim salida As String = ""
Dim miTask = Task.Run(Async Function() As Task(Of String)
Dim musicFile As StorageFile = Await StorageFile.GetFileFromPathAsync(elfichero)
Dim FileProperties As StorageItemContentProperties = musicFile.Properties
Dim musicFileProperties As MusicProperties = Await FileProperties.GetMusicPropertiesAsync()
Dim tiempo = musicFileProperties.Duration
Dim horas As String
If tiempo.Hours < 10 Then
horas = "0" & tiempo.Hours.ToString
Else
horas = tiempo.Hours.ToString
End If
Dim minutos As String
If tiempo.Minutes < 10 Then
minutos = "0" & tiempo.Minutes.ToString
Else
minutos = tiempo.Minutes.ToString
End If
Dim segundos As String
If tiempo.Seconds < 10 Then
segundos = "0" & tiempo.Seconds.ToString
Else
segundos = tiempo.Seconds.ToString
End If
Dim autor = musicFileProperties.Artist
Dim titulo = musicFileProperties.Title
Dim presalida As String = "[" & horas & ":" & minutos & ":" & segundos & "];[" & titulo & "];[" & autor & "] " & elfichero
Return presalida
End Function)
miTask.Wait()
salida = miTask.Result
Return salida
End Function gibi (elfichero As String)
Public Function infoMP3 daha sonra Windows 10 dosyalara erişim elde etmek için, dosyalar ve/veya klasörler için izin kurtarmalıyız. Bunu seçtiğinizde yapın.
... Dim listToken = Windows.Storage.AccessCache.StorageApplicationPermissions.FutureAccessList.Add (rutas) ... rutas bir SotorageFolder amacı
.