So I decided to reduce the amount of Automated machines talking in my ear during Elite Dangerous. I have Voice Attack, EDDI, and the standard Ship interface. I'm wanted to use Voice attack instead of EDDI since I like the techno effect I have placed on the voice and it gave me more options than just EDDI. Thanks to Pfeils response and a little extra tinkering I was able to get this running with no issues. Note I have an extra EDI integer as part of an overall if-then statement to avoid multiple calls for the same command, and a separate command for shutting the command sequence off. But aside from that, this is what I use to make EDDI talk through Voice Attack. I also have posted a youtube video to hear it in action. I do notice that the microphone and voice attack audio is rather quiet against the game audio but you get the idea.
https://youtu.be/kjMtxJWBd-UThis command is executed When I say: Elite Data Interface
When this command executes, do the following sequence:
Set integer [~targetLine] value to 1
Set integer [~overallLines] value
Write (overwrite), " to file 'C:\Users\Blindside\AppData\Roaming\EDDI\speechresponder.out'
Say, 'Elite Data Interface [Initialized' or 'Enabled]' (and wait until it completes)
Start Loop While : [EDI] Equals 1
Set text [~textFile] to [C:\Users\Blindside\AppData\Roaming\EDDI\speechresponder.out]
Inline C# Function:
Begin Integer Compare: [~targetLine] is Less Than [~overallLines]
Inline C# Function:
Write [Blue] '{TXT:~lineOutput}' to log
Say,{TXT:~lineOutput}' (and wait until it completes)
Set integer [~targetLine] to [~targetLine] plus 1
End Condition
End Loop
Say, 'Elite Data Interface [Disabled' or 'Powered Down]' (and wait until it completes)
This command is executed When I say: [Shut Down;stop] Data Interface
When this command executes, do the following sequence:
Set integer [EDI] value to 0
Play sound, 'internal:Glugluglug'
The 1st Inline C# Function is:
public class VAInline
{
public void main()
{
//inputs of ~textFile and ~targetline
//Get output for current targetline
//get targetline value
string input = VA.GetText("~textFile");
if (input == null)
{
VA.WriteToLog("Cannot get line, no file set", "red");
return;
}
string[] lines = input.Split(new[] {Environment.NewLine}, StringSplitOptions.None);
VA.SetInt("~overallLines",lines.Length);
}
}
The 2nd Inline C# Function is:
public class VAInline
{
public void main()
{
//inputs of ~textFile and ~targetline
//Get output for current targetline
//get targetline value
string input = VA.GetText("~textFile");
if (input == null)
{
VA.WriteToLog("Cannot get line, no file set", "red");
return;
}
int targetLine = VA.GetInt("~targetLine") ?? -1;
if (targetLine < 1)
{
VA.WriteToLog("Cannot get line, no or invalid line number set", "red");
return;
}
string[] lines = input.Split(new[] {Environment.NewLine}, StringSplitOptions.None);
if (targetLine > lines.Length)
{
VA.SetInt("~targetLine",targetLine);
VA.WriteToLog("Warning: Target line is " + targetLine + ", but the file only contains " + lines.Length + " lines", "orange");
return;
}
VA.SetText("~lineOutput", lines[targetLine-1]);
}
}
[code]