| 1 |
This is Open Source implementation of Audio Processing Technology codec (aptX) |
| 2 |
derived from ffmpeg 4.0 project and licensed under LGPLv2.1+. This codec is |
| 3 |
mainly used in Bluetooth A2DP profile. |
| 4 |
|
| 5 |
It provides dynamic linked shared library libopenaptx.so and simple command line |
| 6 |
utilities openaptxenc and openaptxdec for encoding and decoding operations. |
| 7 |
Documentation for shared library is provided in C header file openaptx.h. |
| 8 |
|
| 9 |
There is support for aptX and aptX HD codec variants. Both variants operates on |
| 10 |
a raw 24 bit signed stereo audio samples. aptX provides fixed compress ratio 6:1 |
| 11 |
and aptX HD fixed compress ratio 4:1. |
| 12 |
|
| 13 |
For building and installing into system simply run: make install. For building |
| 14 |
without installing run: LD_RUN_PATH='$ORIGIN' make. For producing windows builds |
| 15 |
run: make SOFILENAME=openaptx0.dll. |
| 16 |
|
| 17 |
It is suggested to compile library with -O3 optimizations (enabled by default |
| 18 |
when env variable CFLAGS is not set) and -mavx2 switch (not enabled by default, |
| 19 |
needs CPU with AVX2: Intel Haswell or AMD Excavator) as it provides significant |
| 20 |
boost to the performance. |
| 21 |
|
| 22 |
Usage of command line utilities together with sox for resampling or playing: |
| 23 |
|
| 24 |
To convert Wave audio file sample.wav into aptX audio file sample.aptx run: |
| 25 |
|
| 26 |
$ sox sample.wav -t raw -r 44.1k -L -e s -b 24 -c 2 - | openaptxenc > sample.aptx |
| 27 |
|
| 28 |
To convert aptX audio file sample.aptx into Wave audio file sample.wav run: |
| 29 |
|
| 30 |
$ openaptxdec < sample.aptx | sox -t raw -r 44.1k -L -e s -b 24 -c 2 - sample.wav |
| 31 |
|
| 32 |
To convert MP3 audio file sample.mp3 into aptX HD audio file sample.aptxhd run: |
| 33 |
|
| 34 |
$ sox sample.mp3 -t raw -r 44.1k -L -e s -b 24 -c 2 - | openaptxenc --hd > sample.aptxhd |
| 35 |
|
| 36 |
To play aptX HD audio file sample.aptxhd run: |
| 37 |
|
| 38 |
$ openaptxdec --hd < sample.aptxhd | play -t raw -r 44.1k -L -e s -b 24 -c 2 - |