B4J Library jSpeechLib library

Using the techniques explained in my jDotNetBridge demonstration I have ported my Basic4ppc SpeechLibDesktop library to B4J. This uses the ActiveX Microsoft Speech Object Library.

Note that you will need to use a 32bit Java runtime as the .NET assembly has to be compiled for a specific CPU type in order to export its' methods as unmanaged calls. I chose to use 32-bit as it will work on both 32 and 64 bit CPUs.

It is slightly unfortutunate that I can't raise events in the B4J code from the .NET side but I can't at the moment think of a way to do that (actually I do have an idea that might sort of work). Events from COM work nicely on the .NET side but I have to reveal them as flags and counts on the Java side.

EDIT :- Version1.1 now posted. See post #5 for details.
 

Attachments

  • jSpeechLibDemo1.1.zip
    15.4 KB · Views: 754
Last edited:

magoandroid

Member
Licensed User
Longtime User
Hi Agraham,
thanks for the (almost) daily sharing of your work.
You are an unlimited source that nourishes our mind.

MAgo
 

agraham

Expert
Licensed User
Longtime User
I then changed the referenced Java to the 32bit (x86) Java and it worked.
I should have commented on that. I'll add it to the first post. As noted in the UnmanagedExports.rtf document the .NET assembly must be compiled for a specific CPU and not "Any CPU". I chose x86 as being the lowest common denominator.
 

Theera

Well-Known Member
Licensed User
Longtime User
Hi araham,
You are the power man,I like all of your works. I need to ask you please guide to me,If I have Thai sentence ,how do I modify?
 

ivanomonti

Expert
Licensed User
Longtime User
Help me!! I installed a new entry (Italian) in my pc and I Vuori is a voice message like this:

"attention to the license used is not valid for this computer", system messages are in Italian, but using this code ni by the warning message.

B4X:
Sub bt8_MouseClicked (EventData As MouseEvent)
    Dim sp As SpeechLib
    sp.Initialize
    sp.SpeechRate = -1
    sp.SayASync(tx1.Text)   
End Sub
 

inakigarm

Well-Known Member
Licensed User
Longtime User
Hi:

I don't know if I'm doing anything wrong but I can't reset TTS when iniciated (firts post example ); I can pause it, resume but not reset to the initial state (tried Initialize also) after calling SayAsync

It seems that SpeakAsyncCancelAll() or StopSpeaking method to stop the Text-to-Speech is not implemented in this lib.

Did someone work with this lib and know how to stop the TTs speaking?
 

flent

Member
Licensed User
Longtime User
Hi,

this library works fine if I run the program in Debug or Release mode from the IDE. Then I try to run the compiled applet and... crash. I say the problem is MSSpeech.DLL -

Where MSSpeech.DLL must be located if I want to DEPLOY the applet on Pc or Mac?

Thank
 

flent

Member
Licensed User
Longtime User
So impossible to have tts on the Mac in this way, period.

Now in Windows. No problem at all with 64 or 32 bit JVM... running from the IDE. But I would be able to deploy (targetting any Windows machine).

main._appstart (java line: 71)
java.lang.UnsatisfiedLinkError: Unable to load library 'MSSpeech': Native library (win32-x86-64/MSSpeech.dll) not found in resource path ([file:/C:/Users/gabbe/Desktop/JavaProject1.jar])

Thanks for all. I'm working with B4A, B4i and now B4J. My apps are focused on speech synth and recognition.
 

marco.canta

Active Member
Licensed User
Longtime User
I have a problem when I enable the library speechLib and starting the program I get the following error.

-----------------------------------------------------------------

Building jar file. Error
Zip64 Extended information found but version is not valid

-----------------------------------------------------------------

I use Windows7 64bit.

Thanks Marco
 
Last edited:

Mashiane

Expert
Licensed User
Longtime User
So impossible to have tts on the Mac in this way, period.

Now in Windows. No problem at all with 64 or 32 bit JVM... running from the IDE. But I would be able to deploy (targetting any Windows machine).

main._appstart (java line: 71)
java.lang.UnsatisfiedLinkError: Unable to load library 'MSSpeech': Native library (win32-x86-64/MSSpeech.dll) not found in resource path ([file:/C:/Users/gabbe/Desktop/JavaProject1.jar])

Thanks for all. I'm working with B4A, B4i and now B4J. My apps are focused on speech synth and recognition.
Copy the msspeech.dll to your objects folder in your windows platform.
 
Top