Hi all, I’m having some errors with a DLL I created but I don’t know why…
This is the error:
EntryPointNotFoundException: text2Speech
TTSFestival.OnMouseUp () (at Assets/Scripts/TTSFestival.cs:20)
UnityEngine.SendMouseEvents:DoSendMouseEvents()
This my script:
using UnityEngine;
using System;
using System.Collections;
using System.Runtime.InteropServices;
public class TTSFestival : MonoBehaviour
{
//[DllImport ("TTSPlugin", EntryPoint="text2Speech")] private static extern int text2Speech(string message, string voice);
[DllImport ("TTSPlugin")] private static extern void text2Speech(string message, string voice);
public string voice = "english";
public string message ="Text";
void OnMouseUp () {
text2Speech(message, voice);
}
}
And this my DLL code:
#if _MSC_VER // this is defined when compiling with Visual Studio
#define EXPORT_API __declspec(dllexport) // Visual Studio needs annotating exported functions with this
#else
#define EXPORT_API // XCode does not need annotating exported functions, so define is empty
#endif
// ------------------------------------------------------------------------
// Plugin itself
#include <sstream>
#include <string>
// Link following functions C-style (required for plugins)
extern "C"
{
void EXPORT_API text2Speech(std::string message, std::string voice)
{
std::stringstream commandoss;
std::string commandos,msg;
commandoss << "start /B festival.exe --libdir \"festival/lib\" ";
commandoss << voice;
commandoss << " -A -T \"";
msg=message;//.toStdString();
//std::replace_if(msg.begin(),msg.end(),boost::is_any_of("\""),', ');
commandoss << msg;
commandoss << "\"";
commandos = commandoss.str();
system(commandos.c_str());
}
} // end of export C block
Any kind of help is welcomed :))