Skip to main content

This library is a complete port of python_speech_features (https://github.com/jameslyons/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 (http://www.swig.org/) and numpy (http://www.numpy.org/). 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).

Metadata

Release files for c_speech_features 0.4.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for c_speech_features 0.4.8
File Size Uploaded
c_speech_features-0.4.8.zip 155.6 kB Details

Release files / c_speech_features-0.4.8.zip

Download URL c_speech_features-0.4.8.zip
Size 155.6 kB
Tags Source
SHA-256 checksum
How to use checksums
2fa93e487aea08f37472de78e8a9c60f2fd6c97e79c8fb7cb1211dc7e343566e
BLAKE2b-256 checksum
How to use checksums
4f9638254e63cb63865949cadd592865eec9d73fbfea6f0df7708771286fb39e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.4.8 This release

1 release file

0.4.7

1 release file

0.4.6

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page