Skip to content

Commit a9fe7af

Browse files
committed
0.2: Makefile
1 parent db24fec commit a9fe7af

7 files changed

Lines changed: 97 additions & 37 deletions

File tree

File renamed without changes.

Makefile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
CC ?= gcc
2+
CFLAGS ?= -Wall -O2
3+
LDFLAGS ?= -Wall -s
4+
AR = ar
5+
TARGET = slac
6+
SRCL = src/libslac.c
7+
SRCT = src/main.c
8+
OBJL = $(SRCL:%.c=%.o)
9+
OBJT = $(SRCT:%.c=%.o)
10+
SOVER = 0
11+
12+
ifeq ($(SHARED), Y)
13+
TLIB = lib$(TARGET).so.$(SOVER)
14+
else
15+
TLIB = lib$(TARGET).a
16+
endif
17+
18+
all: $(TARGET)
19+
20+
$(TARGET): $(OBJT) $(TLIB)
21+
$(CC) $(LDFLAGS) $^ -o $@
22+
23+
lib$(TARGET).a: $(OBJL)
24+
$(AR) rcs $@ $^
25+
26+
lib$(TARGET).so.$(SOVER): $(OBJL)
27+
$(CC) $(LDFLAGS) -shared -Wl,-soname,$@ $^ -o $@
28+
29+
%.o: %.c
30+
$(CC) $(CFLAGS) -c $< -o $@
31+
32+
clean:
33+
rm -rf $(TARGET) $(TLIB) $(OBJT) $(OBJL)

README renamed to README.md

Lines changed: 64 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,28 @@
1-
////////////////////////////////////////////////////////////////////////////
2-
// ****** SLAC ****** //
3-
// Simple Lossless Audio Compressor //
4-
// Copyright (c) 2019 - 2022 David Bryant //
5-
// All Rights Reserved. //
6-
// Distributed under the BSD Software License (see license.txt) //
7-
////////////////////////////////////////////////////////////////////////////
8-
9-
Update: Since I developed and named this codec I have been made aware of a
10-
proprietary audio compression algorithm from Texas Instruments for
11-
its CC85xx line of chips (and perhaps others) also called SLAC
12-
(Slightly Lossy Audio Codec). There is no relation between the two
13-
codecs (mine is completely original and neither lossy nor
14-
proprietary). I apologize for any confusion.
15-
1+
`ORG.SLM:`
2+
![GitHub release (latest by date)](https://img.shields.io/github/v/release/Sound-Linux-More/slac)
3+
![GitHub Release Date](https://img.shields.io/github/release-date/Sound-Linux-More/slac)
4+
![GitHub repo size](https://img.shields.io/github/repo-size/Sound-Linux-More/slac)
5+
![GitHub all releases](https://img.shields.io/github/downloads/Sound-Linux-More/slac/total)
6+
![GitHub](https://img.shields.io/github/license/Sound-Linux-More/slac)
7+
8+
# SLAC
9+
10+
| ****** SLAC ****** |
11+
|:---:|
12+
| Simple Lossless Audio Compressor |
13+
| Copyright (c) 2019 - 2022 David Bryant. |
14+
| All Rights Reserved. |
15+
| Distributed under the BSD Software License (see license.txt) |
16+
17+
## Update
18+
Since I developed and named this codec I have been made aware of a
19+
proprietary audio compression algorithm from Texas Instruments for
20+
its CC85xx line of chips (and perhaps others) also called SLAC
21+
(Slightly Lossy Audio Codec). There is no relation between the two
22+
codecs (mine is completely original and neither lossy nor
23+
proprietary). I apologize for any confusion.
24+
25+
## Intro
1626
A very simple lossless audio compressor. Designed to achieve about the same
1727
compression as flac -0 or shorten with the absolute minimum amount of
1828
complexity (in fact, the entire library for both encoding and decoding is a
@@ -34,29 +44,46 @@ no error detection, and no seeking capability. The format COULD be used
3444
inside of another container format like Matroska, but I'm not sure that
3545
would have any value.
3646

47+
## Build
3748
To build the demo app:
38-
39-
$ gcc -O2 *.c -o slac
40-
41-
The "help" display from the demo app:
42-
43-
Usage: SLAC [-options] infile.wav outfile.slac
44-
SLAC -d [-options] infile.slac outfile.wav
45-
46-
Pipes: specify '-' for filename, but not WAV output
47-
48-
Options: -d = decode operation (default = encode))
49-
-bn = override block samples (default = 1024)
50-
-h = display this help message
51-
-j0 = encode stereo files as L/R
52-
-j1 = encode stereo files as M/S (default)
53-
-j2 = encode stereo files using best (slow)
54-
-q = quiet mode (display errors only)
55-
-r = raw output (no WAV header written)
56-
-v = verbose (display lots of info)
57-
-y = overwrite outfile if it exists
58-
59-
49+
```sh
50+
$ make
51+
```
52+
or
53+
```sh
54+
$ make SHARED=Y
55+
```
56+
or
57+
```sh
58+
$ gcc -Wall -O2 src/*.c -o slac
59+
```
60+
61+
## Use
62+
63+
### Usage
64+
```sh
65+
slac [-options] infile.wav outfile.slac
66+
slac -d [-options] infile.slac outfile.wav
67+
```
68+
69+
### Pipes
70+
Specify `-` for filename, but not WAV output
71+
72+
### Options
73+
```sh
74+
-d = decode operation (default = encode))
75+
-bn = override block samples (default = 1024)
76+
-h = display this help message
77+
-j0 = encode stereo files as L/R
78+
-j1 = encode stereo files as M/S (default)
79+
-j2 = encode stereo files using best (slow)
80+
-q = quiet mode (display errors only)
81+
-r = raw output (no WAV header written)
82+
-v = verbose (display lots of info)
83+
-y = overwrite outfile if it exists
84+
```
85+
86+
## Algorithm
6087
The compression algorithm uses only standard techniques:
6188
6289
1. The audio data samples are divided into blocks. By default these are 1024
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)