Search Results

Search found 436 results on 18 pages for 'speech'.

Page 6/18 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • How to use Festival Text To Speech C/C++ API

    - by Peeyush
    I want to use Festival TTS with my C++ programme. So i have downloaded all files form http://www.cstr.ed.ac.uk/downloads/festival/2.0.95/ then i start reading manual(http://www.cstr.ed.ac.uk/projects/festival/manual/festival_28.html) for C++ API but in manual they says that: In order to use Festival you must include festival/src/include/festival.h' which in turn will include the necessary other include files infestival/src/include' and speech_tools/include' you should ensure these are included in the include path for you your program. Also you will need to link your program withfestival/src/lib/libFestival.a', speech_tools/lib/libestools.a',speech_tools/lib/libestbase.a' and `speech_tools/lib/libeststring.a' as well as any other optional libraries such as net audio. " I am using UBUNTU 10.04(festival package is by default installed and i can use it form terminal by festival command) and GCC 4.4.3 but the problem is that i am new to GCC and i am not understanding which files i have to include in order to run my C++ code and i also don't know how to link libraries with my c++ code. So please tell me exactly which files i have to include and how to link with libraries if anyone already use festival tts with c++ then please post your code Thanks

    Read the article

  • "SpeechHypothesized event not raised"

    - by Jankhana
    Hi all, I need to detect the user voice when they pick-up the reciever on the other end. Because Modems usually start playing files (playback terminal) when the first ring goes there. So I planned to use speech recognition when they say "hello", it can start playing the file until wait for playing file. Or even any noise interference it can start speak. I accomplished this with few settings. I found few common words that my engine detects when we speak and the words that comes when it's ringing. It works fine as a stand alone application but if I try to integrate this with my application it just does not raises "SpeechHypothesized" event. I cant understand why this happens. If i see using a break point, the engine is having the delegate assign and invocation property also is initialized properly but than to is doesn't call the event. For calling I'm using C4F tapi manager and for speech recognition i'm using System.Speech library of .Net 3.5. The code for events is as follows : engine.SpeechDetected += new EventHandler<SpeechDetectedEventArgs>(engine_SpeechDetected); engine.SpeechRecognized += new EventHandler<SpeechRecognizedEventArgs>(engine_SpeechRecognized); engine.SpeechHypothesized+=new EventHandler<SpeechHypothesizedEventArgs> (engine_SpeechHypothesized); engine.SpeechRecognitionRejected += new EventHandler<SpeechRecognitionRejectedEventArgs>(engine_SpeechRecognitionRejected); All event's are raised except the speechhypothesized event. Any idea why this happens ????

    Read the article

  • Howto access thread data outside a thread

    - by Quandary
    Question: I start the MS Text-to-speech engine in a thread, in order to avoid a crash on DLL_attach. It starts fine, and the text to speech engine gets initialized, but I can't access ISpVoice outside the thread. How can I access ISpVoice outside the thread ? It's a global variable after all... #include <windows.h> #include <sapi.h> #include "XPThreads.h" ISpVoice * pVoice = NULL; unsigned long init_engine_thread(void* param) { Sleep(5000); printf("lolthread\n"); //HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED); HRESULT hr = CoInitialize(NULL); if(FAILED(hr) ) { MessageBox(NULL, TEXT("Failed To Initialize"), TEXT("Error"), 0); char buffer[2000] ; sprintf(buffer, "An error occured: 0x%08X.\n", hr); FILE * pFile = fopen ( "c:\\temp\\CoInitialize_dll.txt" , "w" ); fwrite (buffer , 1 , strlen(buffer) , pFile ); fclose (pFile); } else { printf("trying to create instance.\n"); //HRESULT hr = CoCreateInstance(CLSID_SpVoice, NULL, CLSCTX_ALL, IID_ISpVoice, (void **) &pVoice); //hr = CoCreateInstance(CLSID_SpVoice, NULL, CLSCTX_ALL, IID_ISpVoice, (void **) &pVoice); //HRESULT hr = CoCreateInstance(__uuidof(ISpVoice), NULL, CLSCTX_INPROC_SERVER, IID_ISpVoice, (void **) &pVoice); HRESULT hr = CoCreateInstance(__uuidof(SpVoice), NULL, CLSCTX_ALL, IID_ISpVoice, (void **) &pVoice); if( SUCCEEDED( hr ) ) { printf("Succeeded\n"); hr = pVoice->Speak(L"The text to speech engine has been successfully initialized.", 0, NULL); } else { printf("failed\n"); MessageBox(NULL, TEXT("Failed To Create COM instance"), TEXT("Error"), 0); char buffer[2000] ; sprintf(buffer, "An error occured: 0x%08X.\n", hr); FILE * pFile = fopen ( "c:\\temp\\CoCreateInstance_dll.txt" , "w" ); fwrite (buffer , 1 , strlen(buffer) , pFile ); fclose (pFile); } } if(pVoice != NULL) { pVoice->Release(); pVoice = NULL; } CoUninitialize(); return NULL; } XPThreads* ptrThread = new XPThreads(init_engine_thread); BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: //init_engine(); LoadLibrary(TEXT("ole32.dll")); ptrThread->Run(); break; case DLL_THREAD_ATTACH: break; case DLL_THREAD_DETACH: break; case DLL_PROCESS_DETACH: break; } return TRUE; }

    Read the article

  • "Voice trigger" detection

    - by sehugg
    I have a voice application that would be much-improved if there was the ability to use a "trigger word" to start recording audio. I don't need a full speech-text engine, just the ability to reliably/efficiently detect the trigger word. I am wondering if there are any specialized speech engines that support this specific use case, or any libraries/methods to developing such a single-purpose detection engine. Ideally I'd like it to work in noisy environments, but it can be trained for a single user's voice. Pointers to research papers / topics would also be appreciated so I know what to ask for.

    Read the article

  • Looking for software to read PDFs/web pages aloud on OS X

    - by Clinton Blackmore
    I am looking for software that will read PDFs and web pages aloud for me under OS X 10.5, preferably something that is free. I am aware that you can make your Mac read to you by pressing a key combination. It is pretty slick, but I really want something that: will allow me to say, "Read this document" and let me skip paragraphs and pause (instead of simply stopping and then restarting from the beginning) will allow me to skip things that aren't relevant, like page headers, footers, and side bars. will allow me to rewind and listen to something again (either to think on it more deeply, or to understand what the text-to-speech engine was trying to say) for a pdf with text in two columns, will let me read just one column at a time. (Right now if I make a selection, it gets both columns and reads from one and then from another. If I could just select one column and read it, I'd be happier. [IIRC, Apple improved things in Snow Leopard so you can select one column in a pdf.]) I don't really expect one program to do both pdfs and web pages, but it would be nice.

    Read the article

  • Does Android Speech Synthesis do no work for HTC Dream firmware version 1.6 build DRD20 ?

    - by mob-king
    I have a HTC Dream firmware version 1.6 build DRD20. I am unable to install voice data in Menu == Settings == Speech Synthesis == Install voice data. The option just brings me back to previous screen of settings. I also tried installing Speech Synthesis Data Installer and many other applications for text to speech. But none works and give back Sorry! Force close error. Is there any way by which I can install voice data ? Or any way I can use text to speech ? Can anyone also tell what is latest offical firmware available for this mobile ?

    Read the article

  • Does Android Speech Synthesis do not work for HTC Dream firmware version 1.6 build DRD20 ?

    - by mob-king
    I have a HTC Dream firmware version 1.6 build DRD20. I am unable to install voice data in Menu == Settings == Speech Synthesis == Install voice data. The option just brings me back to previous screen of settings. I also tried installing Speech Synthesis Data Installer and many other applications for text to speech. But none works and give back Sorry! Force close error. Is there any way by which I can install voice data ? Or any way I can use text to speech ? Can anyone also tell what is latest offical firmware available for this mobile ?

    Read the article

  • What is the most inspiring speech from a developer you ever watched? [closed]

    - by user2567
    Please put a direct link to it. Required: Still available online (please put a direct link to it) Must be a speech from a current or former developer Speaker's popularity doesn't matter Target audience should be other developers It is not required that the topic is programming (the task). I'm more looking for subject generally developing here within P.SE rather than SO. Explain why it was inspiring (please, native english speaker, edit my question)

    Read the article

  • Cannot call SAPI from dll

    - by Quandary
    Question: The below code works fine as long as it is in an executable. It uses the msft (text-to-)speech API (SAPI). But as soon as I put it in a dll and load it with loadlibrary from an executable, it doesn't work. I've also tried to change CoInitialize(NULL); to CoInitializeEx(NULL,COINIT_MULTITHREADED); and I tried with all possible flags ( COINIT_APARTMENTTHREADED, COINIT_MULTITHREADED, COINIT_DISABLE_OLE1DDE, COINIT_SPEED_OVER_MEMORY) But it's always stuck at hr = CoCreateInstance(__uuidof(SpVoice), NULL, CLSCTX_INPROC_SERVER, IID_ISpVoice, (void **) &pVoice); I also tried those flags here: CLSCTX_INPROC_SERVER,CLSCTX_SERVER, CLSCTX_ALL, but nothing seems to help... There are no errors, it doesn't crash, it just sleeps forever at CoCreateInstance... This is the code as single exe (working) #include <windows.h> #include <sapi.h> #include <iostream> #include <cstdlib> int main(int argc, char* argv[]) { ISpVoice * pVoice = NULL; //CoInitializeEx(NULL,COINIT_MULTITHREADED); HRESULT hr = CoInitialize(NULL); if( FAILED(hr) ) { MessageBox(NULL, TEXT("Failed To Initialize"), TEXT("Error"),0); printf("Failed!\n"); char buffer[2000] ; sprintf(buffer, "An error occured: 0x%08X.\n", hr); FILE * pFile = fopen ( "c:\\temp\\CoInitialize_exe.txt" , "w" ); fwrite (buffer , 1 , sizeof(buffer) , pFile ); fclose (pFile); } else { //CoGetClassObject(CLSID_SpVoice, CLSCTX_INPROC_SERVER, NULL, IID_IClassFactory, (void**) &pClsF); //hr = CoGetClassObject(CLSID_SpVoice, CLSCTX_INPROC_SERVER, NULL, IID_IClassFactory, (void**) &pClsF); hr = CoCreateInstance(__uuidof(SpVoice), NULL, CLSCTX_INPROC_SERVER, IID_ISpVoice, (void **) &pVoice); //HRESULT hr = CoCreateInstance(CLSID_SpVoice, NULL, CLSCTX_ALL, IID_ISpVoice, (void **) &pVoice); if( SUCCEEDED( hr ) ) { hr = pVoice->Speak(L"Test Test", 0, NULL); hr = pVoice->Speak(L"This sounds normal <pitch middle = '-10'/> but the pitch drops half way through", SPF_IS_XML, NULL ); pVoice->Release(); pVoice = NULL; } else { MessageBox(NULL, TEXT("Failed To Create a COM instance..."), TEXT("Error"),0); char buffer[2000] ; sprintf(buffer, "An error occured: 0x%08X.\n", hr); FILE * pFile = fopen ( "c:\\temp\\CoCreateInstance_exe.txt" , "w" ); fwrite (buffer , 1 , sizeof(buffer) , pFile ); fclose (pFile); } } CoUninitialize(); return EXIT_SUCCESS; } This is the exe loading the dll (stays forever at printf("trying to create instance.\n"); ) #include <windows.h> #include <sapi.h> #include <iostream> #include <cstdlib> int main(int argc, char* argv[]) { // C:\Windows\System32\Speech\Common\sapi.dll //LoadLibraryA("sapi.dll"); LoadLibraryA("Sapidll2.dll"); return EXIT_SUCCESS; // Frankly, that would be nice... } And this is Sapidll2.dll // dllmain.cpp : Defines the entry point for the DLL application. #include "stdafx.h" #include <iostream> #include <cstdlib> #include <string> #include <windows.h> #include <sapi.h> int init_engine() { ISpVoice * pVoice = NULL; //HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED); HRESULT hr = CoInitialize(NULL); if(FAILED(hr) ) { MessageBox(NULL, TEXT("Failed To Initialize"), TEXT("Error"), 0); char buffer[2000] ; sprintf(buffer, "An error occured: 0x%08X.\n", hr); FILE * pFile = fopen ( "c:\\temp\\CoInitialize_dll.txt" , "w" ); fwrite (buffer , 1 , strlen(buffer) , pFile ); fclose (pFile); } else { printf("trying to create instance.\n"); //HRESULT hr = CoCreateInstance(CLSID_SpVoice, NULL, CLSCTX_ALL, IID_ISpVoice, (void **) &pVoice); //hr = CoCreateInstance(CLSID_SpVoice, NULL, CLSCTX_ALL, IID_ISpVoice, (void **) &pVoice); //HRESULT hr = CoCreateInstance(__uuidof(ISpVoice), NULL, CLSCTX_INPROC_SERVER, IID_ISpVoice, (void **) &pVoice); HRESULT hr = CoCreateInstance(__uuidof(SpVoice), NULL, CLSCTX_ALL, IID_ISpVoice, (void **) &pVoice); if( SUCCEEDED( hr ) ) { printf("Succeeded\n"); //hr = pVoice->Speak(L"The text to speech engine has been successfully initialized.", 0, NULL); } else { printf("failed\n"); MessageBox(NULL, TEXT("Failed To Create COM instance"), TEXT("Error"), 0); char buffer[2000] ; sprintf(buffer, "An error occured: 0x%08X.\n", hr); FILE * pFile = fopen ( "c:\\temp\\CoCreateInstance_dll.txt" , "w" ); fwrite (buffer , 1 , strlen(buffer) , pFile ); fclose (pFile); } } if(pVoice != NULL) { pVoice->Release(); pVoice = NULL; } CoUninitialize(); return true ; } BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: init_engine(); break; case DLL_THREAD_ATTACH: case DLL_THREAD_DETACH: case DLL_PROCESS_DETACH: break; } return TRUE; }

    Read the article

  • Getting started with Festival on iphone

    - by Moshe
    I'd like to use Festival in an iPhone app. Is this possible, considering the way Festival generates and then plays back audio files? Can I pass Festival an audio file directly from itself to play back? or is there a different way to read things? Is there another Text-to-speech engine for C/C++ to use with iphone?

    Read the article

  • Reading Source Code Aloud

    - by Jon Purdy
    After seeing this question, I got to thinking about the various challenges that blind programmers face, and how some of them are applicable even to sighted programmers. Particularly, the problem of reading source code aloud gives me pause. I have been programming for most of my life, and I frequently tutor fellow students in programming, most often in C++ or Java. It is uniquely aggravating to try to verbally convey the essential syntax of a C++ expression. The speaker must give either an idiomatic translation into English, or a full specification of the code in verbal longhand, using explicit yet slow terms such as "opening parenthesis", "bitwise and", et cetera. Neither of these solutions is optimal. On the one hand, an idiomatic translation is only useful to a programmer who can de-translate back into the relevant programming code—which is not usually the case when tutoring a student. In turn, education (or simply getting someone up to speed on a project) is the most common situation in which source is read aloud, and there is a very small margin for error. On the other hand, a literal specification is aggravatingly slow. It takes far far longer to say "pound, include, left angle bracket, iostream, right angle bracket, newline" than it does to simply type #include <iostream>. Indeed, most experienced C++ programmers would read this merely as "include iostream", but again, inexperienced programmers abound and literal specifications are sometimes necessary. So I've had an idea for a potential solution to this problem. In C++, there is a finite set of keywords—63—and operators—54, discounting named operators and treating compound assignment operators and prefix versus postfix auto-increment and decrement as distinct. There are just a few types of literal, a similar number of grouping symbols, and the semicolon. Unless I'm utterly mistaken, that's about it. So would it not then be feasible to simply ascribe a concise, unique pronunciation to each of these distinct concepts (including one for whitespace, where it is required) and go from there? Programming languages are far more regular than natural languages, so the pronunciation could be standardised. Speakers of any language would be able to verbally convey C++ code, and due to the regularity and fixity of the language, speech-to-text software could be optimised to accept C++ speech with a high degree of accuracy. So my question is twofold: first, is my solution feasible; and second, does anyone else have other potential solutions? I intend to take suggestions from here and use them to produce a formal paper with an example implementation of my solution.

    Read the article

  • What is voice xml?

    - by Kullpu
    While looking for a way to use speech recognition with flash I crossed paths with voice xml. I've gone through the wc3 description of it but still I got a few big doubts. Can I simply create a vxml doc and place it on my webserver? what are the requirements? Will it work? Can I input with a microphone over the internet? I cant seem to find a direct answer to it.

    Read the article

  • Espeak SAPI/dll usage on Windows ?

    - by Quandary
    Question: I am trying to use the espeak text-to-speech engine. So for I got it working wounderfully on linux (code below). Now I wanted to port this basic program to windows, too, but it's nearly impossible... Part of the problem is that the windows dll only allows for AUDIO_OUTPUT_SYNCHRONOUS, which means it requires a callback, but I can't figure out how to play the audio from the callback... First it crashed, then I realized, I need a callback function, now I get the data in the callback function, but I don't know how to play it... as it is neither a wav file nor plays automatically as on Linux. The sourceforge site is rather useless, because it basically says use the SAPI version, but then there is no example on how to use the sapi espeak dll... Anyway, here's my code, can anybody help? #ifdef __cplusplus #include <cstdio> #include <cstdlib> #include <cstring> else #include <stdio.h> #include <stdlib.h> #include <string.h> endif include include //#include "speak_lib.h" include "espeak/speak_lib.h" // libespeak-dev: /usr/include/espeak/speak_lib.h // apt-get install libespeak-dev // apt-get install libportaudio-dev // g++ -o mine mine.cpp -lespeak // g++ -o mine mine.cpp -I/usr/include/espeak/ -lespeak // gcc -o mine mine.cpp -I/usr/include/espeak/ -lespeak char voicename[40]; int samplerate; int quiet = 0; static char genders[4] = {' ','M','F',' '}; //const char *data_path = "/usr/share/"; // /usr/share/espeak-data/ const char *data_path = NULL; // use default path for espeak-data int strrcmp(const char *s, const char *sub) { int slen = strlen(s); int sublen = strlen(sub); return memcmp(s + slen - sublen, sub, sublen); } char * strrcpy(char *dest, const char *source) { // Pre assertions assert(dest != NULL); assert(source != NULL); assert(dest != source); // tk: parentheses while((*dest++ = *source++)) ; return(--dest); } const char* GetLanguageVoiceName(const char* pszShortSign) { #define LANGUAGE_LENGTH 30 static char szReturnValue[LANGUAGE_LENGTH] ; memset(szReturnValue, 0, LANGUAGE_LENGTH); for (int i = 0; pszShortSign[i] != '\0'; ++i) szReturnValue[i] = (char) tolower(pszShortSign[i]); const espeak_VOICE **voices; espeak_VOICE voice_select; voices = espeak_ListVoices(NULL); const espeak_VOICE *v; for(int ix=0; (v = voices[ix]) != NULL; ix++) { if( !strrcmp( v->languages, szReturnValue) ) { strcpy(szReturnValue, v->name); return szReturnValue; } } // End for strcpy(szReturnValue, "default"); return szReturnValue; } // End function getvoicename void ListVoices() { const espeak_VOICE **voices; espeak_VOICE voice_select; voices = espeak_ListVoices(NULL); const espeak_VOICE *v; for(int ix=0; (v = voices[ix]) != NULL; ix++) { printf("Shortsign: %s\n", v->languages); printf("age: %d\n", v->age); printf("gender: %c\n", genders[v->gender]); printf("name: %s\n", v->name); printf("\n\n"); } // End for } // End function getvoicename int main() { printf("Hello World!\n"); const char* szVersionInfo = espeak_Info(NULL); printf("Espeak version: %s\n", szVersionInfo); samplerate = espeak_Initialize(AUDIO_OUTPUT_PLAYBACK,0,data_path,0); strcpy(voicename, "default"); // espeak --voices strcpy(voicename, "german"); strcpy(voicename, GetLanguageVoiceName("DE")); if(espeak_SetVoiceByName(voicename) != EE_OK) { printf("Espeak setvoice error...\n"); } static char word[200] = "Hello World" ; strcpy(word, "TV-fäns aufgepasst, es ist 20 Uhr 15. Zeit für Rambo 3"); strcpy(word, "Unnamed Player wurde zum Opfer von GSG9"); int speed = 220; int volume = 500; // volume in range 0-100 0=silence int pitch = 50; // base pitch, range 0-100. 50=normal // espeak.cpp 625 espeak_SetParameter(espeakRATE, speed, 0); espeak_SetParameter(espeakVOLUME,volume,0); espeak_SetParameter(espeakPITCH,pitch,0); // espeakRANGE: pitch range, range 0-100. 0-monotone, 50=normal // espeakPUNCTUATION: which punctuation characters to announce: // value in espeak_PUNCT_TYPE (none, all, some), espeak_VOICE *voice_spec = espeak_GetCurrentVoice(); voice_spec->gender=2; // 0=none 1=male, 2=female, //voice_spec->age = age; espeak_SetVoiceByProperties(voice_spec); espeak_Synth( (char*) word, strlen(word)+1, 0, POS_CHARACTER, 0, espeakCHARS_AUTO, NULL, NULL); espeak_Synchronize(); strcpy(voicename, GetLanguageVoiceName("EN")); espeak_SetVoiceByName(voicename); strcpy(word, "Geany was fragged by GSG9 Googlebot"); strcpy(word, "Googlebot"); espeak_Synth( (char*) word, strlen(word)+1, 0, POS_CHARACTER, 0, espeakCHARS_AUTO, NULL, NULL); espeak_Synchronize(); espeak_Terminate(); printf("Espeak terminated\n"); return EXIT_SUCCESS; } /* if(espeak_SetVoiceByName(voicename) != EE_OK) { memset(&voice_select,0,sizeof(voice_select)); voice_select.languages = voicename; if(espeak_SetVoiceByProperties(&voice_select) != EE_OK) { fprintf(stderr,"%svoice '%s'\n",err_load,voicename); exit(2); } } */ The above code is for Linux. The below code is about as far as I got on Vista x64 (32 bit emu): #ifdef __cplusplus #include <cstdio> #include <cstdlib> #include <cstring> else #include <stdio.h> #include <stdlib.h> #include <string.h> endif include include include "speak_lib.h" //#include "espeak/speak_lib.h" // libespeak-dev: /usr/include/espeak/speak_lib.h // apt-get install libespeak-dev // apt-get install libportaudio-dev // g++ -o mine mine.cpp -lespeak // g++ -o mine mine.cpp -I/usr/include/espeak/ -lespeak // gcc -o mine mine.cpp -I/usr/include/espeak/ -lespeak char voicename[40]; int iSampleRate; int quiet = 0; static char genders[4] = {' ','M','F',' '}; //const char *data_path = "/usr/share/"; // /usr/share/espeak-data/ //const char *data_path = NULL; // use default path for espeak-data const char *data_path = "C:\Users\Username\Desktop\espeak-1.43-source\espeak-1.43-source\"; int strrcmp(const char *s, const char *sub) { int slen = strlen(s); int sublen = strlen(sub); return memcmp(s + slen - sublen, sub, sublen); } char * strrcpy(char *dest, const char *source) { // Pre assertions assert(dest != NULL); assert(source != NULL); assert(dest != source); // tk: parentheses while((*dest++ = *source++)) ; return(--dest); } const char* GetLanguageVoiceName(const char* pszShortSign) { #define LANGUAGE_LENGTH 30 static char szReturnValue[LANGUAGE_LENGTH] ; memset(szReturnValue, 0, LANGUAGE_LENGTH); for (int i = 0; pszShortSign[i] != '\0'; ++i) szReturnValue[i] = (char) tolower(pszShortSign[i]); const espeak_VOICE **voices; espeak_VOICE voice_select; voices = espeak_ListVoices(NULL); const espeak_VOICE *v; for(int ix=0; (v = voices[ix]) != NULL; ix++) { if( !strrcmp( v->languages, szReturnValue) ) { strcpy(szReturnValue, v->name); return szReturnValue; } } // End for strcpy(szReturnValue, "default"); return szReturnValue; } // End function getvoicename void ListVoices() { const espeak_VOICE **voices; espeak_VOICE voice_select; voices = espeak_ListVoices(NULL); const espeak_VOICE *v; for(int ix=0; (v = voices[ix]) != NULL; ix++) { printf("Shortsign: %s\n", v->languages); printf("age: %d\n", v->age); printf("gender: %c\n", genders[v->gender]); printf("name: %s\n", v->name); printf("\n\n"); } // End for } // End function getvoicename /* Callback from espeak. Directly speaks using AudioTrack. */ define LOGI(x) printf("%s\n", x) static int AndroidEspeakDirectSpeechCallback(short *wav, int numsamples, espeak_EVENT *events) { char buf[100]; sprintf(buf, "AndroidEspeakDirectSpeechCallback: %d samples", numsamples); LOGI(buf); if (wav == NULL) { LOGI("Null: speech has completed"); } if (numsamples > 0) { //audout->write(wav, sizeof(short) * numsamples); sprintf(buf, "AudioTrack wrote: %d bytes", sizeof(short) * numsamples); LOGI(buf); } return 0; // continue synthesis (1 is to abort) } static int AndroidEspeakSynthToFileCallback(short *wav, int numsamples,espeak_EVENT *events) { char buf[100]; sprintf(buf, "AndroidEspeakSynthToFileCallback: %d samples", numsamples); LOGI(buf); if (wav == NULL) { LOGI("Null: speech has completed"); } // The user data should contain the file pointer of the file to write to //void* user_data = events->user_data; FILE* user_data = fopen ( "myfile1.wav" , "ab" ); FILE* fp = static_cast<FILE *>(user_data); // Write all of the samples fwrite(wav, sizeof(short), numsamples, fp); return 0; // continue synthesis (1 is to abort) } int main() { printf("Hello World!\n"); const char* szVersionInfo = espeak_Info(NULL); printf("Espeak version: %s\n", szVersionInfo); iSampleRate = espeak_Initialize(AUDIO_OUTPUT_SYNCHRONOUS, 4096, data_path, 0); if (iSampleRate <= 0) { printf("Unable to initialize espeak"); return EXIT_FAILURE; } //samplerate = espeak_Initialize(AUDIO_OUTPUT_PLAYBACK,0,data_path,0); //ListVoices(); strcpy(voicename, "default"); // espeak --voices //strcpy(voicename, "german"); //strcpy(voicename, GetLanguageVoiceName("DE")); if(espeak_SetVoiceByName(voicename) != EE_OK) { printf("Espeak setvoice error...\n"); } static char word[200] = "Hello World" ; strcpy(word, "TV-fäns aufgepasst, es ist 20 Uhr 15. Zeit für Rambo 3"); strcpy(word, "Unnamed Player wurde zum Opfer von GSG9"); int speed = 220; int volume = 500; // volume in range 0-100 0=silence int pitch = 50; // base pitch, range 0-100. 50=normal // espeak.cpp 625 espeak_SetParameter(espeakRATE, speed, 0); espeak_SetParameter(espeakVOLUME,volume,0); espeak_SetParameter(espeakPITCH,pitch,0); // espeakRANGE: pitch range, range 0-100. 0-monotone, 50=normal // espeakPUNCTUATION: which punctuation characters to announce: // value in espeak_PUNCT_TYPE (none, all, some), //espeak_VOICE *voice_spec = espeak_GetCurrentVoice(); //voice_spec->gender=2; // 0=none 1=male, 2=female, //voice_spec->age = age; //espeak_SetVoiceByProperties(voice_spec); //espeak_SetSynthCallback(AndroidEspeakDirectSpeechCallback); espeak_SetSynthCallback(AndroidEspeakSynthToFileCallback); unsigned int unique_identifier; espeak_ERROR err = espeak_Synth( (char*) word, strlen(word)+1, 0, POS_CHARACTER, 0, espeakCHARS_AUTO, &unique_identifier, NULL); err = espeak_Synchronize(); /* strcpy(voicename, GetLanguageVoiceName("EN")); espeak_SetVoiceByName(voicename); strcpy(word, "Geany was fragged by GSG9 Googlebot"); strcpy(word, "Googlebot"); espeak_Synth( (char*) word, strlen(word)+1, 0, POS_CHARACTER, 0, espeakCHARS_AUTO, NULL, NULL); espeak_Synchronize(); */ // espeak_Cancel(); espeak_Terminate(); printf("Espeak terminated\n"); system("pause"); return EXIT_SUCCESS; }

    Read the article

  • Emacs saying: <M-kp-7> is undefined when dictating quotes with Dragon naturally speaking 12

    - by Keks Dose
    I dictating my text via Dragon Naturally Speaking 12 into Emacs. Whenever I say (translation from German): 'open quotes', I expect something like " or » to appear on the screen, but I simply get a message <M-kp-2> is undefined . Same goes for 'close quotes', I get <M-kp-7> is undefined. Does anybody know how to define those virtual keyboard strokes? (global-set-key [M-kp-2] "»") does not work.

    Read the article

  • onServiceConnected never called after bindService method

    - by Tobia Loschiavo
    Hi, I have a particular situation: a service started by a broadcast receiver starts an activity. I want to make it possible for this activity to communicate back to the service. I have chosen to use AIDL to make it possible. Everything seems works good except for bindService() method called in onCreate() of the activity. bindService(), in fact, throws a null pointer exception because onServiceConnected() is never called while onBind() method of the service is. Anyway bindService() returns true. The service is obviously active because it starts the activity. I know that calling an activity from a service could sound strange, but unfortunately this is the only way to have speech recognition in a service. Thanks in advance

    Read the article

  • How can I prevent IIS from trying to load a dll?

    - by Abtin Forouzandeh
    My project is a Speech Server application using Windows Workflow. It runs as an app under IIS. It supports a plug-in system. Here is what is happening: Load DLL into memory and set the type on an InvokeWorkflow control. When the InvokeWorkflow control runs, it appears to correctly instantiate the workflow from the loaded assembly - it completes the Initialize method. Everything crashes an burns, the target workflow is never executed. I can resolve this by putting a copy of the DLL in the application's executing directory. The workflow then executes correctly So it appears that IIS is trying to reload the assembly, even though its already in memory. Is there anyway to alter or disable this behavior in IIS? Perhaps a hook I can write that will intercept the request to load the dll and use my own logic to do so?

    Read the article

  • CoInitialize fails in dll

    - by Quandary
    Question: I have the following program, which uses COM to use the Microsoft Speech API (SAPI) to take a text and output it as sound. Now it works fine as long as I have it in a .exe. When I load it as .dll, it fails. Why? I used dependencywalker, and saw the exe doesn't have MSVCR100D and ole32, so I loaded them like this: LoadLibraryA("MSVCR100D.DLL"); LoadLibraryA("ole32.dll"); but it didn't help... Any idea why ? #include <windows.h> #include <sapi.h> #include <cstdlib> int main(int argc, char* argv[]) { ISpVoice * pVoice = NULL; if (FAILED(::CoInitialize(NULL))) return FALSE; HRESULT hr = CoCreateInstance(CLSID_SpVoice, NULL, CLSCTX_ALL, IID_ISpVoice, (void **) &pVoice); if( SUCCEEDED( hr ) ) { hr = pVoice->Speak(L"Noobie was fragged by GSG9 Googlebot", 0, NULL); hr = pVoice->Speak(L"Test Test", 0, NULL); hr = pVoice->Speak(L"This sounds normal <pitch middle = '-10'/> but the pitch drops half way through", SPF_IS_XML, NULL ); pVoice->Release(); pVoice = NULL; } ::CoUninitialize(); return EXIT_SUCCESS; }

    Read the article

  • What does "Value does not fall within expected range" mean in runtime error?

    - by manuel
    Hi, I'm writing a plugin (dll file) using /clr and trying to implement speech recognition using .NET. But when I run it, I got a runtime error saying "Value does not fall within expected range", what does the message mean? public ref class Dialog : public System::Windows::Forms::Form { public: SpeechRecognitionEngine^ sre; private: System::Void btnSpeak_Click(System::Object^ sender, System::EventArgs^ e) { Initialize(); } protected: void Initialize() { //create the recognition engine sre = gcnew SpeechRecognitionEngine(); //set our recognition engine to use the default audio device sre->SetInputToDefaultAudioDevice(); //create a new GrammarBuilder to specify which commands we want to use GrammarBuilder^ grammarBuilder = gcnew GrammarBuilder(); //append all the choices we want for commands. //we want to be able to move, stop, quit the game, and check for the cake. grammarBuilder->Append(gcnew Choices("play", "stop")); //create the Grammar from th GrammarBuilder Grammar^ customGrammar = gcnew Grammar(grammarBuilder); //unload any grammars from the recognition engine sre->UnloadAllGrammars(); //load our new Grammar sre->LoadGrammar(customGrammar); //add an event handler so we get events whenever the engine recognizes spoken commands sre->SpeechRecognized += gcnew EventHandler<SpeechRecognizedEventArgs^> (this, &Dialog::sre_SpeechRecognized); //set the recognition engine to keep running after recognizing a command. //if we had used RecognizeMode.Single, the engine would quite listening after //the first recognized command. sre->RecognizeAsync(RecognizeMode::Multiple); //this->init(); } void sre_SpeechRecognized(Object^ sender, SpeechRecognizedEventArgs^ e) { //simple check to see what the result of the recognition was if (e->Result->Text == "play") { MessageBox(plugin.hwndParent, L"play", 0, 0); } if (e->Result->Text == "stop") { MessageBox(plugin.hwndParent, L"stop", 0, 0); } } };

    Read the article

  • How to use SAPI's SetNotifyCallbackFunction() in a CLR project with Windows Form as the interface wi

    - by manuel
    Hi, I'm trying to write a dll plugin for Winamp. I'm using Microsoft Visual Studio 2008 and Microsoft SAPI 5.1. I created the interface window using Windows Form (System::Windows::Forms::Form). I tried to use SetNotifyWIndowMessage(), but the method is never called when I speak to the microphone. So I tried using SetNotifyCallbackFunction(), but I got a compile error saying that I should use '&' in front of the method name in the parameter. However, when I add the '&', I got another compile error saying that i can't take the address of the method unless creating delegate instance. What should I do? Someone please help me..

    Read the article

  • LoadDictation with SAPI

    - by Naveen
    I am able to create alternate dictation grammars using the dictation resource kit or directions given here. I am not able to load the new dictation topic with c++. I am trying to modify the simpledict sample provided with the sapi5.1 sdk. The following doesn't work. std::wstring stemp = s2ws("grammar:dictation#Genre"); LPCWSTR mygrammar = stemp.c_str(); hr = m_cpDictationGrammar-LoadDictation(mygrammar, SPLO_STATIC);

    Read the article

  • Freetts problem in Java

    - by manugupt1
    I am trying to run a program using freetts. I am able to compile the program however I am not able to use kevin or mbrola voices I get the follwing o/p msgs at the end System property "mbrola.base" is undefined. Will not use MBROLA voices. LINE UNAVAILABLE: Format is pcm_signed 16000.0 Hz 16 bits 1 channel big endian

    Read the article

  • Jacob + Microsoft SpeechAPI trouble

    - by guai
    Following groovy code kills JVM on SetInterest method invocation It uses Scriptom, the groovy DSL for Jacob Spend whole day searching SAPI's SPFEI macro to rewrite it in groovy. Don't sure does it came out right. Or maybe other bugs %) Help welcomed import org.codehaus.groovy.scriptom.* import static org.codehaus.groovy.scriptom.tlb.sapi.SpeechVoiceSpeakFlags.* import static org.codehaus.groovy.scriptom.tlb.sapi.SpeechRunState.* import static org.codehaus.groovy.scriptom.tlb.sapi.SpeechLib.* import static org.codehaus.groovy.scriptom.tlb.sapi.SPEVENTENUM.* def spfei(Integer[] args) { res = 1<<SPEI_RESERVED1 | 1<<SPEI_RESERVED2 args.each {res |= 1<<it} res } Scriptom.inApartment { def voice = new ActiveXObject('SAPI.SpVoice') evtsrc = voice.toInterface(ISpEventSource) evtsrc.setInterest(spfei(SPEI_WORD_BOUNDARY), spfei(SPEI_WORD_BOUNDARY)) evtsrc.events.Callbacks = {args -> println 'jjj'} voice.speak "Hello, world", SVSFlagsAsync }

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >