Freetts Audio output
- From: SuperBee <reda217 hotmail com>
- To: gnome-accessibility-list gnome org
- Subject: Freetts Audio output
- Date: Thu, 1 Mar 2007 15:11:23 -0800 (PST)
Hi,
I am using freetts engine and want to output an audio file, I wrote the code
below; however, nothing seems to be happening when I run it.
Here is my code:
package src;
import com.sun.speech.freetts.Voice;
import com.sun.speech.freetts.VoiceManager;
import java.io.*;
import java.util.*;
import groovy.sql.*;
import com.sun.speech.freetts.audio.*;
import javax.sound.sampled.AudioFileFormat.*;
class Run{
static Type type
/* Lists all voices available
*/
static void listAllVoices() {
println();
println("All voices available:");
VoiceManager voiceManager = VoiceManager.getInstance();
Voice[] voices = voiceManager.getVoices();
for (i in 0..voices.length-1) {
println(" " + voices.getName() + " (" + voices.getDomain() + " domain)");
}
}
static void main(args) {
/* Create all needed objects
*/
type = new Type('test', 'wav')
/* Call method to display available voices
*/
listAllVoices()
/* Print the voice being used
*/
String voiceName = (args.length > 0)? args[0]: "kevin16";
println();
println("Using voice: " + voiceName);
/* The VoiceManager manages all the voices for FreeTTS.
*/
VoiceManager voiceManager = VoiceManager.getInstance();
Voice machineVoice = voiceManager.getVoice(voiceName);
if (machineVoice == null) {
System.err.println(
"Cannot find a voice named "
+ voiceName + ". Please specify a different voice.");
System.exit(1);
}
/* Allocates the resources for the voice.
*/
machineVoice.allocate();
machineVoice.setAudioPlayer(new
MultiFileAudioPlayer('C:/uni/dissertation/Supermarket/src', type));
/* Clean up and leave.
*/
machineVoice.deallocate()
System.exit(0)
}
}
Any help will be very much appreciated.
SB
--
View this message in context: http://www.nabble.com/Freetts-Audio-output-tf3330560.html#a9260791
Sent from the Gnome - Accessibility - General mailing list archive at Nabble.com.
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]