https://github.com/timusus/ktaglib
Taglib Kotlin Library
https://github.com/timusus/ktaglib
cpp kotlin storage-access-framework taglib
Last synced: 9 months ago
JSON representation
Taglib Kotlin Library
- Host: GitHub
- URL: https://github.com/timusus/ktaglib
- Owner: timusus
- License: apache-2.0
- Created: 2020-05-11T10:46:39.000Z (almost 6 years ago)
- Default Branch: release
- Last Pushed: 2023-11-27T11:12:17.000Z (over 2 years ago)
- Last Synced: 2023-11-27T12:28:04.979Z (over 2 years ago)
- Topics: cpp, kotlin, storage-access-framework, taglib
- Language: C++
- Homepage:
- Size: 238 KB
- Stars: 9
- Watchers: 4
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# KTagLib
Kotlin bindings for [TagLib](https://github.com/taglib/taglib)
Gradle:
Step 1. Add the Jitpack repository to the root build.gradle
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Step 2. Add the dependency
dependencies {
implementation("com.github.timusus:KTagLib:release-SNAPSHOT") // or kTagLib:1.5.1
}
See the sample app for an example of reading tags, using the Storage Access Framework.
## Usage ##
#### Read Tags ####
Read the tags from a file descriptor:
`KTagLib().getMetadata(fileDescriptor: Int)`
This returns a Metadata object, containing the tags and audio properties of the audio file located at `fileDescriptor`, or null if none are found
#### Retrieve Artwork ####
`KTagLib().getArtwork(fileDescriptor: Int)`
Returns a `ByteArray` (or null) representing the image data of the largest image found.
#### Write Tags ####
fun writeMetadata(
fileDescriptor: Int,
properties : HashMap>
): Boolean
Attempts to write the tags supplied via the map to the file located at `fileDescriptor`. Existing tags with the same key are replaced.
Returns true if the tags are successfully updated.