All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.daisy.pipeline.tts.osx.OSXSpeechService Maven / Gradle / Ivy

There is a newer version: 3.1.5
Show newest version
package org.daisy.pipeline.tts.osx;

import java.util.Map;

import org.daisy.pipeline.tts.AbstractTTSService;
import org.daisy.pipeline.tts.TTSEngine;

public class OSXSpeechService extends AbstractTTSService {

	@Override
	public TTSEngine newEngine(Map params) throws Throwable {
		// settings
		String prop = "osxspeech.path";
		String sayPath = System.getProperty(prop);
		if (sayPath == null) {
			sayPath = "/usr/bin/say";
		}
		String priority = params.get("osxspeech.priority");
		int intPriority = 2;
		if (priority != null) {
			try {
				intPriority = Integer.valueOf(priority);
			} catch (NumberFormatException e) {

			}
		}

		//allocate the engine
		return new OSXSpeechEngine(this, sayPath, intPriority);
	}

	@Override
	public String getName() {
		return "osx-speech";
	}

	@Override
	public String getVersion() {
		return "cli";
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy