Giter VIP home page Giter VIP logo

c_speech_features's Introduction

C Speech Features

This library is a complete port of python_speech_features to C.

Usage

Clone this repository in your C/C++ project:

git clone https://github.com/cwiiis/c_speech_features

and add these files to your build:

c_speech_features.c
kiss_fft130/kiss_fft.c
kiss_fft130/tools/kiss_fftr.c

Alternatively, you can build shared and static libraries to use with your project instead of importing the files directly. Using cmake, from within a check-out:

cmake -DCMAKE_C_FLAGS="-O2" -DCMAKE_INSTALL_PREFIX="/usr/local" -DENABLE_DOUBLE=OFF
make

This will result in libc_speech_features.so and libc_speech_features_static.a being built (or platform equivalents), which you can link in your project. An install target is also provided, allowing system-wide use of the library, but this is not recommended.

Refer to c_speech_features.h for documentation.

Bindings

Python

Building python bindings requires SWIG and numpy. Run:

python setup.py install

This will build and install the statically linked c_speech_features module, which can then be used in any python script. Refer to python/test/test.py to see examples of its use. For the most part, it is a drop-in replacement for python_speech_features.

Differences to python_speech_features

  • c_speech_features only supports one datatype, which is defined at compile-time. Currently, this can be either 32-bit (float), or 64-bit (double). python_speech_features operates in 64-bit by default.
  • The winfunc parameter is an array instead of a function, and is expected to be as wide as necessary depending on context.

Uses

It is not recommended to replace python_speech_features with c_speech_features in a Python context. python_speech_features is safer and will output better error messages when fed with incorrect parameters. c_speech_features is most likely to crash in such situations. On the other hand, this module can be useful to debug issues when using c_speech_features in more appropriate contexts, or if you have very specific needs. c_speech_features is likely to perform faster when compiled with optimisation than python_speech_features. In 64-bit, the gains are minimal, except for particular functions, where as in 32-bit the gains can be substantial (at the cost of precision).

c_speech_features's People

Contributors

cwiiis avatar

Watchers

 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.