Hello
Anybody as ever heard about a Text to Speak dll the could be run with MC. It would be interesting to have a tool like that. I,m already using the "play" command, but these has predefined voice message. I would like it to be more versatile.
Martin
Text to speak dll
-
- Posts: 742
- Joined: 09 Apr 2010
- Location: Texas
- Has thanked: 483 times
- Been thanked: 274 times
- Contact:
Re: Text to speak dll
I think you can record your own .wav file (using free online or windows software) and you can record any sound that you want..
PlaySound("C:\mysound.wav");
PlaySound("C:\mysound.wav");
Re: Text to speak dll
Hello SptraderI think you can record your own .wav file (using free online or windows software) and you can record any sound that you want..
PlaySound("C:\mysound.wav");
As mentionned, I'm already using the playsound command. I use ATT Text to speech webpage to create the message.
https://www.google.ca/url?sa=t&rct=j&q= ... 2593,d.aWc
I'm looking for a more versatile solution. Like telling on witch scale chart an indicator as been triggered
Martin
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Text to speak dll
Not exactly a TTS... but there is enough AI and flexibility to tide you over for now:
e.g.
e.g.
Code: Select all
var:
sound$("");
if barinterval = 5 then
sound$ = "5min_going_up.wav"
else
if barinterval = 1 then
sound$ = "1min_going_up.wav";
If up.condition = true then
playsound( "c:\soundfiles\" + sound$ );
Re: Text to speak dll
Hello TJNot exactly a TTS... but there is enough AI and flexibility to tide you over for now:
e.g.Code: Select all
var:
sound$("");
if barinterval = 5 then
sound$ = "5min_going_up.wav"
else
if barinterval = 1 then
sound$ = "1min_going_up.wav";
If up.condition = true then
playsound( "c:\soundfiles\" + sound$ );
I got about 25 already recorded similar messages. What I would like is to add some flexibility like telling witch market & time scale did the indicator has triggered. At the moment, the same message is use for all my chart. Sometime it is confusing...
Have a good day
Martin
Edit: I just seen a company who has created a Text to voice dll for TS 49.95$ USD
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Text to speak dll
A friend send me this link of a Text to Voice C# code
Maybe a C# expert could addapt it to be coded as a dll for MC
Link: http://forum.unity3d.com/threads/56038- ... -for-Win32
Maybe a C# expert could addapt it to be coded as a dll for MC
Link: http://forum.unity3d.com/threads/56038- ... -for-Win32
Code: Select all
e:
// Voice Speaker (c) ZJP
//
// Windows 32B >> Copy 'Voice_speaker.dll' in windows\system32 folder
// Windows 64B >> Copy 'Voice_speaker.dll' in windows\SysWOW64 folder
// Remember to release "Voice_speaker.dll" with your final project. It will be placed in the same folder as the EXE
//
// Voice Speaker (c) ZJP //
using UnityEngine;
using System;
using System.Collections;
using System.Runtime.InteropServices;
public class VoiceSpeaker : MonoBehaviour
{
[DllImport ("Voice_speaker.dll", EntryPoint="VoiceAvailable")] private static extern int VoiceAvailable();
[DllImport ("Voice_speaker.dll", EntryPoint="InitVoice")] private static extern void InitVoice();
[DllImport ("Voice_speaker.dll", EntryPoint="WaitUntilDone")] private static extern int WaitUntilDone(int millisec);
[DllImport ("Voice_speaker.dll", EntryPoint="FreeVoice")] private static extern void FreeVoice();
[DllImport ("Voice_speaker.dll", EntryPoint="GetVoiceCount")] private static extern int GetVoiceCount();
// Unity V4.x.x
[DllImport ("Voice_speaker.dll", EntryPoint="GetVoiceName")] private static extern IntPtr GetVoiceName(int index);
// other Unity version
// [DllImport ("Voice_speaker.dll", EntryPoint="GetVoiceName")] private static extern string GetVoiceName(int index);
[DllImport ("Voice_speaker.dll", EntryPoint="SetVoice")] private static extern void SetVoice(int index);
[DllImport ("Voice_speaker.dll", EntryPoint="Say")] private static extern void Say(string ttospeak);
[DllImport ("Voice_speaker.dll", EntryPoint="SayAndWait")] private static extern void SayAndWait(string ttospeak);
[DllImport ("Voice_speaker.dll", EntryPoint="SpeakToFile")] private static extern int SpeakToFile(string filename, string ttospeak);
[DllImport ("Voice_speaker.dll", EntryPoint="GetVoiceState")] private static extern int GetVoiceState();
[DllImport ("Voice_speaker.dll", EntryPoint="GetVoiceVolume")] private static extern int GetVoiceVolume();
[DllImport ("Voice_speaker.dll", EntryPoint="SetVoiceVolume")] private static extern void SetVoiceVolume(int volume);
[DllImport ("Voice_speaker.dll", EntryPoint="GetVoiceRate")] private static extern int GetVoiceRate();
[DllImport ("Voice_speaker.dll", EntryPoint="SetVoiceRate")] private static extern void SetVoiceRate(int rate);
[DllImport ("Voice_speaker.dll", EntryPoint="PauseVoice")] private static extern void PauseVoice();
[DllImport ("Voice_speaker.dll", EntryPoint="ResumeVoice")] private static extern void ResumeVoice();
public int voice_nb = 0;
void Start ()
{
if( VoiceAvailable()>0 )
{
InitVoice(); // init the engine
if (voice_nb > GetVoiceCount()) voice_nb = 0;
if (voice_nb < 0) voice_nb = 0;
// Unity V4.x.x *******************************************
IntPtr pStr = GetVoiceName(voice_nb);
string str = Marshal.PtrToStringAnsi(pStr);
Debug.Log ("Voice name : "+str); // Voice Name
// Unity V4.x.x *******************************************
//Debug.Log ("Voice name : "+GetVoiceName(voice_nb)); // Voice Name other Unity version
Debug.Log ("Number of voice : "+GetVoiceCount()); // Number of voice
SetVoice(voice_nb); // 0 to voiceCount - 1
Debug.Log ("Voice Rate : "+GetVoiceRate());
SetVoiceRate(2);
//Debug.Log ("Voice name : "+GetVoiceName(voice_nb));
Say("All system nominal. Engine, online, weapons, online.. We are ready. 9.,.8.,.7.,.6.,.5.,.4.,.3.,.2.,.1.,.0.,. Go,.Take off");
// Say("Tout les systèmes sont opérationnels. Moteurs, en ligne. Armement, en ligne. Nous sommes prêt. 9.,.8.,.7.,.6.,.5.,.4.,.3.,.2.,.1.,.0.,. .Décollage" );
}
Application.Quit();
}
void OnDisable()
{
if( VoiceAvailable()>0 )
{
FreeVoice();
}
}
}
Re: Text to speak dll
After reading the code I guess not really what you want and even not flexible. But you could write a txt-file in EL and there are programs out there which can read it and convert it into voice. Voices are AT&T conversion tool style but it is fully flexible. When I remember right it cost like 99USD or so. But can't remember what the name was.A friend send me this link of a Text to Voice C# code. Maybe a C# expert could addapt it to be coded as a dll for MC ... Link: http://forum.unity3d.com/threads/56038- ... -for-Win32
Sorry