Speak Command

When using the Speak Command, is it possible to select a specific voice, or are you stuck with whatever is currently being used by the system?

Thanks!

Yes, stuck.
Or you use a plugin to change voice.

see NSSpeechSynthesizerMBS and WinSpeechMBS classes in MBS Plugins.

That’s what I thought. Before I invest money into a plugin, do you know if you’re able to sell apps on the App Store which use
Applescript?

No Plugin needed (at least on Mac). You may either use declares or just AppleScript.

From Proper way to execute an AppleScript? :

[code]Public Function ExecuteAppleScript(TheScript As String) as String
Soft Declare Function NSClassFromString Lib “Foundation” (classname As CFStringRef) As ptr
Soft Declare Function initWithSource Lib “Cocoa” selector “initWithSource:” (obj As ptr,source As CFStringRef) As ptr
Soft Declare Function executeAndReturnError Lib “Cocoa” selector “executeAndReturnError:” (obj As ptr,ByRef error As ptr) As ptr
Soft Declare Function alloc Lib “Cocoa” selector “alloc” (classRef As Ptr) As Ptr
Soft Declare Function autorelease Lib “Cocoa” selector “autorelease” (classRef As Ptr) As Ptr
Soft Declare Function stringValue Lib “Cocoa” selector “stringValue” (classRef As Ptr) As CFStringRef

Dim nsscript As ptr=autorelease(initWithSource(alloc(NSClassFromString(“NSAppleScript”)),TheScript)))
Dim err As ptr
Dim descriptor As ptr=executeAndReturnError(nsscript,err)
If descriptor = Nil Then
MsgBox “An error occured”
Else
Return stringValue(descriptor)
End If

End Function
[/code]

Now call it e.g. via

Call ExecuteAppleScript("say ""This is a test"" Using ""Anna""") Call ExecuteAppleScript("say ""This is a test"" Using ""Markus""")

[quote=377514:@Robert Campanaro]That’s what I thought. Before I invest money into a plugin, do you know if you’re able to sell apps on the App Store which use
Applescript?[/quote]

Yes, you can use AppleScript in a Mac App Store app, but System Events and Desktop are off limit.

MacOSlib offers several speech-options besides selecting any voice of your choice.

The 64bit version works too, although with this particular version (64bit) at present one cannot set the “speed-rate”.

Thanks, Michel. System Events were exactly what I wanted to use. I’ll look into MacOSlib as Carlo suggested.

Regards,
-Rob

[quote]MacOSlib offers several speech-options besides selecting any voice of your choice.

The 64bit version works too, although with this particular version (64bit) at present one cannot set the “speed-rate”.[/quote]

Thanks, Carlo. I’ll take a look at that. Speed-rate shouldn’t be an issue since I’m only interested in speaking one word at a time.

Regards,
-Rob

Thanks again, Carlo. I tried to reply in private thread but it was saying I don’t have permission; whatever that means. At any rate, I’m piecing together a test project now from the example. I’ll give you an update but it’s looking good so far.

-Rob

Glad if it helps.