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 :{

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.