forked from zsiciarz/aquila
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The example code reproduces the problem found in the original Aquila repository's list of issues: zsiciarz#55 Build the workshop target and run it with a path to the tone.wav file passed as an argument
- Loading branch information
Showing
6 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
################################################################################ | ||
# | ||
# AM modulation example. | ||
# | ||
################################################################################ | ||
|
||
aquila_example(workshop) | ||
aquila_example(generate_test_wavfile) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include "aquila/source/WaveFile.h" | ||
#include "aquila/source/generator/SineGenerator.h" | ||
|
||
#include <iostream> | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
if (argc < 2) | ||
{ | ||
std::cout << "Usage: generate_test_wavfile <FILENAME>" << std::endl; | ||
return 1; | ||
} | ||
|
||
const auto sampleRate = 44100; | ||
Aquila::SineGenerator sineGenerator(sampleRate); | ||
sineGenerator.setFrequency(220).setAmplitude(255).generate(sampleRate*12-5); | ||
|
||
Aquila::WaveFile::save(sineGenerator, argv[1]); | ||
} |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#include "aquila/source/WaveFile.h" | ||
#include "aquila/transform/Mfcc.h" | ||
|
||
#include <iostream> | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
if (argc < 2) | ||
{ | ||
std::cout << "Usage: read_wavs <FILENAME>" << std::endl; | ||
return 1; | ||
} | ||
|
||
Aquila::WaveFile wav(argv[1]); | ||
|
||
const auto numSamples = wav.getSamplesCount(); | ||
|
||
Aquila::Mfcc mfcc(numSamples); | ||
const auto mfccValues = mfcc.calculate(wav); | ||
|
||
for (const auto val : mfccValues) | ||
{ | ||
std::cout << val << " "; | ||
} | ||
|
||
std::cout << std::endl; | ||
} |