Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Foreign Languages > Spanish Forum
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Enlazar "wrap" TTS español

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-20-2007, 02:00 PM
Newbie
 
Join Date: Oct 2007
Posts: 5
Default Enlazar "wrap" TTS español

Saludos a todos, soy relativamente nuevo en este foro y he estado leyendo threads que me están resultando muy interesantes y educativos en mis primeros pasitos con Basic4PPC.
Sobre todo me he interesado por los mensajes sobre librerías TTS para que hable la "bicha"
He probado la librería FLITE (que habla en inglés) y se me ha ocurrido probar otra que habla supuestamente en español, dentro del diccionario Lingvosoft Talking Dicc English Spanish hay una librería de TTS español llamada TTS_SPA.DLL (supongo que no será delito cacharrear sin ánimo de lucro con librerías de terceros) y he preparado un enlace mediante TTSWRAP.DLL para que se pueda invocar desde Basic4PPC.
Bueno hasta aquí bien, pero solo consigo que pronuncie la primera letra del texto deseado.
No sé si alguien sabe como resolver el problema. ¿Como conseguir que pronuncie la frase completa?
Adjunto la librería y el enlazador por si quereis probarlo.

Felices Pascuas
Attached Files
File Type: zip TTS.zip (60.0 KB, 88 views)
Reply With Quote
  #2 (permalink)  
Old 12-20-2007, 05:22 PM
Junior Member
 
Join Date: Apr 2007
Location: Spain
Posts: 13
Default

¿Funciona en Desktop, o solo en PPC?
__________________
Discovering Basic4PPC, Great Job!!!
Reply With Quote
  #3 (permalink)  
Old 12-20-2007, 07:11 PM
Newbie
 
Join Date: Oct 2007
Posts: 5
Default La versión desktop

La librería posteada antes solo es para la PDA.
Ahora posteo lo mismo pero con una librería TTS_SPA.DLL de versión windows.
Curiosamente en este caso pronuncia toda la frase que se teclee. Claro compilándolo para Desktop y ejecutándolo en el PC.
Saludos,
Attached Files
File Type: zip voz desktop.zip (70.4 KB, 68 views)
Reply With Quote
  #4 (permalink)  
Old 12-22-2007, 05:54 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by CANCUNATNIGHT View Post
Bueno hasta aquí bien, pero solo consigo que pronuncie la primera letra del texto deseado.
I can just about read, but not write Spanish. I had a similar effect porting the Flite library. .NET strings are UTF-16 but the C based Flite code wanted ASCI strings so Flite saw the first character then a zero which it treated as end of string. I had to repack the string to make it work.
Reply With Quote
  #5 (permalink)  
Old 12-23-2007, 06:27 PM
Newbie
 
Join Date: Oct 2007
Posts: 5
Default Thanks

English:
First one, thanks for your answer Agraham.
I supose that the string conversion from UTF16 to ASCII encode must be done into the original dll (in my case in TTS_SPA.DLL), so I can't continue (the DLL is from Lingvosoft and I have no permission for dissassemble)
Or is it possible make it in C#, into the wrapp dll?

Merry Christmas
------
Now spanish:
Lo primero, gracias por tu respuesta Agraham.
Supongo que la conversión de la cadena de la codificación UTF16 a la de ASCII debe realizarse dentro de la librería original (en mi caso TTS_SPA.DLL), en ese caso no puedo continuar (la librería es propiedad de Lingvosoft y no tengo permiso para desensamblarla).
¿O es posible que la conversión pueda hacerse desde C#, dentro del enlazador wrap?
Feliz Navidad.
Reply With Quote
  #6 (permalink)  
Old 12-23-2007, 07:27 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by CANCUNATNIGHT View Post
Or is it possible make it in C#, into the wrapp dll?
You could try encoding the string into a byte array as UTF-8, stick a 0 after the last byte of the string to terminate it and pass the byte array.
Code:
using System;
using System.Text;
class UTF8EncodingExample {
    public static void Main() {
        // Create a UTF-
8 encoding.
        UTF8Encoding utf8 = new UTF8Encoding();
        
        // A Unicode 
string with two characters outside an 8-bit code range.
        
String unicodeString =
            
"This unicode string contains two characters " +
            
"with codes outside an 8-bit code range, " +
            
"Pi (\u03a0) and Sigma (\u03a3).";
        Console.WriteLine(
"Original string:");
        Console.WriteLine(unicodeString);

        // Encode the 
string.
        
Byte[] encodedBytes = utf8.GetBytes(unicodeString);
        Console.WriteLine();
        Console.WriteLine(
"Encoded bytes:");
        foreach (
Byte b in encodedBytes) {
            Console.Write(
"[{0}]", b);
        }
        Console.WriteLine();
        
        // Decode bytes back 
to string.
        // Notice Pi 
and Sigma characters are still present.
        
String decodedString = utf8.GetString(encodedBytes);
        Console.WriteLine();
        Console.WriteLine(
"Decoded bytes:");
        Console.WriteLine(decodedString);
    }
}
Reply With Quote
  #7 (permalink)  
Old 12-27-2007, 12:26 PM
Newbie
 
Join Date: Oct 2007
Posts: 5
Default Solucionado TTS español device

Gracias a la pista que remite Agraham, he enlazado la librería de voz y ahora parece que funciona bien. Pronuncia toda la frase, reconoce vocales acentuadas, la ñ y demás caracteres españoles.
El código que he incluido en el enlazador "wrap" TTSwrap.dll es el siguiente:
------------------------------------------------------------------------
Thanks to Agraham for his trail, I have wrapped the TTS library and now, it seems to speak all the sentence, it admits accentuated vocal, the ñ character and others spanish symbols.
The code included for the class in the ttswrap.dll is the follow:

-----------------------------------------------------------------------
namespace Ttswrap
{
using System;
using System.Runtime.InteropServices;

public class esp : IDisposable
{
public esp()
{
Init_TTS();
}
[DllImport("TTS_spa.dll")]
private static extern void DeInit_TTS();
public void Dispose()
{
DeInit_TTS();
}
[DllImport("TTS_spa.dll")]
private static extern void Init_TTS();
[DllImport("TTS_spa.dll")]
private static extern int Say_TTS(byte[] texto);

public int Voz(string texto)
{
return Say_TTS(System.Text.UnicodeEncoding.Default.GetByt es(texto));
}
}
}
-------------------------------------------------------------------------

Happy New Year
Attached Files
File Type: zip voz TTS device.zip (60.1 KB, 102 views)
Reply With Quote
  #8 (permalink)  
Old 05-13-2009, 12:28 PM
Knows the basics
 
Join Date: May 2008
Posts: 53
Default

Felicidades, funciona perfecto.

Una pregunta: ¿Puedo usarla legalmente en mis programas o tengo que pagar alguna licencia por el TTS_SPA.DLL?

Gracias
Reply With Quote
  #9 (permalink)  
Old 05-13-2009, 01:15 PM
Senior Member
 
Join Date: Apr 2007
Location: Canari Islan
Posts: 102
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Alucinante.

No sabia que estaba esto en el foro, lo he probado y funciona correctamente, es una gran aportación, espero que se pueda utilizar legalmente.
Reply With Quote
  #10 (permalink)  
Old 11-18-2009, 05:34 AM
Newbie
 
Join Date: Nov 2009
Posts: 1
Default FLITE? dictado?

Hola, tienen de casualidad un dll funcionando de FLITE (TTS Ingles) porque no logro compilarlo ni implementarlo alguien sabe de esto?

Por otro lado alguien tiene conocimiento si hay SDK o API existente para reconocimiento de voz en modo dictado?

Hi there, does any of you has a FLITE dll working (TTS english) because i haven't acomplish to compile or run it on a WM app, does any one knows something about this?

on the other hand, someone has any knowloadge about voice recognition (STT) on dictation mode, not comand???
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
"AddEvent" and "buttonUp/buttonDown" Byak@ Questions (Windows Mobile) 12 09-10-2008 04:04 PM
Neuling bei Basic4ppc - wollte mal "Hallo" sagen ... JOTHA German Forum 49 08-29-2008 12:59 AM
Is there any thing like Visual Basic "Tabbed dialog control" in Basic4ppc? mozaharul Questions (Windows Mobile) 6 03-23-2008 12:07 PM
Image Button kommt nicht wieder "hoch" troll German Forum 3 02-22-2008 10:03 AM
calling the device's "Programs" or "settings" screens HarleyM Questions (Windows Mobile) 0 12-05-2007 03:59 AM


All times are GMT. The time now is 01:02 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0