Text-To-Speech open sources also for Sony PSP?

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

liberty
Posts: 33
Joined: Wed Sep 16, 2009 11:30 am

Post by liberty »

coolkehon wrote:so are you going to do it?
Yes, I am going to.
But seems not very easy.
I get the many errors compiling it. It cannot find printf, exit, fopen, fseek ... ALL libc function.

I don't know whether I do the right thing:
1. Modify the config.sub, add psp
2. Modify the configure file, so it won't get error about executable.
3. LDFLAGS="-L$(psp-config --pspsdk-path)/lib -lpspuser -lc"
CFLAGS="-ffast-math -fsigned-char -G0"
I have also tried -lpsplibc. It also does not work.
4. ./configure --host=psp --prefix=$(psp-config --psp-prefix)
5. make

Some error like this:

Code: Select all

psp-gcc -g -O2 -Wall    -o ../bin/find_sts find_sts_main.o  -L../build/mipsallegrexel-elf/lib -L/opt/pspdev//psp/sdk/lib -L/opt/pspdev/psplib/ -lflite -lpsplibc -lm  
/home/Liberty/programs/pspdev/bin/../lib/gcc/psp/4.3.2/../../../../psp/lib/crt0.o: In function `_start':
/home/Liberty/install/psptoolchain/build/pspsdk/src/startup/crt0.c:149: undefined reference to `sceKernelCreateThread'
/home/Liberty/install/psptoolchain/build/pspsdk/src/startup/crt0.c:150: undefined reference to `sceKernelStartThread'
find_sts_main.o: In function `save_sts':
/home/Liberty/install/flite-1.3-release/tools/find_sts_main.c:197: undefined reference to `_impure_ptr'
/home/Liberty/install/flite-1.3-release/tools/find_sts_main.c:197: relocation truncated to fit: R_MIPS_GPREL16 against `_impure_ptr'
find_sts_main.o: In function `main':
/home/Liberty/install/flite-1.3-release/tools/find_sts_main.c:226: undefined reference to `_impure_ptr'
/home/Liberty/install/flite-1.3-release/tools/find_sts_main.c:226: relocation truncated to fit: R_MIPS_GPREL16 against `_impure_ptr'
/home/Liberty/install/flite-1.3-release/tools/find_sts_main.c:236: undefined reference to `_impure_ptr'
/home/Liberty/install/flite-1.3-release/tools/find_sts_main.c:236: relocation truncated to fit: R_MIPS_GPREL16 against `_impure_ptr'
../build/mipsallegrexel-elf/lib/libflite.a(cst_error.o): In function `cst_errmsg':
/home/Liberty/install/flite-1.3-release/src/utils/cst_error.c:101: undefined reference to `_impure_ptr'
/home/Liberty/install/flite-1.3-release/src/utils/cst_error.c:101: relocation truncated to fit: R_MIPS_GPREL16 against `_impure_ptr'
../build/mipsallegrexel-elf/lib/libflite.a(cst_track_io.o): In function `cst_track_load_est':
/home/Liberty/install/flite-1.3-release/src/speech/cst_track_io.c:217: undefined reference to `atoi'
/home/Liberty/install/flite-1.3-release/src/speech/cst_track_io.c:219: undefined reference to `atoi'
../build/mipsallegrexel-elf/lib/libflite.a(cst_string.o): In function `cst_upcase':
/home/Liberty/install/flite-1.3-release/src/utils/cst_string.c:146: undefined reference to `__ctype_ptr'
/home/Liberty/install/flite-1.3-release/src/utils/cst_string.c:146: relocation truncated to fit: R_MIPS_GPREL16 against `__ctype_ptr'
/home/Liberty/install/flite-1.3-release/src/utils/cst_string.c:144: undefined reference to `__ctype_ptr'
/home/Liberty/install/flite-1.3-release/src/utils/cst_string.c:144: relocation truncated to fit: R_MIPS_GPREL16 against `__ctype_ptr'
../build/mipsallegrexel-elf/lib/libflite.a(cst_string.o): In function `cst_downcase':
/home/Liberty/install/flite-1.3-release/src/utils/cst_string.c:132: undefined reference to `__ctype_ptr'
/home/Liberty/install/flite-1.3-release/src/utils/cst_string.c:132: relocation truncated to fit: R_MIPS_GPREL16 against `__ctype_ptr'
/home/Liberty/install/flite-1.3-release/src/utils/cst_string.c:130: undefined reference to `__ctype_ptr'
/home/Liberty/install/flite-1.3-release/src/utils/cst_string.c:130: relocation truncated to fit: R_MIPS_GPREL16 against `__ctype_ptr'
../build/mipsallegrexel-elf/lib/libflite.a(cst_tokenstream.o): In function `ts_close':
/home/Liberty/install/flite-1.3-release/src/utils/cst_tokenstream.c:185: undefined reference to `_impure_ptr'
/home/Liberty/install/flite-1.3-release/src/utils/cst_tokenstream.c:185: relocation truncated to fit: R_MIPS_GPREL16 against `_impure_ptr'
../build/mipsallegrexel-elf/lib/libflite.a(cst_tokenstream.o): In function `ts_open':
/home/Liberty/install/flite-1.3-release/src/utils/cst_tokenstream.c:147: undefined reference to `_impure_ptr'
/home/Liberty/install/flite-1.3-release/src/utils/cst_tokenstream.c:147: relocation truncated to fit: R_MIPS_GPREL16 against `_impure_ptr'
../build/mipsallegrexel-elf/lib/libflite.a(cst_val.o): In function `val_int':
/home/Liberty/install/flite-1.3-release/src/utils/cst_val.c:136: undefined reference to `atoi'
/opt/pspdev//psp/sdk/lib/libpsplibc.a(vprintf.o): In function `vprintf':
/home/Liberty/install/psptoolchain/build/pspsdk/src/libc/xprintf.c:973: undefined reference to `sceIoWrite'
/opt/pspdev//psp/sdk/lib/libpsplibc.a(fclose.o): In function `fclose':
/home/Liberty/install/psptoolchain/build/pspsdk/src/libc/stdio.c:115: undefined reference to `sceIoClose'
/opt/pspdev//psp/sdk/lib/libpsplibc.a(fopen.o): In function `fopen':
/home/Liberty/install/psptoolchain/build/pspsdk/src/libc/stdio.c:472: undefined reference to `sceIoOpen'
/opt/pspdev//psp/sdk/lib/libpsplibc.a(fread.o): In function `fread':
/home/Liberty/install/psptoolchain/build/pspsdk/src/libc/stdio.c:646: undefined reference to `sceIoRead'
I think it is not hard to resolve. But help![/code]
mypspdev
Posts: 178
Joined: Wed Jul 11, 2007 10:30 pm

Post by mypspdev »

I'm reading just now....
If anybody is interested in Flite (Text to speech) for PSP and PocketSphinx (Speech recognition) for PSP1000 (few commands) PSP2000 and PSP3000 (full dictionary), using all microphones Gocam, Socom, USB Microphone, PSP3000 microphone, let me know, I'll send you full package and libraries.

Regards
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Been very busy, but I'll try to look at it myself sometime in the next few weeks.
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

Good to see you got the PSP3000 mic working.
I still would like to see the voice recognition working on the PSP1000,
even if with limited words.
If not actually, then potentially.
liberty
Posts: 33
Joined: Wed Sep 16, 2009 11:30 am

Post by liberty »

mypspdev wrote:I'm reading just now....
If anybody is interested in Flite (Text to speech) for PSP and PocketSphinx (Speech recognition) for PSP1000 (few commands) PSP2000 and PSP3000 (full dictionary), using all microphones Gocam, Socom, USB Microphone, PSP3000 microphone, let me know, I'll send you full package and libraries.

Regards
I am interested in porting Flite. Do you have the package that can be compiled?
mypspdev
Posts: 178
Joined: Wed Jul 11, 2007 10:30 pm

Post by mypspdev »

liberty wrote:
mypspdev wrote:I'm reading just now....
If anybody is interested in Flite (Text to speech) for PSP and PocketSphinx (Speech recognition) for PSP1000 (few commands) PSP2000 and PSP3000 (full dictionary), using all microphones Gocam, Socom, USB Microphone, PSP3000 microphone, let me know, I'll send you full package and libraries.

Regards
I am interested in porting Flite. Do you have the package that can be compiled?
yes sure, it's impemented into MyPSP as well as within some work of Art... under pspsdk...
let me have time to prepare the zip...
liberty
Posts: 33
Joined: Wed Sep 16, 2009 11:30 am

Post by liberty »

mypspdev wrote:
liberty wrote:
mypspdev wrote:I'm reading just now....
If anybody is interested in Flite (Text to speech) for PSP and PocketSphinx (Speech recognition) for PSP1000 (few commands) PSP2000 and PSP3000 (full dictionary), using all microphones Gocam, Socom, USB Microphone, PSP3000 microphone, let me know, I'll send you full package and libraries.

Regards
I am interested in porting Flite. Do you have the package that can be compiled?
yes sure, it's impemented into MyPSP as well as within some work of Art... under pspsdk...
let me have time to prepare the zip...
Great work!
whistler
Posts: 39
Joined: Tue Mar 04, 2008 7:08 am

Post by whistler »

thanks mypspdev, could you post a link to the zip or send a pm:)
liberty
Posts: 33
Joined: Wed Sep 16, 2009 11:30 am

Post by liberty »

whistler wrote:thanks mypspdev, could you post a link to the zip or send a pm:)
If it is ready, please post here. Thanks!
mypspdev
Posts: 178
Joined: Wed Jul 11, 2007 10:30 pm

Post by mypspdev »

....you both interested of Flite should have MP....
(with package and ready to be recompiled solutions ...)
whistler
Posts: 39
Joined: Tue Mar 04, 2008 7:08 am

Post by whistler »

mypspdev, i've downloaded the flite lib and even though i'm not that familiar with it this is the code and makefile i'm using as a simple test

Code: Select all

#include <pspkernel.h>
#include <flite/flite.h>

cst_voice *register_cmu_us_kal&#40;&#41;;

PSP_MODULE_INFO&#40;"exflite", 0, 1, 1&#41;;

int main&#40;&#41;
&#123;
	cst_voice *v;
	flite_init&#40;&#41;;
        
   v = register_cmu_us_kal &#40;&#41;;
	flite_text_to_speech&#40;"How are you today", v, "play"&#41;;
	
	sceKernelExitGame&#40;&#41;;
	return 0;
&#125;

Code: Select all

TARGET = exflite
OBJS = exflite.o
BUILD_PRX=1

INCDIR = 
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $&#40;CFLAGS&#41; -fno-exceptions -fno-rtti
ASFLAGS = $&#40;CFLAGS&#41;

LIBDIR =
LDFLAGS =
LIBS = -lflite -lm -lpspaudio -lpspaudiolib

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Speech Sample

PSPSDK=$&#40;shell psp-config --pspsdk-path&#41;
include $&#40;PSPSDK&#41;/lib/build.mak

Code: Select all

&#91;nicky@localhost Desktop&#93;$ make
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION=150  -L. -L/usr/local/pspdev/psp/sdk/lib -specs=/usr/local/pspdev/psp/sdk/lib/prxspecs -Wl,-q,-T/usr/local/pspdev/psp/sdk/lib/linkfile.prx   exflite.o /usr/local/pspdev/psp/sdk/lib/prxexports.o -lflite -lm -lpspaudio -lpspaudiolib -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o exflite.elf
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libflite.a&#40;audio.o&#41;&#58; In function `audio_flush'&#58;
audio.c&#58;&#40;.text+0x18&#41;&#58; undefined reference to `audio_flush_none'
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libflite.a&#40;audio.o&#41;&#58; In function `audio_drain'&#58;
audio.c&#58;&#40;.text+0x20&#41;&#58; undefined reference to `audio_drain_none'
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libflite.a&#40;audio.o&#41;&#58; In function `audio_write'&#58;
audio.c&#58;&#40;.text+0x3ec&#41;&#58; undefined reference to `audio_write_none'
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libflite.a&#40;audio.o&#41;&#58; In function `audio_close'&#58;
audio.c&#58;&#40;.text+0x4d8&#41;&#58; undefined reference to `audio_close_none'
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libflite.a&#40;audio.o&#41;&#58; In function `audio_open'&#58;
audio.c&#58;&#40;.text+0x4f8&#41;&#58; undefined reference to `audio_open_none'
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libflite.a&#40;audio.o&#41;&#58; In function `play_wave_sync'&#58;
audio.c&#58;&#40;.text+0x6e8&#41;&#58; undefined reference to `audio_flush_none'
collect2&#58; ld returned 1 exit status
make&#58; *** &#91;exflite.elf&#93; Error 1

thanks for any help :~)
mypspdev
Posts: 178
Joined: Wed Jul 11, 2007 10:30 pm

Post by mypspdev »

It works in my environment.... I've to check, as well as we share sorces by MP may be best way to communicate is via MP....
Did you recompiled libflite?
1st step: let try using the libflite I send into the package
2st step: let try to recompile libflite using makefile and evironment I sent
....
Last edited by mypspdev on Sun Oct 18, 2009 4:02 am, edited 1 time in total.
whistler
Posts: 39
Joined: Tue Mar 04, 2008 7:08 am

Post by whistler »

a cursory grep of the source makes me believe all those audio_xxxxx_none should have resolved to audio_xxxx_psp

though i'm probably wrong:)
mypspdev
Posts: 178
Joined: Wed Jul 11, 2007 10:30 pm

Post by mypspdev »

whistler wrote:a cursory grep of the source makes me believe all those audio_xxxxx_none should have resolved to audio_xxxx_psp

though i'm probably wrong:)
Of course to compile libflite.a you should use the makefile as it is and
/src/audio/psp/au_psp.c
do not use
/src/audio/au_none.c
ok?
whistler
Posts: 39
Joined: Tue Mar 04, 2008 7:08 am

Post by whistler »

Code: Select all

TARGET_LIB = libflite.a

OBJS =          ./src/audio/au_command.o \
                ./src/audio/audio.o \
                ./src/audio/psp/au_psp.o \
                ./src/hrg/cst_ffeature.o \
                ./src/hrg/cst_item.o \
                ./src/hrg/cst_rel_io.o \
                ./src/hrg/cst_relation.o \
                ./src/hrg/cst_utterance.o \
                ./src/lexicon/cst_lexicon.o \
                ./src/lexicon/cst_lts.o \
                ./src/lexicon/cst_lts_rewrites.o \
                ./src/regex/cst_regex.o \
                ./src/regex/regexp.o \
                ./src/regex/regsub.o \
                ./src/speech/cst_wave.o \
                ./src/speech/cst_wave_io.o \
                ./src/speech/cst_track.o \
                ./src/speech/cst_track_io.o \
                ./src/speech/cst_lpcres.o \
                ./src/speech/cst_wave_utils.o \
                ./src/speech/rateconv.o \
                ./src/stats/cst_cart.o \
                ./src/stats/cst_ss.o \
                ./src/stats/cst_viterbi.o \
                ./src/synth/cst_phoneset.o \
                ./src/synth/cst_synth.o \
                ./src/synth/cst_utt_utils.o \
                ./src/synth/cst_voice.o \
                ./src/synth/flite.o \
                ./src/utils/cst_alloc.o \
                ./src/utils/cst_args.o \
                ./src/utils/cst_endian.o \
                ./src/utils/cst_error.o \
                ./src/utils/cst_features.o \
                ./src/utils/psp/cst_file_psp.o \
                ./src/utils/cst_socket.o \
                ./src/utils/cst_string.o \
                ./src/utils/cst_tokenstream.o \
                ./src/utils/cst_val.o \
                ./src/utils/cst_val_const.o \
                ./src/utils/cst_val_user.o \
                ./src/utils/cst_mmap_none.o \
                ./src/wavesynth/cst_clunits.o \
                ./src/wavesynth/cst_diphone.o \
                ./src/wavesynth/cst_reflpc.o \
                ./src/wavesynth/cst_sigpr.o \
                ./src/wavesynth/cst_sigprFP.o \
                ./src/wavesynth/cst_sts.o \
                ./src/wavesynth/cst_units.o \
                ./lang/cmulex/cmu_lex.o \
                ./lang/cmulex/cmu_lex_data.o \
                ./lang/cmulex/cmu_lts_model.o \
                ./lang/cmulex/cmu_lex_entries.o \
                ./lang/cmulex/cmu_lts_rules.o \
                                ./lang/cmu_time_awb/cmu_time_awb.o \
                                ./lang/cmu_time_awb/cmu_time_awb_cart.o \
                                ./lang/cmu_time_awb/cmu_time_awb_clunits.o \
                                ./lang/cmu_time_awb/cmu_time_awb_lex_entry.o \
                                ./lang/cmu_time_awb/cmu_time_awb_lpc.o \
                                ./lang/cmu_time_awb/cmu_time_awb_mcep.o \
                           ./lang/usenglish/us_aswd.o \
                           ./lang/usenglish/us_dur_stats.o \
                           ./lang/usenglish/us_durz_cart.o \
                           ./lang/usenglish/us_expand.o \
                           ./lang/usenglish/us_f0_model.o \
                           ./lang/usenglish/us_f0lr.o \
                           ./lang/usenglish/us_ffeatures.o \
                           ./lang/usenglish/us_gpos.o \
                           ./lang/usenglish/us_int_accent_cart.o \
                           ./lang/usenglish/us_int_tone_cart.o \
                           ./lang/usenglish/us_nums_cart.o \
                           ./lang/usenglish/us_phoneset.o \
                           ./lang/usenglish/us_phrasing_cart.o \
                           ./lang/usenglish/us_postlex.o \
                           ./lang/usenglish/us_text.o \
                           ./lang/usenglish/usenglish.o \
                       ./lang/cmu_us_kal/cmu_us_kal.o \
                       ./lang/cmu_us_kal/cmu_us_kal_diphone.o \
                       ./lang/cmu_us_kal/cmu_us_kal_lpc.o \
                       ./lang/cmu_us_kal/cmu_us_kal_res.o \
                       ./lang/cmu_us_kal/cmu_us_kal_residx.o \
                         ./lang/cmu_us_kal16/cmu_us_kal16.o \
                         ./lang/cmu_us_kal16/cmu_us_kal16_diphone.o \
                         ./lang/cmu_us_kal16/cmu_us_kal16_lpc.o \
                         ./lang/cmu_us_kal16/cmu_us_kal16_res.o \
                         ./lang/cmu_us_kal16/cmu_us_kal16_residx.o 

INCDIR = ./inc
 
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $&#40;CFLAGS&#41; -DCST_AUDIO_PSP -fno-exceptions -fno-rtti
ASFLAGS = $&#40;CFLAGS&#41;

LIBDIR =
LDFLAGS =

PSPSDK=$&#40;shell psp-config --pspsdk-path&#41;
include $&#40;PSPSDK&#41;/lib/build.mak
Obviously i've not changed the makefile in any way. Thats my point whats causing it to use the audio_XXXX_none functions. i can see that CST_AUDIO_PSP has been defined in the makefile so the functions should be resolved to audio_xxxxx_psp.

btw i''ve tried compiling it myself and i've tried using the libflite.a and includes that you've sent.

At this point i could do with a small example and makefile that is known to compile coz i can't see any problems with the simple example i posted. Could you test the example code and makefile that i posted (its a few posts up) and see if it compiles and runs on your machine?

Thanks for persevering with this:)
mypspdev
Posts: 178
Joined: Wed Jul 11, 2007 10:30 pm

Post by mypspdev »

Have a look at
/src/audio/native_audio.h, the right version
and let delete /inc/native_audio.h the original version.

The right initialization of the Audio Platform is the following:

#define AUDIO_OPEN_NATIVE audio_open_psp

#define AUDIO_CLOSE_NATIVE audio_close_psp

#define AUDIO_SET_SAMPLE_RATE_NATIVE audio_set_sample_rate_none

#define AUDIO_WRITE_NATIVE audio_write_psp

#define AUDIO_DRAIN_NATIVE audio_drain_psp

#define AUDIO_FLUSH_NATIVE audio_flush_psp

having added and prepared
au_psp.c with those functions.

Within the package I collected all needed Headers into /inc, including the original native_audio.h which is wrong.

Be sure only one native_audio.h with the right psp #define is used.

Best way is to rearrange to be included Headers, may be you can prepare final package of psp_flite.

Let use also pspAudioInit();

bye bye
Post Reply