-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial version 0.0.0 of libopenaptx library based on ffmpeg 4.0
Besides dynamic shared library there are also two utilities openaptxenc and openaptxdec for encoding and decoding aptX and aptX HD streams.
- Loading branch information
0 parents
commit 5eb6ce6
Showing
7 changed files
with
2,033 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
MAJOR := 0 | ||
MINOR := 0 | ||
PATCH := 0 | ||
|
||
PREFIX := /usr/local | ||
BINDIR := bin | ||
LIBDIR := lib | ||
INCDIR := include | ||
|
||
LIBNAME := libopenaptx.so | ||
SONAME := $(LIBNAME).$(MAJOR) | ||
FILENAME := $(SONAME).$(MINOR).$(PATCH) | ||
|
||
UTILITIES := openaptxenc openaptxdec | ||
|
||
HEADERS := openaptx.h | ||
|
||
BUILD := $(FILENAME) $(SONAME) $(LIBNAME) $(UTILITIES) | ||
|
||
all: $(BUILD) | ||
|
||
install: $(BUILD) | ||
mkdir -p $(DESTDIR)/$(PREFIX)/$(LIBDIR) | ||
cp -a $(FILENAME) $(SONAME) $(LIBNAME) $(DESTDIR)/$(PREFIX)/$(LIBDIR) | ||
mkdir -p $(DESTDIR)/$(PREFIX)/$(BINDIR) | ||
cp -a $(UTILITIES) $(DESTDIR)/$(PREFIX)/$(BINDIR) | ||
mkdir -p $(DESTDIR)/$(PREFIX)/$(INCDIR) | ||
cp -a $(HEADERS) $(DESTDIR)/$(PREFIX)/$(INCDIR) | ||
|
||
$(FILENAME): openaptx.c $(HEADERS) | ||
$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -I. -shared -fPIC -Wl,-soname,$(SONAME) -o $@ $< | ||
|
||
$(SONAME): $(FILENAME) | ||
ln -sf $< $@ | ||
|
||
$(LIBNAME): $(SONAME) | ||
ln -sf $< $@ | ||
|
||
%: %.c $(LIBNAME) $(HEADERS) | ||
$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -I. -o $@ $< $(LIBNAME) | ||
|
||
clean: | ||
$(RM) $(BUILD) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
This is Open Source implementation of Audio Processing Technology codec (aptX) | ||
derived from ffmpeg 4.0 project and licensed under LGPLv2.1+. This codec is | ||
mainly used in Bluetooth A2DP profile. | ||
|
||
It provides dynamic linked shared library libopenaptx.so and simple command line | ||
utilities openaptxenc and openaptxdec for encoding and decoding operations. | ||
There is support for aptX and aptX HD codec variants. Both variants operates on | ||
a raw 24 bit signed stereo audio samples. aptX provides fixed compress ratio 6:1 | ||
and aptX HD fixed compress ratio 4:1. | ||
|
||
For building and installing into system simply run: make install. For building | ||
without installing run: LD_RUN_PATH='$ORIGIN' make | ||
|
||
Usage of command line utilities together with sox for resampling or playing: | ||
|
||
To convert Wave audio file sample.wav into aptX audio file sample.aptx run: | ||
|
||
$ sox sample.wav -t raw -r 44.1k -s -3 -c 2 - | openaptxenc > sample.aptx | ||
|
||
To convert aptX audio file sample.aptx into Wave audio file sample.wav run: | ||
|
||
$ openaptxdec < sample.aptx | sox -t raw -r 44.1k -s -3 -c 2 - sample.wav | ||
|
||
To convert MP3 audio file sample.mp3 into aptX HD audio file sample.aptxhd run: | ||
|
||
$ sox sample.mp3 -t raw -r 44.1k -s -3 -c 2 - | openaptxenc --hd > sample.aptxhd | ||
|
||
To play aptX HD audio file sample.aptxhd run: | ||
|
||
$ openaptxdec --hd < sample.aptxhd | play -t raw -r 44.1k -s -3 -c 2 - |
Oops, something went wrong.