> A need for a open source and freely-distributable speech synthesizer
remains.

We managed to plug smartBody with the openMary TTS engine.
(http://mary.dfki.de/). Do do so, we did some slight modifications to
remote_speech.cpp, sbm_audio.cpp (cf. diff files)

Communication is performed thanks to message passing through an active MQ
broker according to the following :

 _____________          ____________          __________________
__________________
|             |------->|            |------->|
|===================>|                  |
|  SmartBody  |messages|  ActiveMQ  |messages|  OpenMaryClient  |  info+data
sockets |  OpenMaryServer  |
|_____________|<-------|____________|<-------|__________________|<==========
=========|__________________|

OpenMaryClient registers to the running activeMq instance (elvish topic ?),
receives and process remote_speech messages (ssml format) and saves 22KHz
wav files to ${SMARTBODY_HOME}/trunk/lib/dimr/tmpaudio

You will find enclosed the OpenMaryClient java files (to be copied in
${SMARTBODY_HOME}/trunk/lib/activemq/apache-activemq-5.1.0/example/src) as
well as the modified build.xml ant Makefile (to be copied in
${SMARTBODY_HOME}/trunk/lib/activemq/apache-activemq-5.1.0/example) required
to build the OpenMaryClient. 

OpenMary client has to be launched from
${SMARTBODY_HOME}/trunk/lib/activemq/apache-activemq-5.1.0/example.
Naturally, a running OpenMary server has to be listening.

It seems that openMary is quite restrictive regarding the ssml speech
request to be synthesized. As a consequence, the remote_speech request had
to be modified in remote_speech.cpp.

I tried without success to get SDL_MIXER play the wav speech files at 22KHz,
theoretically, calling
Mix_OpenAudio_func( audio_rate, audio_format, audio_channels, audio_buffers
) with audio_rate = 22050 should do the trick, but it didn't.

Hope you will find this of interest. If you have an idea about how to play
correctly 22KHz .wav file with MIX_SDL, that would be nice.

Alexis.


> *******************************
> Alexis Heloir
> Deutsches Forschungszentrum für Künstliche Intelligenz DFKI GmbH
>
> Embodied Agents Research Group (EMBOTS) http://embots.dfki.de/
>
> Campus D3.2
> Stuhlsatzenhausweg 3
> 66123 Saarbrücken
> Tel. 0681 302 5387
> mail: [EMAIL PROTECTED]
> http://www.dfki.de
>
> ******************************




-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Andrew n marshall
Sent: Dienstag, 1. Juli 2008 02:10
To: [email protected]
Subject: [SmartBody-dev] RemoteSpeech Examples


Based on the interest in using speech with SmartBody, and interest in 
implementing the RemoteSpeech protocol, we have decided to contribute a 
couple of our implementation to the open source project.

However, these are not great examples (but we hope to change that).  
They were originally short term experiments that have not yet made it 
into our production level systems.

Additionally, they are each tied to a commercial engine not included in 
the repository.  Unless you have a license to at least one of these 
speech synthesizer SDKs, you won't be able to build either.  A need for 
a open source and freely-distributable speech synthesizer remains.

Nonetheless, it is our hope that the basic source will guide those of 
you implementing RemoteSpeech.  And perhaps we can finish polishing 
these two implementations into something that is ready for prime time.


Let me know if you have any questions!



Anm

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Smartbody-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/smartbody-developer

Attachment: remote_speech_cpp.diff
Description: Binary data

Attachment: sbm_audio_cpp.diff
Description: Binary data

Attachment: MaryClientUser.java
Description: Binary data

Attachment: MaryReader.java
Description: Binary data

<?xml version="1.0" encoding="UTF-8"?>
<!--
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You under the Apache License, Version 2.0
    (the "License"); you may not use this file except in compliance with
    the License.  You may obtain a copy of the License at
   
    http://www.apache.org/licenses/LICENSE-2.0
   
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<project name="Inbox" default="help" basedir=".">

	<property name="class.dir" value="target/classes" />
	<property name="activemq.home" value=".." />

	<!-- example program defaults -->
	<property name="url" value="tcp://localhost:61616" />
	<property name="topic" value="false" />
	<property name="subject" value="NEWQUEUE" />
	<property name="durable" value="false" />
	<property name="max" value="2000" />
	<property name="messageSize" value="1000" />
	<property name="clientId" value="consumer1" />
	<property name="producerClientId" value="null" />
	<property name="timeToLive" value="0" />
	<property name="sleepTime" value="0" />
	<property name="transacted" value="false" />
	<property name="reply-subject" value="" />
	<property name="verbose" value="true"/>
	<property name="ack-mode" value="AUTO_ACKNOWLEDGE"/>
	<property name="receive-time-out" value="0"/>
	<property name="subscribers" value="1"/>
	<property name="batch" value="10"/>
	
	<!-- for WAR -->
	<property name="app.name" value="activemq-web" />
	<property name="app.base.dir" location="target/${app.name}" />
	<property name="app.webinf.dir" value="${app.base.dir}/WEB-INF" />
	<property name="app.classes.dir" value="${app.webinf.dir}/classes" />
	<property name="app.lib.dir" value="${app.webinf.dir}/lib" />
	<property name="app.src.dir" value="src" />
	<property name="app.conf.dir" value="conf" />
	<property name="app.dist.dir" value="target" />


	<target name="help">
		<echo>
		This script requires Ant 1.6 or higher
NOTE: All options should be specified as system properties 
      on the command line, e.g.:
      ant consumer -Durl=tcp://hostname:1234 -Dtopic=true
      
		 Usage:
            --------------------------------------------------------
            
            --------------------------------------------------------

            Options: 
                              url - Used to specify acustom URL for the 
                                    broker, e.g., tcp://hostname:1234
                            topic - A boolean to determine whether to use
                                    topics or queues; the default is false
                          subject - Used to specify a custom destination 
                                    name, e.g. MyDestination
                          durable - A boolean to specify that you want to 
                                    create a durable topic? 
                              max - The maximum number of messages to wait 
                                    for before shutting down 
                         clientId - A string to use as the client id
                       transacted - A boolean to specify that you want to use 
                                    transactions? 
                        sleepTime - The time to sleep between message consumptions
                          verbose - Used to print out more info; the default is
                                    true 
                         ack-mode - The type of message acknowledgement to use; 
                                    see the Javadocs for javax.jms.Session for
                                    more information
                 receive-time-out - An integer to specify the time to wait for
                                    message consumption
 
            --------------------------------------------------------
		   ant -help		     		display ant help screen
		   ant help						display this message
		   ant clean		     		delete the built directory

		   ant consumer        creates a consumer which waits until a specific number of messages have been received
		   ant producer        creates a producer publishing a number of messages
		   ant embedBroker     runs an embedded broker inside Java code

       ant war      				creates a WAR deployment unit of the ActiveMQ Broker
    </echo>
	</target>

	<target name="clean">
		<delete dir="target" quiet="true" />
		<delete dir="${class.dir}" quiet="true" />
	</target>

	<target name="init">
		<mkdir dir="${class.dir}" />
		<mkdir dir="src/ddl" />

		<path id="javac.classpath">
			<pathelement path="${class.dir}" />
			<pathelement path="conf" />
			<fileset dir="../lib">
				<include name="**/*.jar" />
			</fileset>
                        <fileset dir="../../../marytts/java">
				<include name="*.jar" />
			</fileset>
		</path>
	</target>


	<target name="compile" depends="init" description="Compile all Java">
		<javac srcdir="src" destdir="${class.dir}" debug="on">
			<classpath refid="javac.classpath" />
		</javac>
		<copy todir="${class.dir}">
			<fileset dir="src">
				<include name="**/*.properties" />
				<include name="**/*.xml" />
			</fileset>                     
		</copy>
	</target>

	<target name="war" depends="compile" description="Create the activemq broker war file.">
		<!--Copy the required jar files-->
		<copy todir="${app.lib.dir}">
			<fileset dir="../lib">
				<include name="*.jar" />
				<exclude name="servlet.jar" />
			</fileset>
                        
			<fileset dir="../../../marytts/java">
				<include name="*.jar" />
				<exclude name="servlet.jar" />
			</fileset>

			<fileset dir="../lib/optional">
				<include name="activemq-web*.jar" />
				<include name="activemq-container*.jar" />
				<include name="commons-bean*.jar" />
				<include name="spring*.jar" />
				<include name="xbean*.jar" />				

				<!-- include Apache Derby for persistence -->
				<include name="derby*.jar" />

				<!-- include database pooling just in case -->
				<include name="commons-pool*.jar" />
				<include name="commons-db*.jar" />
			</fileset>
		</copy>
		<!--Copy the configuration file-->
		<copy todir="${app.webinf.dir}">
			<fileset dir="${app.conf.dir}">
				<!--Web application configuration file-->
				<include name="web.xml" />
				<!--ActiveMQ configuration file-->
				<include name="activemq.xml" />
			</fileset>
		</copy>
		<copy todir="${app.classes.dir}">
			<fileset dir="${app.conf.dir}">
				<!--Log4j configuration file-->
				<include name="log4j.properties" />
			</fileset>
		</copy>
		<!-- Create the war file -->
		<jar jarfile="${app.dist.dir}/${app.name}.war" basedir="${app.base.dir}" />
	</target>

	<target name="consumer" depends="compile" description="Runs a simple consumer">

		<echo>Running consumer against server at $$url = ${url} for subject $$subject = ${subject}</echo>
		<java classname="ConsumerTool" fork="yes" maxmemory="100M">
			<classpath refid="javac.classpath" />
			<jvmarg value="-server" />
		    <sysproperty key="activemq.home" value="${activemq.home}"/>
			<arg value="--url=${url}" />
			<arg value="--topic=${topic}" />
			<arg value="--subject=${subject}" />
			<arg value="--durable=${durable}" />
			<arg value="--maxium-messages=${max}" />
			<arg value="--client-id=${clientId}" />
			<arg value="--transacted=${transacted}" />
			<arg value="--sleep-time=${sleepTime}" />
			<arg value="--verbose=${verbose}"/>
			<arg value="--ack-mode=${ack-mode}"/>		
			<arg value="--receive-time-out=${receive-time-out}"/>					
		</java>
	</target>

	<target name="producer" depends="compile" description="Runs a simple producer">

		<echo>Running producer against server at $$url = ${url} for subject $$subject = ${subject}</echo>
		<java classname="ProducerTool" fork="yes" maxmemory="100M">
			<classpath refid="javac.classpath" />
			<jvmarg value="-server" />
		    <sysproperty key="activemq.home" value="${activemq.home}"/>
			<arg value="--url=${url}" />
			<arg value="--topic=${topic}" />
			<arg value="--subject=${subject}" />
			<arg value="--persistent=${durable}" />
			<arg value="--message-count=${max}" />
			<arg value="--message-size=${messageSize}" />
			<arg value="--time-to-live=${timeToLive}" />
			<arg value="--sleep-time=${sleepTime}" />
			<arg value="--transacted=${transacted}" />
			<arg value="--verbose=${verbose}"/>			
		</java>
	</target>

	<target name="mary" depends="compile" description="Runs the mary client">

            <echo>Running mary client against server</echo>
            <java classname="MaryClientUser" fork="yes" maxmemory="100M">
                <sysproperty key="activemq.home" value="${activemq.home}"/>
                <classpath refid="javac.classpath" />
            </java>
	</target>

        <target depends="compile" description="Runs Mary client in debug mode" name="debug-nb">
            <echo>Running mary client against server</echo>
            <java classname="MaryClientUser" fork="yes" maxmemory="100M">
                <sysproperty key="activemq.home" value="${activemq.home}"/>
                <classpath refid="javac.classpath"/>
                <jvmarg value="-Xdebug"/>
            </java>
        </target>

	<target name="both" depends="compile" description="Runs both producer and consumer">
            <echo>Running Consumer and Producer</echo>
                <java classname="ProducerAndConsumerTool" fork="yes" maxmemory="100M">
                    <classpath refid="javac.classpath" />
                    <jvmarg value="-server" />
		    <sysproperty key="activemq.home" value="${activemq.home}"/>
                    <arg value="--url=${url}" />
                    <arg value="--topic=${topic}" />
                    <arg value="--subject=${subject}" />
                    <arg value="--persistent=${durable}" />
                    <arg value="--message-count=${max}" />
                    <arg value="--message-size=${messageSize}" />
                    <arg value="--time-to-live=${timeToLive}" />
                    <arg value="--sleep-time=${sleepTime}" />
                    <arg value="--transacted=${transacted}" />
                    <arg value="--verbose=${verbose}"/>
                </java>
        </target>


	<target name="requester" depends="compile" description="Runs a simple requester">

		<echo>Running requester against server at $$url = ${url} for subject $$subject = ${subject}</echo>
		<java classname="RequesterTool" fork="yes" maxmemory="100M">
			<classpath refid="javac.classpath" />
			<jvmarg value="-server" />
		    <sysproperty key="activemq.home" value="${activemq.home}"/>
			<arg value="--url=${url}" />
			<arg value="--topic=${topic}" />
			<arg value="--subject=${subject}" />
			<arg value="--persistent=${durable}" />
			<arg value="--message-count=${max}" />
			<arg value="--message-size=${messageSize}" />
			<arg value="--client-id=${producerClientId}" />
			<arg value="--time-to-live=${timeToLive}" />
			<arg value="--sleep-time=${sleepTime}" />
			<arg value="--transacted=${transacted}" />
			<arg value="--reply-subject=${reply-subject}" />
			<arg value="--verbose=${verbose}"/>			
		</java>
	</target>

	<target name="embedBroker" depends="compile" description="Runs a simple producer">

		<echo>Running an embedded broker example</echo>
		<java classname="EmbeddedBroker" fork="yes" maxmemory="100M">
			<classpath refid="javac.classpath" />
			<jvmarg value="-server" />
		    <sysproperty key="activemq.home" value="${activemq.home}"/>
		</java>
	</target>
	
	<target name="topic-publisher" depends="compile" description="Runs a publisher">
		<java classname="TopicPublisher" fork="yes" maxmemory="100M">
			<classpath refid="javac.classpath" />
			<jvmarg value="-server" />
			<arg value="--url=${url}" />
			<arg value="--size=${messageSize}" />
			<arg value="--subscribers=${subscribers}" />
			<arg value="--messages=${max}" />
			<arg value="--delay=${sleepTime}" />
			<arg value="--batch=${batch}" />			
		</java>
	</target>	
	
	<target name="topic-listener" depends="compile" description="Runs a listener">
		<java classname="TopicListener" fork="yes" maxmemory="100M">
			<classpath refid="javac.classpath" />
			<jvmarg value="-server" />
			<arg value="--url=${url}" />
		</java>
	</target>	
	
</project>
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Smartbody-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/smartbody-developer

Reply via email to