Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Contributor
Posts: 3
Registered: ‎04-19-2010
My Device: Bold
My Carrier: Rogers

Text to Speech

[ Edited ]

I am trying to do a text to speech app, for OS 5.0, I know it supports JSR 113, here's my simple code:

 

 

            // Create a synthesizer for the default speech locale
            Synthesizer synth = (Synthesizer)EngineManager.createEngine(SynthesizerMode.DEFAULT);
            // Get it ready to speak
            synth.allocate();
            // Speak the "Hello" string
            synth.speak("hello.", null);
            // Clean up - includes waiting for the queue to empty
            synth.deallocate();

 

AND here is what got in the console:\

 

 

TTSN: Attempting to initialize (param ignored)...

TTSN: Attempting to open.

TTSN: Opening output channel 0xFF.

AR: add source 3

AR: setAudioMode 20

TTSN: Attempting to play "hello.".

AR: remove source 3

AR: setAudioMode 32

TTSN: Closing output channel.

 

 

 

BUT i am not getting any sound. I am running this in a simulator. Anyone know why?

 

Thanks in advance for any help or direction.

 

Regards,

 

Johnny.

New Contributor
Posts: 3
Registered: ‎04-19-2010
My Device: Bold
My Carrier: Rogers

Re: Text to Speech

Figured it out, you have to turn on "text-to-speech" in the simulator.

Highlighted
Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: Text to Speech

[ Edited ]

Did you try it on a device yet? I saw the support but it is not an officially supported API (otherwise they would have mentioned it) but could not find a good tutorial.

 

By the way what simulator are you using? The Storm 9550 simulator says that net_rim_speech could not be found yet the cod file is there.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Visitor
Posts: 1
Registered: ‎05-29-2010
My Device: N/A
My Carrier: N/A

Re: Text to Speech

I am having the same problem with the 9550 simulator (net_rim_speech module could not be found).

 

Does anyone knows how to make this work?

New Member
Posts: 1
Registered: ‎06-10-2010
My Device: Bold 9700
My Carrier: Rogers

Re: Text to Speech

hello I have also got text to speech working in the 9700 simulator.  However i do not think this is supported on the actual device.  did you happen to find any proprietary/3rd party libraries that work on the device?

New Contributor
Posts: 8
Registered: ‎06-07-2010
My Device: Blackberry bold 9000
My Carrier: Airtel

Re: Text to Speech

Hey Tshi,

 

I am a newbie in Blackberry development, I have been trying to implement TTS in Blackberry for about two weeks now and have tried every single solution available on net but none of them worked for me. I have tried importing JSAPI.jar, JSAPI2.jar, FreeTTS.jar, etc in my Blackberry project (using bb-ant tool in Eclipse, also in Blackberry JDE,) but nothing seems to work. When I tried JSAPI.jar it always gives me Duplicate definition found for Audio.Event class. If I try FreeTTS.jar it gives me No Class definition found for almost all the classes of FreeTTS.jar.  When I use JSAPI2.jar it give me an errors saying can not access java.net.url.

 

As yours is the only post I found in which TTS is somehow working on Blackberry. Can you please explain me the steps you took to make it working.

 

Please provide me some tips for this, I have tried every thing I can and am feeling very frustrated now.

 

Thank you in Advance!

 

Thanks,

Nikesh

Developer
Posts: 709
Registered: ‎09-10-2009
My Device: 8520, 8900, 9000, 9300, 9650, 9700, 9780, 9800, 9810, 9900, 9930
My Carrier: Verizon

Re: Text to Speech

Be warned. A lot of things (especially third party libraries) work on the simulator won't work on the actual device since lots of times, these libraries use native interface to a targeted host dll. Don't know if TTS is one of those. However, from 15 years of experience working with speech products, most libraries has some kind of processor dependent dsp codes.

New Contributor
Posts: 8
Registered: ‎06-07-2010
My Device: Blackberry bold 9000
My Carrier: Airtel

Re: Text to Speech

Hi Aviator,

 

Thanks for taking some time out and look in to my problem. I would be happy even if I get it working on SimulatorSmiley Wink but its not working on it as well.

 

Any way thanks again for looking at the post. I will continue to dig in to it.

 

Thanks,

Nikesh

Developer
Posts: 106
Registered: ‎06-18-2009
My Device: Bold

Re: Text to Speech

[ Edited ]

Was anyone able to get Text to Speech working?


My code works fine (similar to OP's code) on the simulator but on the device I'm getting access denied.

Error: "JSR-113 access denied"

 

I checked application permissions and enabled everything but still no luck.

 

In this document (http://docs.blackberry.com/en/admin/deliverables/14557/Text-To-Speech_API-Security_Note--1048931-031...) by RIM they are stating:

"Currently, RIM limits the use of the Text-To-Speech API."

 

If access is limited, how can an application get access to it? Do we have to be an Alliance Member?

----
If this helped you, press the thumbs up button (on the far right - '+' thumb icon)
If this post solved the issue, click "Accept as Solution"
Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: Text to Speech

[ Edited ]

No, it is not a public API. So usage of it is sketchy and shouldn't be relied on.

 

EDIT: Hmm, didn't realize they had a document out about it. Regardless, if it's not in the public API (such as http://www.blackberry.com/developers/docs/5.0.0api/index.html) then it is litmited. You can probably send RIM a note asking them how to get access to it.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.