0

I tried the C example in the documentation, but I can't make it work. I am not sure what files do I need in the include and lib directories and how to set the FLITEDIR variable because I am using Windows 8.1 and VS2015. In example:

gcc -Wall -g -o flite_test flite_test.c -I$FLITEDIR/include -L$FLITEDIR/lib -lflite_cmu_us_kal -lflite_usenglish -lflite_cmulex -lflite -lm

I tried

gcc -Wall -g -o flite_test flite_test.c -IE:\flite\include -LE:\flite\lib -lflite_cmu_us_kal -lflite_usenglish -lflite_cmulex -lflite -lm

I built the flite vcxproj for Release and I got an fliteDll.pdb file and some cmu.obj files. I also buit the project for Debug and I got a flite.lib and cst.obj files. I am a beginner programmer. Can you tell me what to do?

Nikolay Shmyrev
  • 24,897
  • 5
  • 43
  • 87

1 Answers1

0

gcc is for Linux, you simply need to follow Windows build process:

  1. Create a VS2015 project
  2. Add C code flite_test.c into it
  3. In project properties add include path to flite libraries
  4. In project properties in linker configure linking to flite.lib
  5. Compile VS2015 project and run

For more details see the walkthrough on creating and using DLL libraries in Visual Studio

Nikolay Shmyrev
  • 24,897
  • 5
  • 43
  • 87
  • I will get back after I try this. Do you know why it didn't generated an flite dll file ? Thankyou very much for your help. – warriorforce Aug 20 '18 at 21:16
  • Maybe only static build enabled in vcproj, you can change that yourself – Nikolay Shmyrev Aug 21 '18 at 06:22
  • I get errors lnk 2019. Have you tried to do this before, it works ? – warriorforce Aug 21 '18 at 21:17
  • Yes, I tried it before, yes, it works. If you need help on specific errors you need to provide more information about them. – Nikolay Shmyrev Aug 21 '18 at 21:45
  • Thankyou, I get the following errors : `E:\utaloids\flite\project\project.vcxproj" (default target) (1) ->(Link target) ->flite_test.obj : error LNK2019: unresolved external symbol _new_voice referenced in function _main [E:\utaloids\flite\project\project.vcxproj] flite_test.obj : error LNK2019: unresolved external symbol _flite_init referenced in function _main [E:\utaloids\flite\project\project.vcxproj]` – warriorforce Aug 22 '18 at 13:08
  • I've fixed the errors, now I get this "tried to access lexicon in -1 type val flite" like this guy says https://stackoverflow.com/questions/28403734/flite-tts-demo-fails-to-run – warriorforce Aug 22 '18 at 16:21
  • Ok, so you can close this issue then – Nikolay Shmyrev Aug 22 '18 at 17:04
  • Ok, what is inside your flite_test.c then? – Nikolay Shmyrev Aug 22 '18 at 17:43
  • `#include "..\\include\\flite.h" cst_voice *register_cmu_us_kal(); int main(int argc, char **argv) { cst_voice *v; if (argc != 2) { fprintf(stderr, "usage: flite_test FILE\n"); exit(-1); } flite_init(); v = new_voice(); flite_text_to_speech("This is a test",v,"play"); return 0; }` – warriorforce Aug 22 '18 at 19:07
  • Recent flite documentation has slightly different example: http://www.festvox.org/flite/doc/flite_7.html#C-example – Nikolay Shmyrev Aug 22 '18 at 23:06
  • Hi, I have fixed thsi problem but there is no audio output. Any idea why? – warriorforce Sep 06 '18 at 11:18