Last reviewed: 3/22/2024 8:06:31 PM
Engine Installation
Refer to vendor SDK instructions for any platform specific recognizer and synthesizer installation instructions.
Acapela (x86 and x64)
Acapela synthesizers can be accessed via SAPI 5 or via the AcaTTS API that is a CDLL-based architecture.
For AcaTTS API access, the Chant classes attempt to load the acatts.dll (acatts.64.dll) runtime library from Acapela default installation "C:\Program Files (x86)\Acapela Group\Acapela TTS for Windows" directory. If the libraries fail to load, the Chant classes attempt to load the library from the current working directory. Applications can set the location by setting the EnginePath property.
Set the Acapela TTS directory and file locations in the Chant Developer Workbench IDE as follows:
- select the View Options... menu item;
- select the Speech Synthesizers node under Environment;
- select the Acapela Multimedia node;
- click the open folders button (...) for Acapela to select a path; and
- click the OK button to save your path.
For applications to use the AcaTTS API, instantiate an AcaTTSSynthesizer class object in your applications as follows:
private NSpeechKit _SpeechKit = null;
private NAcaTTSSynthesizer _Synthesizer = null;
public MainWindow()
{
InitializeComponent();
// Instantiate SpeechKit
_SpeechKit = new NSpeechKit();
if (_SpeechKit != null)
{
// Set credentials
_SpeechKit.SetCredentials("Credentials");
// Create synthesizer
_Synthesizer = _SpeechKit.CreateAcaTTSSynthesizer();
if (_Synthesizer != null)
{
_Synthesizer.WordPosition += Synthesizer_WordPosition;
}
}
}
protected:
CSpeechKit* _SpeechKit;
CAcaTTSSynthesizer* _Synthesizer;
// Instantiate SpeechKit object
_SpeechKit = new CSpeechKit();
if (_SpeechKit =! NULL)
{
// Set credentials
_SpeechKit->SetCredentials(L"Credentials");
// Create synthesizer
_Synthesizer = _SpeechKit->CreateAcaTTSSynthesizer();
if (_Synthesizer != NULL)
{
// Register Event Handlers
_Synthesizer->SetWordPosition(WordPosition);
}
}
private:
CSpeechKit* _SpeechKit;
CAcaTTSSynthesizer* _Synthesizer;
// Instantiate SpeechKit object
_SpeechKit = new CSpeechKit();
if (_SpeechKit =! NULL)
{
// Set credentials
_SpeechKit->SetCredentials("Credentials");
// Create synthesizer
_Synthesizer = _SpeechKit->CreateAcaTTSSynthesizer();
if (_Synthesizer != NULL)
{
// Register Event Handlers
_Synthesizer->SetWordPosition(WordPosition);
}
}
var
_SpeechKit: TSpeechKit;
_Synthesizer: TAcaTTSSynthesizer;
// Instantiate SpeechKit object
_SpeechKit := TSpeechKit.Create();
if (_SpeechKit <> nil) then
begin
// Set credentials
_SpeechKit.SetCredentials('Credentials');
// Create synthesizer
_Synthesizer := _SpeechKit.CreateAcaTTSSynthesizer();
if (_Synthesizer <> nil) then
begin
// Register Event Handlers
_Synthesizer.WordPosition := WordPosition;
end;
end;
public class Frame1 extends JFrame implements com.SpeechKit.JChantSpeechKitEvents
{
private JSpeechKit _SpeechKit = null;
private JAcaTTSSynthesizer _Synthesizer = null;
private void jInit() throws Exception
{
// Create SpeechKit object
_SpeechKit = new JSpeechKit();
// Set credentials
_SpeechKit.setCredentials("Credentials");
// Create synthesizer
_Synthesizer = _SpeechKit.createAcaTTSSynthesizer();
if (_Synthesizer != null)
{
// Set the callback object
_Synthesizer.setChantSpeechKitEvents(this);
// Register for callbacks
_Synthesizer.registerCallback(ChantSpeechKitCallback.CCTTSWordPosition);
}
}
}
Not supported
Not supported
Dim _SpeechKit As NSpeechKit
Dim WithEvents _Synthesizer As NAcaTTSSynthesizer
Private Sub Window_Loaded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded
' Instantiate SpeechKit
_SpeechKit = New NSpeechKit()
If (_SpeechKit IsNot Nothing) Then
' Set credentials
_SpeechKit.SetCredentials("Credentials")
' Create synthesizer
_Synthesizer = _SpeechKit.CreateAcaTTSSynthesizer()
End If
End Sub
Apple Speech and AudioVisual Foundation (iOS and macOS)
If you are developing on Apple and plan to use the Speech Framerwork recognizer and AudioVisual Foundation synthesizer, then no additional installation steps are required. Apple speech technology is preinstalled.
Apple Speech and AudioVisual Foundation are the Chant library Apple platform default speech APIs.
For applications to use the Apple speech technology, instantiate SPChantRecognizer and SPChantSynthesizer class objects in your applications as follows:
Not supported
Not supported
Not supported
Not supported
Not supported
@property (strong, nonatomic) SPSpeechKit* speechKit;
@property (strong, nonatomic) SPChantRecognizer* recognizer;
@property (strong, nonatomic) SPChantSynthesizer* synthesizer;
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
_speechKit = [[SPSpeechKit alloc] init];
if (_speechKit != nil)
{
// Set credentials
[_speechKit setCredentials:@"Credentials"];
_recognizer = [_speechKit createChantRecognizer];
_synthesizer = [_speechKit createChantSynthesizer];
}
if (_recognizer != nil)
{
[_recognizer setDelegate:(id)self];
...
}
}
if (_synthesizer != nil)
{
[_synthesizer setDelegate:(id)self];
...
}
}
}
class ViewController: ..., SPChantRecognizerDelegate, SPChantSynthesizerDelegate {
...
var _SpeechKit: SPSpeechKit? = nil
var _Recognizer: SPChantRecognizer? = nil
var _Synthesizer: SPChantSynthesizer? = nil
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
_SpeechKit = SPSpeechKit()
if (_SpeechKit != nil)
{
// Set credentials
_ = _SpeechKit!.setCredentials(credentials:"Credentials")
_Recognizer = _SpeechKit!.createChantRecognizer()
_Synthesizer = _SpeechKit!.createChantSynthesizer()
}
if (_Recognizer != nil)
{
_Recognizer!.delegate = self
...
}
if (_Synthesizer != nil)
{
_Synthesizer!.delegate = self
...
}
}
}
Not supported
Cepstral (x86 and x64)
Cepstral synthesizers can be accessed via SAPI 5 or the SWIFT API that is a CDLL-based architecture.
For SWIFT API access, the Chant classes attempt to load the swift.dll runtime library from Cepstral default installation C:\Program Files\Cepstral\bin directory. If the libraries fail to load, the Chant classes attempt to load the libraries from the current working directory.
For applications to use the SWIFT API, instantiate a SwiftSynthesizer class object in your applications as follows:
private NSpeechKit _SpeechKit = null;
private NSwiftSynthesizer _Synthesizer = null;
public MainWindow()
{
InitializeComponent();
// Instantiate SpeechKit
_SpeechKit = new NSpeechKit();
if (_SpeechKit != null)
{
// Set credentials
_SpeechKit.SetCredentials("Credentials");
_Synthesizer = _SpeechKit.CreateSwiftSynthesizer();
if (_Synthesizer != null)
{
_Synthesizer.WordPosition += Synthesizer_WordPosition;
}
}
}
protected:
CSpeechKit* _SpeechKit;
CSwiftSynthesizer* _Synthesizer;
// Instantiate SpeechKit object
_SpeechKit = new CSpeechKit();
if (_SpeechKit =! NULL)
{
// Set credentials
_SpeechKit->SetCredentials(L"Credentials");
// Create synthesizer
_Synthesizer = _SpeechKit->CreateSwiftSynthesizer();
if (_Synthesizer != NULL)
{
// Register Event Handlers
_Synthesizer->SetWordPosition(WordPosition);
}
}
CSpeechKit* _SpeechKit;
CSwiftSynthesizer* _Synthesizer;
// Instantiate SpeechKit object
_SpeechKit = new CSpeechKit();
if (_SpeechKit =! NULL)
{
// Set credentials
_SpeechKit->SetCredentials("Credentials");
// Create synthesizer
_Synthesizer = _SpeechKit->CreateSwiftSynthesizer();
if (_Synthesizer != NULL)
{
// Register Event Handlers
_Synthesizer->SetWordPosition(WordPosition);
}
}
var
_SpeechKit: TSpeechKit;
_Synthesizer: TSwiftSynthesizer;
// Instantiate SpeechKit object
_SpeechKit := TSpeechKit.Create();
if (_SpeechKit <> nil) then
begin
// Set credentials
_SpeechKit.SetCredentials('Credentials');
// Create synthesizer
_Synthesizer := _SpeechKit.CreateSwiftSynthesizer();
if (_Synthesizer <> nil) then
begin
// Register Event Handlers
_Synthesizer.WordPosition := WordPosition;
end;
end;
public class Frame1 extends JFrame implements com.SpeechKit.JChantSpeechKitEvents
{
private JSpeechKit _SpeechKit = null;
private JSwiftSynthesizer _Synthesizer = null;
private void jInit() throws Exception
{
// Create SpeechKit object
_SpeechKit = new JSpeechKit();
// Set credentials
_SpeechKit.setCredentials("Credentials");
_Synthesizer = _SpeechKit.createSwiftSynthesizer();
if (_Synthesizer != null)
{
// Set the callback object
_Synthesizer.setChantSpeechKitEvents(this);
// Register for callbacks
_Synthesizer.registerCallback(ChantSpeechKitCallback.CCTTSWordPosition);
}
}
}
Not supported
Not supported
Dim _SpeechKit As NSpeechKit
Dim WithEvents _Synthesizer As NSwiftSynthesizer
Private Sub Window_Loaded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded
' Instantiate SpeechKit
_SpeechKit = New NSpeechKit()
If (_SpeechKit IsNot Nothing) Then
' Set credentials
_SpeechKit.SetCredentials("Credentials")
_Synthesizer = _SpeechKit.CreateSwiftSynthesizer()
End If
End Sub
CereProc CereVoice (x86 and x64)
CereProc synthesizers can be accessed via the CereVoice API that is a CDLL-based architecture.
For CereVoice API access, the Chant classes attempt to load the runtime library, voice files, and license from the current working directory if paths are not specified. sApplications can set the runtime location by setting the EnginePath property.
Set the CereProc directory and file locations in the Chant Developer Workbench IDE as follows:
- select the View Options... menu item;
- select the Speech Synthesizers node under Environment;
- select the CereProc node;
- click the open folders button (...) for CereProc to select a path;
- enter your license key values; and
- click the OK button to save your path.
For applications to use the CereVoice API, instantiate a CereVoiceSynthesizer class object in your applications as follows:
private NSpeechKit _SpeechKit = null;
private NCereVoiceSynthesizer _Synthesizer = null;
public MainWindow()
{
InitializeComponent();
// Instantiate SpeechKit
_SpeechKit = new NSpeechKit();
if (_SpeechKit != null)
{
// Set credentials
_SpeechKit.SetCredentials("Credentials");
_Synthesizer = _SpeechKit.CreateCereVoiceSynthesizer();
if (_Synthesizer != null)
{
// Configure engine properties
_Synthesizer.SetProperty("EnginePath", "path\\cerevoice_eng\\lib");
_Synthesizer.SetProperty("VoicePath", "path\\cerevoices");
_Synthesizer.SetProperty("RootCertificate", "path\\root_certificate.pem");
_Synthesizer.SetProperty("ClientCRT", "path\\xx_client.crt");
_Synthesizer.SetProperty("ClientKey", "path\\xx_client.key");
_Synthesizer.SetProperty("License", "path\\xx_license.lic");
// Register Event Handlers
_Synthesizer.WordPosition += Synthesizer_WordPosition;
}
}
}
protected:
CSpeechKit* _SpeechKit;
CCereVoiceSynthesizer* _Synthesizer;
// Instantiate SpeechKit object
_SpeechKit = new CSpeechKit();
if (_SpeechKit =! NULL)
{
// Set credentials
_SpeechKit->SetCredentials(L"Credentials");
// Create synthesizer
_Synthesizer = _SpeechKit->CreateCereVoiceSynthesizer();
if (_Synthesizer != NULL)
{
// Configure engine properties
_Synthesizer->SetProperty(L"EnginePath", L"path\\cerevoice_eng\\lib");
_Synthesizer->SetProperty(L"VoicePath", L"path\\cerevoices");
_Synthesizer->SetProperty(L"RootCertificate", L"path\\root_certificate.pem");
_Synthesizer->SetProperty(L"ClientCRT", L"path\\xx_client.crt");
_Synthesizer->SetProperty(L"ClientKey", L"path\\xx_client.key");
_Synthesizer->SetProperty(L"License", L"path\\xx_license.lic");
// Register Event Handlers
_Synthesizer->SetWordPosition(WordPosition);
}
}
private:
CSpeechKit* _SpeechKit;
CCereVoiceSynthesizer* _Synthesizer;
// Instantiate SpeechKit object
_SpeechKit = new CSpeechKit();
if (_SpeechKit =! NULL)
{
// Set credentials
_SpeechKit->SetCredentials("Credentials");
// Create synthesizer
_Synthesizer = _SpeechKit->CreateCereVoiceSynthesizer();
if (_Synthesizer != NULL)
{
// Configure engine properties
_Synthesizer->SetProperty("EnginePath", "path\\cerevoice_eng\\lib");
_Synthesizer->SetProperty("VoicePath", "path\\cerevoices");
_Synthesizer->SetProperty("RootCertificate", "path\\root_certificate.pem");
_Synthesizer->SetProperty("ClientCRT", "path\\xx_client.crt");
_Synthesizer->SetProperty("ClientKey", "path\\xx_client.key");
_Synthesizer->SetProperty("License", "path\\xx_license.lic");
// Register Event Handlers
_Synthesizer->SetWordPosition(WordPosition);
}
}
var
_SpeechKit: TSpeechKit;
_Synthesizer: TCereVoiceSynthesizer;
// Instantiate SpeechKit object
_SpeechKit := TSpeechKit.Create();
if (_SpeechKit <> nil) then
begin
// Set credentials
_SpeechKit.SetCredentials('Credentials');
// Create synthesizer
_Synthesizer := _SpeechKit.CreateCereVoiceSynthesizer();
if (_Synthesizer <> nil) then
begin
// Configure engine properties
_Synthesizer.SetProperty('EnginePath', 'path\\cerevoice_eng\\lib');
_Synthesizer.SetProperty('VoicePath', 'path\\cerevoices');
_Synthesizer.SetProperty('RootCertificate', 'path\\root_certificate.pem');
_Synthesizer.SetProperty('ClientCRT', 'path\\xx_client.crt');
_Synthesizer.SetProperty('ClientKey', 'path\\xx_client.key');
_Synthesizer.SetProperty('License', 'path\\xx_license.lic');
// Register Event Handlers
_Synthesizer.WordPosition := WordPosition;
end;
end;
public class Frame1 extends JFrame implements com.SpeechKit.JChantSpeechKitEvents
{
private JSpeechKit _SpeechKit = null;
private JCereVoiceSynthesizer _Synthesizer = null;
private void jInit() throws Exception
{
// Create SpeechKit object
_SpeechKit = new JSpeechKit();
// Set credentials
_SpeechKit.setCredentials("Credentials");
_Synthesizer = _SpeechKit.createCereVoiceSynthesizer();
if (_Synthesizer != null)
{
// Configure engine properties
_Synthesizer.setProperty("EnginePath", "path\\cerevoice_eng\\lib");
_Synthesizer.setProperty("VoicePath", "path\\cerevoices");
_Synthesizer.setProperty("RootCertificate", "path\\root_certificate.pem");
_Synthesizer.setProperty("ClientCRT", "path\\xx_client.crt");
_Synthesizer.setProperty("ClientKey", "path\\xx_client.key");
_Synthesizer.setProperty("License", "path\\xx_license.lic");
// Set the callback object
_Synthesizer.setChantSpeechKitEvents(this);
// Register for callbacks
_Synthesizer.registerCallback(ChantSpeechKitCallback.CCTTSWordPosition);
}
}
}
Not supported
Not supported
Dim _SpeechKit As NSpeechKit
Dim WithEvents _Synthesizer As NCereVoiceSynthesizer
Private Sub Window_Loaded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded
' Instantiate SpeechKit
_SpeechKit = New NSpeechKit()
If (_SpeechKit IsNot Nothing) Then
' Set credentials
_SpeechKit.SetCredentials("Credentials")
_Synthesizer = _SpeechKit.CreateCereVoiceSynthesizer()
If (_Synthesizer IsNot Nothing) Then
_Synthesizer.SetProperty("EnginePath", "path\cerevoice_eng\lib")
_Synthesizer.SetProperty("VoicePath", "path\cerevoices")
_Synthesizer.SetProperty("RootCertificate", "path\root_certificate.pem")
_Synthesizer.SetProperty("ClientCRT", "path\xx_client.crt")
_Synthesizer.SetProperty("ClientKey", "path\xx_client.key")
_Synthesizer.SetProperty("License", "path\xx_license.lic")
End If
End If
End Sub
Ensure your application has access to the applicable runtime library: libcerevoice_eng_shared_6.dll.
Dragon NaturallySpeaking (x86 and x64)
Once Dragon NaturallySpeaking is installed and at least one speaker created, then no additional installation steps are required.
For applications to use the Dragon NaturallySpeaking API, instantiate an DngRecognizer class object in your applications as follows:
private NSpeechKit _SpeechKit = null;
private NDgnRecognizer _Recognizer = null;
public MainWindow()
{
InitializeComponent();
// Instantiate SpeechKit
_SpeechKit = new NSpeechKit();
if (_SpeechKit != null)
{
// Set credentials
_SpeechKit.SetCredentials("Credentials");
_Recognizer = _SpeechKit.CreateDgnRecognizer();
if (_Recognizer != null)
{
_Recognizer.RecognitionDictation += Recognizer_RecognitionDictation;;
}
}
}
protected:
CSpeechKit* _SpeechKit;
CDgnRecognizer* _Recognizer;
// Instantiate SpeechKit object
_SpeechKit = new CSpeechKit();
if (_SpeechKit =! NULL)
{
// Set credentials
_SpeechKit->SetCredentials(L"Credentials");
// Create recognizer
_Recognizer = _SpeechKit->CreateDgnRecognizer();
if (_Recognizer != NULL)
{
// Register Event Handlers
_Recognizer->SetRecognitionDictation(RecognitionDictation);
}
}
private:
CSpeechKit* _SpeechKit;
CDgnRecognizer* _Recognizer;
// Instantiate SpeechKit object
_SpeechKit = new CSpeechKit();
if (_SpeechKit =! NULL)
{
// Set credentials
_SpeechKit->SetCredentials("Credentials");
// Create recognizer
_Recognizer = _SpeechKit->CreateDgnRecognizer();
if (_Recognizer != NULL)
{
// Register Event Handlers
_Recognizer->SetRecognitionDictation(RecognitionDictation);
}
}
var
_SpeechKit: TSpeechKit;
_Recognizer: TDgnRecognizer;
// Instantiate SpeechKit object
_SpeechKit := TSpeechKit.Create();
if (_SpeechKit <> nil) then
begin
// Set credentials
_SpeechKit.SetCredentials('Credentials');
// Create recognizer
_Recognizer := _SpeechKit.CreateDgnRecognizer();
if (_Recognizer <> nil) then
begin
// Register Event Handlers
_Recognizer.RecognitionDictation := RecognitionDictation;
end;
end;
public class Frame1 extends JFrame implements com.SpeechKit.JChantSpeechKitEvents
{
private JSpeechKit _SpeechKit = null;
private JDgnRecognizer _DgnRecognizer = null;
private void jInit() throws Exception
{
// Create SpeechKit object
_SpeechKit = new JSpeechKit();
// Set credentials
_SpeechKit.setCredentials("Credentials");
_Recognizer = _SpeechKit.createDgnRecognizer();
if (_Recognizer != null)
{
// Set the callback object
_Recognizer.setChantSpeechKitEvents(this);
// Register Callbacks for receiving recognized speech.
_Recognizer.registerCallback(ChantSpeechKitCallback.CCSRRecognitionDictation);
}
}
}
Not supported
Not supported
Dim _SpeechKit As NSpeechKit
Dim WithEvents _Recognizer As NDgnRecognizer
Private Sub Window_Loaded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded
' Instantiate SpeechKit
_SpeechKit = New NSpeechKit()
If (_SpeechKit IsNot Nothing) Then
' Set credentials
_SpeechKit.SetCredentials("Credentials")
_Recognizer = _SpeechKit.CreateDgnRecognizer()
End If
End Sub
Google android.speech
If you are developing for Android and plan to use the android.speech recognizer and android.speech.tts synthesizer, then no additional installation steps are required. Google speech technology is preinstalled.
android.speech and android.speech.tts are the Chant library Android platform default speech APIs.
For applications to use the Google speech technology, instantiate JChantRecognizer and JChantSynthesizer class objects in your applications as follows:
Not supported
Not supported
Not supported
Not supported
private JSpeechKit _SpeechKit = null;
private JChantRecognizer _Recognizer = null;
private JChantSynthesizer _Synthesizer = null;
static MainActivity _Instance = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
_Instance = this;
_SpeechKit = new JSpeechKit();
if (_SpeechKit != null)
{
// Set credentials
_SpeechKit.setCredentials("Credentials");
// Verify permission
verifySpeechPermissions(_Instance);
// Create Recognizer
_Recognizer = _SpeechKit.createChantRecognizer();
if (_Recognizer != null)
{
// Set the callback
_Recognizer.setChantSpeechKitEvents(this);
// Register Callbacks for engine init
_Recognizer.registerCallback(ChantSpeechKitCallback.CCSRRecognitionDictation);
_Recognizer.registerCallback(ChantSpeechKitCallback.CCSRInitComplete);
// Set app context
_Recognizer.setContext(getApplicationContext());
}
// Create Synthesizer
_Synthesizer = _SpeechKit.createChantSynthesizer();
if (_Synthesizer != null)
{
// Set the callback
_Synthesizer.setChantSpeechKitEvents(this);
// Register Callbacks for engine init
_Synthesizer.registerCallback(ChantSpeechKitCallback.CCTTSInitComplete);
// Set app context
_Synthesizer.setContext(_Context);
}
}
}
public static void verifySpeechPermissions(Activity activity) {
// Check if we have write permission
int permission = ActivityCompat.checkSelfPermission(activity, Manifest.permission.RECORD_AUDIO);
if (permission != PackageManager.PERMISSION_GRANTED) {
// We don't have permission so prompt the user
ActivityCompat.requestPermissions(
activity,
PERMISSIONS_AUDIO,
REQUEST_RECORD_AUDIO
);
}
}
}
Not supported
Not supported
Not supported
Microsoft SAPI (x86 and x64)
If you are developing on Microsoft Windows 10+ and plan to use the Microsoft recognizer and synthesizer, then no additional installation steps are required. Microsoft SAPI is preinstalled.
For applications to use the Microsoft SAPI5 API, instantiate SAPI5Recognizer and SAPI5Synthesizer class objects in your applications as follows:
private NSpeechKit _SpeechKit = null;
private NSAPI5Recognizer _Recognizer = null;
private NSAPI5Synthesizer _Synthesizer = null;
public MainWindow()
{
InitializeComponent();
// Instantiate SpeechKit
_SpeechKit = new NSpeechKit();
if (_SpeechKit != null)
{
// Set credentials
_SpeechKit.SetCredentials("Credentials");
_Recognizer = _SpeechKit.CreateSAPI5Recognizer();
if (_Recognizer != null)
{
_Recognizer.RecognitionDictation += Recognizer_RecognitionDictation;;
}
_Synthesizer = _SpeechKit.CreateSAPI5Synthesizer();
if (_Synthesizer != null)
{
_Synthesizer.WordPosition += Synthesizer_WordPosition;
}
}
}
protected:
CSpeechKit* _SpeechKit;
CSAPI5Recognizer* _Recognizer;
CSAPI5Synthesizer* _Synthesizer;
// Instantiate SpeechKit object
_SpeechKit = new CSpeechKit();
if (_SpeechKit =! NULL)
{
// Set credentials
_SpeechKit->SetCredentials(L"Credentials");
// Create recognizer
_Recognizer = _SpeechKit->CreateSAPI5Recognizer();
if (_Recognizer != NULL)
{
// Register Event Handlers
_Recognizer->SetRecognitionDictation(RecognitionDictation);
}
// Create synthesizer
_Synthesizer = _SpeechKit->CreateSAPI5Synthesizer();
if (_Synthesizer != NULL)
{
// Register Event Handlers
_Synthesizer->SetWordPosition(WordPosition);
}
}
private:
CSpeechKit* _SpeechKit;
CSAPI5Recognizer* _Recognizer;
CSAPI5Synthesizer* _Synthesizer;
// Instantiate SpeechKit object
_SpeechKit = new CSpeechKit();
if (_SpeechKit =! NULL)
{
// Set credentials
_SpeechKit->SetCredentials("Credentials");
// Create recognizer
_Recognizer = _SpeechKit->CreateSAPI5Recognizer();
if (_Recognizer != NULL)
{
// Register Event Handlers
_Recognizer->SetRecognitionDictation(RecognitionDictation);
}
// Create synthesizer
_Synthesizer = _SpeechKit->CreateSAPI5Synthesizer();
if (_Synthesizer != NULL)
{
// Register Event Handlers
_Synthesizer->SetWordPosition(WordPosition);
}
}
var
_SpeechKit: TSpeechKit;
_Recognizer: TSAPI5Recognizer;
_Synthesizer: TSAPI5Synthesizer;
// Instantiate SpeechKit object
_SpeechKit := TSpeechKit.Create();
if (_SpeechKit <> nil) then
begin
// Set credentials
_SpeechKit.SetCredentials('Credentials');
// Create recognizer
_Recognizer := _SpeechKit.CreateSAPI5Recognizer();
if (_Recognizer <> nil) then
begin
// Register Event Handlers
_Recognizer.RecognitionDictation := RecognitionDictation;
end;
// Create synthesizer
_Synthesizer := _SpeechKit.CreateSAPI5Synthesizer();
if (_Synthesizer <> nil) then
begin
// Register Event Handlers
_Synthesizer.WordPosition := WordPosition;
end;
end;
public class Frame1 extends JFrame implements com.SpeechKit.JChantSpeechKitEvents
{
private JSpeechKit _SpeechKit = null;
private JSAPI5Recognizer _Recognizer = null;
private JSAPI5Synthesizer _Synthesizer = null;
private void jInit() throws Exception
{
// Create SpeechKit object
_SpeechKit = new JSpeechKit();
// Set credentials
_SpeechKit.setCredentials("Credentials");
_Recognizer = _SpeechKit.createSAPI5Recognizer();
if (_Recognizer != null)
{
// Set the callback object
_Recognizer.setChantSpeechKitEvents(this);
// Register Callbacks for receiving recognized speech.
_Recognizer.registerCallback(ChantSpeechKitCallback.CCSRRecognitionDictation);
}
_Synthesizer = _SpeechKit.createSAPI5Synthesizer();
if (_Synthesizer != null)
{
// Set the callback object
_Synthesizer.setChantSpeechKitEvents(this);
// Register for callbacks
_Synthesizer.registerCallback(ChantSpeechKitCallback.CCTTSWordPosition);
}
}
}
Not supported
Not supported
Dim _SpeechKit As NSpeechKit
Dim WithEvents _Recognizer As NSAPI5Synthesizer
Dim WithEvents _Synthesizer As NSAPI5Synthesizer
Private Sub Window_Loaded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded
' Instantiate SpeechKit
_SpeechKit = New NSpeechKit()
If (_SpeechKit IsNot Nothing) Then
' Set credentials
_SpeechKit.SetCredentials("Credentials")
_Recognizer = _SpeechKit.CreateSAPI5Recognizer()
_Synthesizer = _SpeechKit.CreateSAPI5Synthesizer()
End If
End Sub
Microsoft Speech Platform (x86 and x64)
If you are developing on Microsoft Windows 10+ and plan to use the Microsoft Speech Platform, then you need to install the runtime, recognizers, and/or synthesizer.
Microsoft Speech Platform v11.0 is currently supported. The runtimes, recognizers, and voices can be downloaded from Microsoft.
For applications to use the Microsoft Speech Platform API, instantiate MSPRecognizer and MSPSynthesizer class objects in your applications as follows:
private NSpeechKit _SpeechKit = null;
private NMSPRecognizer _Recognizer = null;
private NMSPSynthesizer _Synthesizer = null;
public MainWindow()
{
InitializeComponent();
// Instantiate SpeechKit
_SpeechKit = new NSpeechKit();
if (_SpeechKit != null)
{
// Set credentials
_SpeechKit.SetCredentials("Credentials");
_Recognizer = _SpeechKit.CreateMSPRecognizer();
if (_Recognizer != null)
{
_Recognizer.RecognitionDictation += Recognizer_RecognitionDictation;;
}
_Synthesizer = _SpeechKit.CreateMSPSynthesizer();
if (_Synthesizer != null)
{
_Synthesizer.WordPosition += Synthesizer_WordPosition;
}
}
}
protected:
CSpeechKit* _SpeechKit;
CMSPRecognizer* _Recognizer;
CMSPSynthesizer* _Synthesizer;
// Instantiate SpeechKit object
_SpeechKit = new CSpeechKit();
if (_SpeechKit =! NULL)
{
// Set credentials
_SpeechKit->SetCredentials(L"Credentials");
// Create recognizer
_Recognizer = _SpeechKit->CreateMSPRecognizer();
if (_Recognizer != NULL)
{
// Register Event Handlers
_Recognizer->SetRecognitionDictation(RecognitionDictation);
}
// Create synthesizer
_Synthesizer = _SpeechKit->CreateMSPSynthesizer();
if (_Synthesizer != NULL)
{
// Register Event Handlers
_Synthesizer->SetWordPosition(WordPosition);
}
}
private:
CSpeechKit* _SpeechKit;
CMSPRecognizer* _Recognizer;
CMSPSynthesizer* _Synthesizer;
// Instantiate SpeechKit object
_SpeechKit = new CSpeechKit();
if (_SpeechKit =! NULL)
{
// Set credentials
_SpeechKit->SetCredentials("Credentials");
// Create recognizer
_Recognizer = _SpeechKit->CreateMSPRecognizer();
if (_Recognizer != NULL)
{
// Register Event Handlers
_Recognizer->SetRecognitionDictation(RecognitionDictation);
}
// Create synthesizer
_Synthesizer = _SpeechKit->CreateMSPSynthesizer();
if (_Synthesizer != NULL)
{
// Register Event Handlers
_Synthesizer->SetWordPosition(WordPosition);
}
}
var
_SpeechKit: TSpeechKit;
_Recognizer: TMSPRecognizer;
_Synthesizer: TMSPSynthesizer;
// Instantiate SpeechKit object
_SpeechKit := TSpeechKit.Create();
if (_SpeechKit <> nil) then
begin
// Set credentials
_SpeechKit.SetCredentials('Credentials');
// Create recognizer
_Recognizer := _SpeechKit.CreateMSPRecognizer();
if (_Recognizer <> nil) then
begin
// Register Event Handlers
_Recognizer.RecognitionDictation := RecognitionDictation;
end;
// Create synthesizer
_Synthesizer := _SpeechKit.CreateMSPSynthesizer();
if (_Synthesizer <> nil) then
begin
// Register Event Handlers
_Synthesizer.WordPosition := WordPosition;
end;
end;
public class Frame1 extends JFrame implements com.SpeechKit.JChantSpeechKitEvents
{
private JSpeechKit _SpeechKit = null;
private JMSPRecognizer _Recognizer = null;
private JMSPSynthesizer _Synthesizer = null;
private void jInit() throws Exception
{
// Create SpeechKit object
_SpeechKit = new JSpeechKit();
// Set credentials
_SpeechKit.setCredentials("Credentials");
_Recognizer = _SpeechKit.createMSPRecognizer();
if (_Recognizer != null)
{
// Set the callback object
_Recognizer.setChantSpeechKitEvents(this);
// Register Callbacks for receiving recognized speech.
_Recognizer.registerCallback(ChantSpeechKitCallback.CCSRRecognitionDictation);
}
_Synthesizer = _SpeechKit.createMSPSynthesizer();
if (_Synthesizer != null)
{
// Set the callback object
_Synthesizer.setChantSpeechKitEvents(this);
// Register for callbacks
_Synthesizer.registerCallback(ChantSpeechKitCallback.CCTTSWordPosition);
}
}
}
Not supported
Not supported
Dim _SpeechKit As NSpeechKit
Dim WithEvents _Recognizer As NMSPSynthesizer
Dim WithEvents _Synthesizer As NMSPSynthesizer
Private Sub Window_Loaded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded
' Instantiate SpeechKit
_SpeechKit = New NSpeechKit()
If (_SpeechKit IsNot Nothing) Then
' Set credentials
_SpeechKit.SetCredentials("Credentials")
_Recognizer = _SpeechKit.CreateMSPRecognizer()
_Synthesizer = _SpeechKit.CreateMSPSynthesizer()
End If
End Sub
Microsoft WindowsMedia (UWP and WinRT)
If you are developing Universal Windows Platform (UWP) or desktop (x86 and x64 via WinRT) applications on Microsoft Windows 10+, then no additional installation steps are required for accesing Microsoft WindowsMedia. Microsoft WindowsMedia is preinstalled. You must add required languages to the platform for speech services to be available in those languages.
WindowsMedia is the Chant library Windows platform default speech API.
For applications to use the WindowsMedia API, instantiate ChantRecognizer and ChantSynthesizer class object in your applications as follows:
private NSpeechKit _SpeechKit = null;
private NChantRecognizer _Recognizer = null;
private NChantSynthesizer _Synthesizer = null;
public MainWindow()
{
InitializeComponent();
// Instantiate SpeechKit
_SpeechKit = new NSpeechKit();
if (_SpeechKit != null)
{
// Set credentials
_SpeechKit.SetCredentials("Credentials");
_Recognizer = _SpeechKit.CreateChantRecognizer();
if (_Recognizer != null)
{
_Recognizer.RecognitionDictation += Recognizer_RecognitionDictation;;
}
_Synthesizer = _SpeechKit.CreateChantSynthesizer();
if (_Synthesizer != null)
{
_Synthesizer.WordPosition += Synthesizer_WordPosition;
}
}
}
protected:
CSpeechKit* _SpeechKit;
CChantRecognizer* _Recognizer;
CChantSynthesizer* _Synthesizer;
// Instantiate SpeechKit object
_SpeechKit = new CSpeechKit();
if (_SpeechKit =! NULL)
{
// Set credentials
_SpeechKit->SetCredentials(L"Credentials");
// Create recognizer
_Recognizer = _SpeechKit->CreateChantRecognizer();
if (_Recognizer != NULL)
{
// Register Event Handlers
_Recognizer->SetRecognitionDictation(RecognitionDictation);
}
// Create synthesizer
_Synthesizer = _SpeechKit->CreateChantSynthesizer();
if (_Synthesizer != NULL)
{
// Register Event Handlers
_Synthesizer->SetWordPosition(WordPosition);
}
}
private:
CSpeechKit* _SpeechKit;
CChantRecognizer* _Recognizer;
CChantSynthesizer* _Synthesizer;
// Instantiate SpeechKit object
_SpeechKit = new CSpeechKit();
if (_SpeechKit =! NULL)
{
// Set credentials
_SpeechKit->SetCredentials("Credentials");
// Create recognizer
_Recognizer = _SpeechKit->CreateChantRecognizer();
if (_Recognizer != NULL)
{
// Register Event Handlers
_Recognizer->SetRecognitionDictation(RecognitionDictation);
}
// Create synthesizer
_Synthesizer = _SpeechKit->CreateChantSynthesizer();
if (_Synthesizer != NULL)
{
// Register Event Handlers
_Synthesizer->SetWordPosition(WordPosition);
}
}
var
_SpeechKit: TSpeechKit;
_Recognizer: TChantRecognizer;
_Synthesizer: TChantSynthesizer;
// Instantiate SpeechKit object
_SpeechKit := TSpeechKit.Create();
if (_SpeechKit <> nil) then
begin
// Set credentials
_SpeechKit.SetCredentials('Credentials');
// Create recognizer
_Recognizer := _SpeechKit.CreateChantRecognizer();
if (_Recognizer <> nil) then
begin
// Register Event Handlers
_Recognizer.RecognitionDictation := RecognitionDictation;
end;
// Create synthesizer
_Synthesizer := _SpeechKit.CreateChantSynthesizer();
if (_Synthesizer <> nil) then
begin
// Register Event Handlers
_Synthesizer.WordPosition := WordPosition;
end;
end;
public class Frame1 extends JFrame implements com.SpeechKit.JChantSpeechKitEvents
{
private JSpeechKit _SpeechKit = null;
private JChantSynthesizer _Synthesizer = null;
private void jInit() throws Exception
{
// Create SpeechKit object
_SpeechKit = new JSpeechKit();
// Set credentials
_SpeechKit.setCredentials("Credentials");
_Synthesizer = _SpeechKit.createChantSynthesizer();
if (_Synthesizer != null)
{
// Set the callback object
_Synthesizer.setChantSpeechKitEvents(this);
// Register for callbacks
_Synthesizer.registerCallback(ChantSpeechKitCallback.CCTTSWordPosition);
}
}
}
Not supported
Not supported
Dim _SpeechKit As NSpeechKit
Dim WithEvents _Recognizer As NChantSynthesizer
Dim WithEvents _Synthesizer As NChantSynthesizer
Private Sub Window_Loaded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded
' Instantiate SpeechKit
_SpeechKit = New NSpeechKit()
If (_SpeechKit IsNot Nothing) Then
' Set credentials
_SpeechKit.SetCredentials("Credentials")
_Recognizer = _SpeechKit.CreateChantRecognizer()
_Synthesizer = _SpeechKit.CreateChantSynthesizer()
End If
End Sub