Jump to content

Java Applet to Read passed variable from php


EmSyLicious0103

Recommended Posts

I am making a java applet that will literally read (text-to-speech) the word passed by a Php page..

 

this is trial code in php (i made a simple one first to make it easier to look for the error)

<? $readme="hello hello hello"; ?>

<applet code="HelloWorld.class">

<param name="readme" value="<?php echo $readme; ?>" />

</applet>

 

then this is the code form my java program..

public class HelloWorld extends Applet {

    public static void main(String args[]) throws NullPointerException

    {

        try

        {

            Synthesizer synth;

            synth = Central.createSynthesizer( new SynthesizerModeDesc(Locale.ENGLISH));

synth.allocate () ;

synth.resume () ;

 

String readme = this.getParameter("readme");

synth.speakPlainText ( readme, null ) ;

synth.waitEngineState ( Synthesizer.QUEUE_EMPTY ) ;

synth.deallocate();

        }

        catch(Exception r)

        {

        r.printStackTrace();

        }

    }

}

 

 

i tried running it on localhost and it does not produce an audio that is supposed to be the word passed from the php page.. PLS HELP :{

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.