I can generate sequences of text no problem (RiMarkov), projecting the sequences on screen but i also want to hook up speakers using RiSpeech to transform text to speech. Basing my project around 'The Cocktail Party Effect' & I need it for a quick showing.
Code; Plain & Simple.
import rita.*;
int MAX_LINE_LENGTH = 60;
String data = "http://rednoise.org/rita/data/";
RiText rts[];
RiMarkov markov;
void setup()
{
size(600, 600);
// a little info msg
new RiText(this, "click to (re)generate!", 135, height/2);
RiText.setDefaultAlignment(LEFT);
RiText.setDefaultFont("UbuntuTitling-Bold-48.vlw");
// create a new markov model w' n=3
markov = new RiMarkov(this, 3);
//markov.setPrintIgnoredText(true);
// load 2 files into the model
markov.loadFile(data+"wittgenstein.txt");
markov.loadFile(data+"kafka.txt");
}
void draw()
{
background(150, 204, 0);
}
// generate on mouse click
void mouseClicked()
{
RiText.deleteAll(); // clean-up old data
String[] lines = markov.generateSentences(1);
// lay out the return text starting at x=20 y=50)
rts = RiText.createLines(this, lines, 20, 50, 25);
}
If you can help, would very grateful.
Daniel.
Code; Plain & Simple.
import rita.*;
int MAX_LINE_LENGTH = 60;
String data = "http://rednoise.org/rita/data/";
RiText rts[];
RiMarkov markov;
void setup()
{
size(600, 600);
// a little info msg
new RiText(this, "click to (re)generate!", 135, height/2);
RiText.setDefaultAlignment(LEFT);
RiText.setDefaultFont("UbuntuTitling-Bold-48.vlw");
// create a new markov model w' n=3
markov = new RiMarkov(this, 3);
//markov.setPrintIgnoredText(true);
// load 2 files into the model
markov.loadFile(data+"wittgenstein.txt");
markov.loadFile(data+"kafka.txt");
}
void draw()
{
background(150, 204, 0);
}
// generate on mouse click
void mouseClicked()
{
RiText.deleteAll(); // clean-up old data
String[] lines = markov.generateSentences(1);
// lay out the return text starting at x=20 y=50)
rts = RiText.createLines(this, lines, 20, 50, 25);
}
If you can help, would very grateful.
Daniel.
1