-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathexample.lua
More file actions
27 lines (23 loc) · 725 Bytes
/
example.lua
File metadata and controls
27 lines (23 loc) · 725 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package.cpath = package.cpath .. ";./lib/?.so"
local taglib = require "taglib"
--[[
This file shows what TagLib functions are supported by lua-taglib
and how to use them.
]]--
success = taglib.file('music.mp3')
if success then
-- tags
tags = taglib.tag()
print("Artist: " .. tags.artist)
print("Album: " .. tags.album)
print("Title: " .. tags.title)
print("Genre: " .. tags.genre)
print("Track: " .. tags.track)
print("Year: " .. tags.year)
print("Comment: " .. tags.comment)
-- audio values
print("Length: " .. taglib.length())
print("Bitrate: " .. taglib.bitrate())
print("Sample Rate: " .. taglib.sampleRate())
print("Channels: " .. taglib.channels())
end