Hi, is there any source for a text to phoneme converter in PB? Failing this, is there a C to PB converter? I found something but it's in C (and I don't know the first thing about C) http://www.speech.cs.cmu.edu/comp.speec ... eme.3.html
Thanks!
Text to Phonemes / C to PB converter
maybe "Demo_Sapi.pb" sample in COMate 4.30 by srod in http://www.nxsoftware.com/ 

Ah yes, I've just had a look at this, it sends text to a SAPI voice.
What I am looking for though, is something like the program in my first post, where it converts text to phonemes, not text to speech. So, if I type in "My Generation." the program outputs "~mAY _J2EHnAXr1EYSIXn." (or similar)
Thanks!
What I am looking for though, is something like the program in my first post, where it converts text to phonemes, not text to speech. So, if I type in "My Generation." the program outputs "~mAY _J2EHnAXr1EYSIXn." (or similar)
Thanks!
Last edited by wmorton on Tue May 05, 2009 5:16 pm, edited 1 time in total.
If you decide to port the code, do try and don't give up. You'll soon realize the syntax of C isn't that hard and you'll probably even have an epiphany sooner or later.
Just to get you started the first 3 functions of phoneme.c
One of the biggest problems will probably be the arrays due to syntax constraints in PB but you could easily load the contents from a txt which will ultimately be a better option if you require flexibility, although the data appears to be constant in this case.
Some functions are not required to be ported because in PB you already have quite a few string manipulation helpers. Unless that is you want to perform a literal port of the code.
In such case you'll need this as well:
some testing code...
Cheers.
Just to get you started the first 3 functions of phoneme.c
Code: Select all
Procedure.i isupper( chr.c )
ProcedureReturn ( chr => 'A' And chr <= 'Z' )
EndProcedure
Procedure.i isvowel( chr.c )
ProcedureReturn ( chr = 'A' Or chr = 'E' Or chr = 'I' Or chr = 'O' Or chr = 'U' )
EndProcedure
Procedure.i isconsonant( chr.c )
ProcedureReturn ( isupper(chr) And Not isvowel(chr) )
EndProcedure
Some functions are not required to be ported because in PB you already have quite a few string manipulation helpers. Unless that is you want to perform a literal port of the code.
In such case you'll need this as well:
Code: Select all
Procedure.i isalpha( chr.c )
ProcedureReturn (chr => 'A' And chr <= 'Z') Or (chr => 'a' And chr <= 'z')
EndProcedure
Procedure.i isdigit( chr.c )
ProcedureReturn (chr => '0' And chr <= '9')
EndProcedure
Procedure.i islower( chr.c )
ProcedureReturn (chr => 'a' And chr <= 'z')
EndProcedure
Code: Select all
Debug isupper( 'a' )
Debug isupper( 'A' )
Debug isvowel( 'F' )
Debug isvowel( 'E' )
Debug isconsonant( 'A' )
Debug isconsonant( 'D' )
Debug isalpha('0')
Debug isalpha('A')
Debug isdigit( 'D' )
Debug isdigit( '4' )
Debug islower( 'A' )
Debug islower( 'a' )
Cheers.