6
6
[ ![ Windows Build status] ( https://ci.appveyor.com/api/projects/status/v7vwgphs239i14ya?svg=true )] ( https://ci.appveyor.com/project/decriptor/taglib-sharp )
7
7
8
8
9
- (aka taglib-sharp) is a library for reading and writing
10
- metadata in media files, including video, audio, and photo formats.
9
+ (aka * Taglib-sharp* ) is a .NET platform-independent library (tested on Windows/Linux) for reading and writing
10
+ metadata in media files, including video, audio, and photo formats.
11
+ This is a convenient one-stop-shop to present or tag all your media collection, regardless of which format/container
12
+ these might use. You can read/write the standard or more common tags/properties of a media, or you can also create and
13
+ retrieve your own custom tags.
14
+
15
+ It supports the following formats (by file-extensions):
16
+ * ** Video:** mkv, ogv, avi, wmv, asf, mp4 (m4p, m4v), mpeg (mpg, mpe, mpv, mpg, m2v)
17
+ * ** Audio:** aa, aax, aac, aiff, ape, dsf, flac, m4a, m4b, m4p, mp3, mpc, mpp, ogg, oga, wav, wma, wv, webm
18
+ * ** Images:** bmp, gif, jpeg, pbm, pgm, ppm, pnm, pcx, png, tiff, dng, svg
11
19
12
20
It is API stable, with only API additions (not changes or removals)
13
21
occuring in the 2.0 series.
14
22
15
- * Bugs: < https://bugzilla.gnome.org/page.cgi?id=browse.html&product=taglib-sharp >
16
- * Tarballs: < http://banshee.fm/download/ >
17
- * IRC: Several TagLib# developers are often in #banshee on irc.gnome.org
18
- * Git: < https://github.com/mono/taglib-sharp > or < git://github.com/mono/taglib-sharp.git >
19
23
20
- TagLib# is free/open source software, released under the LGPL.
21
- We welcome contributions! Please try to match our coding style,
22
- and include unit tests with any patches. Patches can be submitted
23
- by filing a bug and attaching the diff to it.
24
+ ## Examples
25
+
26
+ ### Read/write metadata from a video
27
+ ``` C#
28
+ var tfile = TagLib .File .Create (@" C:\My video.avi" );
29
+ string title = tfile .Tag .Title ;
30
+ TimeSpan duration = tfile .Properties .Duration ;
31
+ Console .WriteLine (" Title: {0}, duration: {1}" , title , duration );
32
+
33
+ // change title in the file
34
+ tfile .Tag .Title = " my new title" ;
35
+ tfile .Save ();
36
+ ```
37
+
38
+ ### Read/write metadata from a Audio file
39
+ ``` C#
40
+ var tfile = TagLib .File .Create (@" C:\My audio.mp3" );
41
+ string title = tfile .Tag .Title ;
42
+ TimeSpan duration = tfile .Properties .Duration ;
43
+ Console .WriteLine (" Title: {0}, duration: {1}" , title , duration );
44
+
45
+ // change title in the file
46
+ tfile .Tag .Title = " my new title" ;
47
+ tfile .Save ();
48
+ ```
49
+
50
+ ### Read/write metadata from an Image
51
+ ``` C#
52
+ var tfile = TagLib .File .Create (@" C:\My picture.jpg" );
53
+ string title = tfile .Tag .Title ;
54
+ var tag = tfile .Tag as TagLib .Image .CombinedImageTag ;
55
+ DateTime ? snapshot = tag .DateTime ;
56
+ Console .WriteLine (" Title: {0}, snapshot taken on {1}" , title , snapshot );
57
+
58
+ // change title in the file
59
+ tfile .Tag .Title = " my new title" ;
60
+ tfile .Save ();
61
+ ```
62
+
63
+ ### Read/write custom tags from a specific format
64
+ ``` C#
65
+ var tfile = TagLib .File .Create (@" C:\My song.flac" );
66
+ var custom = (TagLib .Ogg .XiphComment ) tfile .GetTag (TagLib .TagTypes .Xiph );
67
+
68
+ // Read
69
+ string [] myfields = custom .GetField (" MY_TAG" );
70
+ Console .WriteLine (" First MY_TAG entry: {0}" , myfields [0 ]);
71
+
72
+ // Write
73
+ custom .SetField (" MY_TAG" , new string [] { " value1" , " value2" });
74
+ custom .RemoveField (" OTHER_FIELD" );
75
+ rgFile .Save ();
76
+ ```
77
+
78
+
79
+ ## Website
80
+ TagLib# is available on GitHub: < https://github.com/mono/taglib-sharp >
81
+ * ** Bugs:** Create an [ issue] ( https://github.com/mono/taglib-sharp/issues )
82
+ * ** Chat:** Join us at [ Gitter] ( https://gitter.im/mono/taglib-sharp )
83
+ * ** Git:** Get the source at < git://github.com/mono/taglib-sharp.git >
84
+
24
85
25
86
## Building and Running
26
87
27
- ### To Build From Git:
88
+ ### Command Line (Linux)
89
+
90
+ #### To Build From Git:
28
91
29
92
``` sh
30
93
git clone https://github.com/mono/taglib-sharp.git
31
94
cd taglib-sharp
32
95
./autogen.sh && make
33
96
```
34
97
35
- ### To Build From Tarball:
98
+ #### To Build From Tarball:
36
99
37
100
```
38
101
./configure && make
39
102
```
40
103
41
- ### To Test:
104
+ #### To Test:
42
105
43
106
```
44
107
make test
45
108
```
46
109
47
- You can also build from MonoDevelop or Visual Studio using taglib-sharp.sln
110
+ ### Mono Develop (Linux)
48
111
49
- ### To Test/Run from Visual Studio (Windows):
112
+ You can build from MonoDevelop using taglib-sharp.sln
50
113
51
- Running regression by using Nunit 3 Test Adapter:
114
+ ### Visual Studio (Windows):
115
+
116
+ You can open it in Visual Studio by using taglib-sharp.sln
117
+
118
+ #### Running regression by using Nunit 3 Test Adapter:
52
119
53
120
1 . Ensure NuGet packages have been restored
54
121
1 . See: < https://docs.microsoft.com/en-us/nuget/consume-packages/package-restore >
@@ -61,9 +128,27 @@ Running regression by using Nunit 3 Test Adapter:
61
128
1 . Double click on a test. Set some breakpoints in the test in the editor panel.
62
129
2 . right-click on the same test, select "Debug Selected tests".
63
130
64
- To test some scenarios and take advantage of the debugger:
131
+ #### To test some scenarios and take advantage of the debugger:
65
132
66
133
1 . Make the "debug" project the Startup project
67
134
(Right-click on the project, select: "Set as StartUp Project")
68
135
2 . Just modify the "Program.cs"
69
136
3 . Set some breakpoints and hit the "Start" button
137
+
138
+
139
+
140
+ ## They also use TagLib#
141
+ Non exhaustive list of projects that use TagLib#:
142
+ * [ Lidarr] ( https://lidarr.audio/ )
143
+ * [ MediaPortal 2] ( https://www.team-mediaportal.com/wiki/display/MediaPortal2/MediaPortal+2 )
144
+ * [ F-Spot] ( https://en.wikipedia.org/wiki/F-Spot )
145
+
146
+ And you, what do you use TagLib# for ? Reply [ here] ( https://github.com/mono/taglib-sharp/issues/120 )
147
+
148
+ ## Contributions
149
+
150
+ TagLib# is free/open source software, released under the LGPL.
151
+ We welcome contributions! Please try to match our coding style,
152
+ and include unit tests with any patches. Patches can be submitted
153
+ by issuing a Pull Request (Git).
154
+
0 commit comments