The Synthesis Tool Kit (STK), a CCRMA-created collection of C++ classes for the synthesis and processing of musical instrument sounds, contains a C++ class VoicForm for the synthesis of vowel sounds based on formant filtering of a band-limited impulse train.
The following short C++ program generates a short clip of the vowel /i/:
#include "VoicForm.h"
#include "WvOut.h"
#define OUTPUT_LENGTH_SEC 5
#define NUM_OUTPUT (Stk::sampleRate()*OUTPUT_LENGTH_SEC)
#define VOWEL_FREQ 75.0
#define VOWEL_AMP 1.0
int main(void)
{
WvOut wvo("test_vowel.wav");
VoicForm vf;
vf.noteOn(VOWEL_FREQ, VOWEL_AMP);
vf.speak();
for (int i=0; i<NUM_OUTPUT; i++)
{
wvo.tick(vf.tick());
}
wvo.closeFile();
return 0;
}
The NoteOn() member of VoicForm sets the frequency (in Hz)
(default is
Hz) and amplitude (a non-dimensional, linear value) of the
vowel. Next VoicForm::speak() activates vowel sound output with
subsequent calls to VoicForm::tick() (tick() is the name of
the method given to most STK classes that accept or produce audio samples).
Finally, the for loop produces the vowel output samples and stores them
in an STK WAV file object, wvo.
The WAV file produced by this program may be heard at
http://www-ccrma.stanford.edu/~rjc/audio/speech/vowel/stk_vowel/rjc_stk_vowel_ex.wav.