Skip to content

Commit 2009a0b

Browse files
committed
Update documentation for lrc files
1 parent 7aff2a3 commit 2009a0b

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,18 @@ let content2 = try coder.encode(subtitles: subtitles)
8585

8686
Format is documented [here](https://github.com/Podcastindex-org/podcast-namespace/blob/main/transcripts/transcripts.md#json)
8787

88+
### Lyrics file format
89+
90+
Format is documented [here](https://en.wikipedia.org/wiki/LRC_(file_format))
91+
92+
The format defines the sub-second timing as 'hundredths of a second', however some online sample files use milliseconds
93+
instead. This encoder supports both for decoding, and the encoder supports both formats when writing.
94+
95+
```
96+
[00:12.41]Is it that sweet? I guess so
97+
[00:12.419]Is it that sweet? I guess so
98+
```
99+
88100
### CSV coding/encoding
89101

90102
There appears to be no formal CSV specification for subtitles, so this coder tries to make a generic "enough" encoder/decoder to make it easier for an app to export into a spreadsheet or google docs.

SwiftSubtitles.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "SwiftSubtitles"
3-
s.version = "1.7.0"
3+
s.version = "1.8.0"
44
s.summary = "A Swift package for reading/writing some common subtitle formats."
55
s.description = <<-DESC
66
A Swift package for reading/writing subtitle formats (srt, sbv, sub, vtt, csv).

Tests/SwiftSubtitlesTests/LRCTests.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,7 @@ final class LRCTests: XCTestCase {
107107
[01:19.485]
108108
"""
109109

110-
let subs = try Subtitles.Coder.LRC()
111-
.decode(str)
112-
113-
Swift.print(subs)
110+
let subs = try Subtitles.Coder.LRC().decode(str)
114111

115112
XCTAssertEqual(34, subs.cues.count)
116113
XCTAssertEqual(Subtitles.Time(hour: 0, minute: 1, second: 13, millisecond: 699), subs.cues[31].startTime)

0 commit comments

Comments
 (0)