Skip to content

Commit e2d5ba3

Browse files
committed
Write test
1 parent 9dffb28 commit e2d5ba3

File tree

3 files changed

+29
-14
lines changed

3 files changed

+29
-14
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
![pyaudioprocessing](https://user-images.githubusercontent.com/16875926/63388515-8e66fe00-c35d-11e9-98f5-a7ad0478a353.png)
44

55
A Python based library for processing audio data into features and building Machine Learning models.
6-
This was written using `Python 3.7.6`, and should work with python 3.6+.
6+
This was written using `Python 3.7.6`, and has been tested to work with Python >= 3.6, <4.
77

88

99
## Getting Started
@@ -24,12 +24,17 @@ git clone git@github.com:jsingh811/pyAudioProcessing.git
2424
cd pyAudioProcessing
2525
pip install -e .
2626
```
27-
and get the requirements by running
27+
You can also get the requirements by running
2828

2929
```
3030
pip install -r requirements/requirements.txt
3131
```
3232

33+
If you are on Python 3.9 and experience any issues with the code samples regarding numpy, please run
34+
```
35+
pip install -U numpy
36+
```
37+
3338
## Choices
3439

3540
### Feature options

tests/test_classification.py

Lines changed: 0 additions & 12 deletions
This file was deleted.

tests/test_feature_extraction.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
"""
4+
Created on Fri Apr 30 17:37:32 2021
5+
6+
@author: jsingh
7+
"""
8+
import pytest
9+
from pyAudioProcessing.extract_features import get_features
10+
11+
def test_get_features():
12+
"""
13+
Test get_features function
14+
"""
15+
features = get_features("data_samples/testing", ["gfcc", "mfcc"])
16+
assert "musc" in features
17+
assert "speech" in features
18+
assert "data_samples/testing/speech/sleep.wav" in features["speech"]
19+
assert "features" in features["speech"]["data_samples/testing/speech/sleep.wav"]
20+
assert "feature_names" in features["speech"]["data_samples/testing/speech/sleep.wav"]
21+
assert "mfcc_1_mean" in features["speech"]["data_samples/testing/speech/sleep.wav"]["feature_names"]
22+
assert "gfcc_1_mean" in features["speech"]["data_samples/testing/speech/sleep.wav"]["feature_names"]

0 commit comments

Comments
 (0)