Git Product home page Git Product logo

libsbc's Introduction

Subband Codec (SBC)

The SBC codec is the mandotory codec for Bluetooth audio over A2DP Profile

The technical specification of the codec is covered in Appendix B of Advanced Audio Distribution

mSBC extension is covered by Appendix A of Hands-Free Profile

Overview

The directory layout is as follows :

  • include: Library interface
  • src: Source files
  • tools: Standalone encoder/decoder tools
  • build: Building outputs
  • bin: Compilation output

How to build

The default toolchain used is GCC. Invoke make to build the library.

$ make -j

Compiled library libsbc.a will be found in bin directory.

Cross compilation

The cc, as, ld and ar can be selected with respective Makefile variables CC, AS, LD and AR. The AS and LD selections are optionnal, and fallback to CC selection when not defined.

$ make -j CC=path_to_toolchain/bin/toolchain-prefix-gcc CFLAGS="..."

Compiled library will be found in bin directory.

Enabling assembly

Assembly code is available for armv7-em architecture. Enabling assembly code is done with the ARCH Makefile variable. Following example enable assembly optimization for target CPU ARM Cortex M4 :

$ make -j CC=path_to_arm_toolchain/bin/toolchain-prefix-gcc \
    CFLAGS="-mcpu=cortex-m4 -mthumb" ARCH="arm-v7em"

Tools

Tools can be all compiled, while involking make as follows :

$ make tools

The standalone encoder esbc take a wave file as input and encode it according given parameter. The standalone decoder dsbc do the inverse operation.

Refer to esbc -h or dsbc -h for options.

Note that esbc output bitstream to standard output when output file is omitted. On the other side dsbc read from standard input when input output file are omitted. In such way you can easly test encoding / decoding loop with :

$ ./esbc <in.wav> -b <bitpool> | ./dsbc > <out.wav>

Adding Linux aplay tools, you are able to instant hear the result :

$ ./esbc <in.wav> -b <bitpool> | ./dsbc | aplay

libsbc's People

Contributors

asoulier avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.