File: split-cue.md

package info (click to toggle)
liquidsoap 2.1.3-2
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 12,924 kB
  • sloc: ml: 73,577; javascript: 24,836; sh: 3,440; makefile: 764; xml: 114; ansic: 96; lisp: 62; python: 35; perl: 8; ruby: 8
file content (35 lines) | stat: -rw-r--r-- 1,056 bytes parent folder | download
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
28
29
30
31
32
33
34
35
Split and re-encode a CUE sheet.
================================
CUE sheets are sometimes distributed along with a single audio file containing a whole CD.
Liquidsoap can parse CUE sheets as playlists and use them in your request-based sources.

Here's for instance an example of a simple code to split a CUE sheet into several mp3 files
with `id3v2` tags:
```liquidsoap
 # Log to stdout
 log.file.set(false)
 log.stdout.set(true)
 log.level.set(4)

 # Initial playlist
 cue = "/path/to/sheet.cue"

 # Create a reloadable playlist with this CUE sheet.
 # Tell liquidsoap to shutdown when we are done.
 x = playlist.reloadable(cue, on_done=shutdown)

 # We will never reload this playlist so we drop the first
 # returned value:
 s = snd(x)

 # Add a cue_cut to cue-in/cue-out according to
 # markers in "sheet.cue"
 s = cue_cut(s)

 # Shove all that to a output.file operator.
 output.file(%mp3(id3v2=true,bitrate=320),
             fallible=true,
             reopen_on_metadata=true,
             "/path/to/$(track) - $(title).mp3",
             s)
```