Skip to content

Commit

Permalink
Merge pull request #86 from fusionhuh/master
Browse files Browse the repository at this point in the history
Minor fixes to Usage section in README
  • Loading branch information
sevagh committed Sep 27, 2022
2 parents 34b198b + bb84fed commit 4d94d7e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -88,7 +88,7 @@ Once you're in the container, run the tests and benches:

### Usage

Read the [header](./include/pitch_detection/pitch_detection.h) and [sample wav_analyzer](./wav_analyzer).
Read the [header](./include/pitch_detection.h) and [sample wav_analyzer](./wav_analyzer).

The namespaces are `pitch` and `pitch_alloc`. The functions and classes are templated for `<double>` and `<float>` support.

Expand All @@ -97,16 +97,16 @@ The `pitch` namespace functions perform automatic buffer allocation, while `pitc
```c++
#include <pitch_detection.h>

std::vector<double> audio_buffer(8092);
std::vector<double> audio_buffer(8192);

double pitch_yin = pitch::yin<double>(audio_buffer, 48000);
double pitch_mpm = pitch::mpm<double>(audio_buffer, 48000);
double pitch_pyin = pitch::pyin<double>(audio_buffer, 48000);
double pitch_pmpm = pitch::pmpm<double>(audio_buffer, 48000);
double pitch_swipe = pitch::swipe<double>(audio_buffer, 48000);

pitch_alloc::Mpm<double> ma(8092);
pitch_alloc::Yin<double> ya(8092);
pitch_alloc::Mpm<double> ma(8192);
pitch_alloc::Yin<double> ya(8192);

for (int i = 0; i < 10000; ++i) {
auto pitch_yin = ya.pitch(audio_buffer, 48000);
Expand Down

0 comments on commit 4d94d7e

Please sign in to comment.