how do I install OS X TTS voices from Objective-C - objective-c

OS X Lion comes with some fantastic voices from Nuance. I would like to use them from my software, however, currently they require the user to manually go to System Preferences, Dictation and Speech, System Voice -> Customize, then download the voices from Apple. I would like to call something from Objective-C so that that voices that are missing (say Chinese voices) are automatically downloaded in the background. How can this be done?
Incidentally, the available voices on the system can be found using
[NSSpeechSynthesizer availableVoices]
but all the possible voices (so far) can only be found in the Dictation and Speech dialog. Here is how it is done manually:

I highly doubt there is any reliable way to do this.
You should just point the user to a help page explaining the process (preferably a help page on apple's website if possible, since they'll keep it updated if the process changes).
You're going to need root access to do it, which is banned from App Store apps. And it almost certainly needs to tie into the software update process which is extremely complex, completely undocumented, and subject to change at any time.
Alternatively, contact nuance for a license to distribute the voices yourself. They are all for sale. Maybe you can even get a discounted price if you only install if on macs where the user can get them for free.

You can use this AppleScript to programmatically install TTS Voice, but MacOS is coming with all voices!
But Not all are showed in "Dictation & Speech->System Voice".
The reason is that they are very simple(compact) version and MacOS show only the full version of instaled Voice(s) like:"Alex".
Examples:
My Configuration:
You can see that I have only english voices but the next example work perfectly with spanish text.
Swift example:
var voice:NSSpeechSynthesizer = NSSpeechSynthesizer(voice: "com.apple.speech.synthesis.voice.diego")
voice.startSpeakingString("España y los españoles")
Terminal example:
say -v monica "En España a los españoles les encanta paella"

How to get the download list is a mystery... yet...
Using wireshark, it is possible to determine the voice location. Indeed a pkg is downloaded from Apple. Whether credentials, etc. are needed, is a separate issue.
Here are additional sample URLs:
/content/downloads/10/29/041-5265/kKRs5z32DcbrGdV4TZvY9hcqy8tcpkbX43/MLV_en_AU_karen.pkg
After download, could then run installer to install.
Update. I was able to download the pkg from Windows using http. Also, this other link
http://swcdn.apple.com/content/downloads/59/49/041-4469/WNshMBxxbxx5qXv27Mrvxm7yKcSRM75sVw/041-4469.English.dist
gives information about 041-4469 including the package name.

Related

How to get icon for network computer ( smb/afp ) on macOS based on type

Is it possible to get icon for network computer/ip address under macOS so iMac has iMac icon etc?
I am using NSNetServiceBrowser to get available services, but I do not know how to get icon like official Finder app does. Finder recognize icons for iMac, MacBookPro etc. Thanks.
I don't have a working solution for you, but I see your question didn't get much attention yet so maybe I can point you in the right direction.
Finder looks for services, and it will check if found services have "device info" associated with them. This is done via Bonjour, looking for a _device-info._tcp pseudo service. A lookup for a device info may return a Bonjour TXT record that indicates the model ID of the gizmo. If Finder succeeds in getting this info, then it assigns an icon accordingly, otherwise, it picks a generic icon.
The icons themselves seem to be stored here: /System/Library/CoreServices/CoreTypes.bundle (at least on my 10.13 machine). Check the Info.plist on that bundle, and the other bundles contained within, and you can find mappings between device types and icons.
There are some posts talking about how to customise the icon that's shown for certain devices:
Add custom network device icons in Mac OS X Finder?
Can you use Bonjour for Windows to broadcast a different icon than the Bluescreen?
I tried to follow the steps in this post to examine the model names advertised by some Apple hardware on my network, but couldn't make it work (either using the dig tool or with NSNetService) (although I admit I didn't try very hard with NSNetService as I'm not familiar with it).
This thread discusses potential problems and solutions, however the dig tool wouldn't work for me despite having both SMB and AFP over TCP enabled.
All of these threads are fairly old, although the commentary in the linked SO post suggest this still works at least as of Sierra.
Good luck!

TTS Installed voices in wp8.1

I'm trying to implement kind of translation application.
I consider using the TTS to "speak" the translated text, but when I tried to get the installed voices I get only 2 (en-US male and female).
I see in the MSDN that:
"Only Microsoft-signed voices installed on the system can be used to generate speech. If no language is specified, the voice that most closely matches the language selected by the user in the Language control panel is loaded."
So my question is: how can I get additional voices besides those who already installed in the device?
Thanks in advance,
As suggested by the MSDN article you quoted, the user can add voices by installing appropriate languages in the control panel. Apps will then have access to these voices.
Apps cannot add voices or use voices beyond what are installed on the device.

AirPlay API for Mac OS X

Is there currently any API (public or private) that will allow a 3rd party Mac OS X application to stream audio to AirPlay receivers? Airfoil by Rogue Amoeba Software seems to be able to do this, same goes for Erica Sadun's AirFlick, but I was unable to find any source code that would demonstrate how to do this. Any pointers are appreciated!
Here is an open source ruby implementation. It's pretty straight forward. https://github.com/elcuervo/airplay
It turns out AirPlay audio streaming is possible as of OS X 10.8 using public APIs, but wasn't really documented anywhere. Joris Kluivers wrote a great blog post on how to get it going.
There are a couple of open-source RAOP players available; I haven't tried them, so I don't know if Apple has broken them since they were written.
Mountain Lion (OS X 10.8) has added AirPlay support in the sound settings. The user can choose to send the local sound output to an AirPlay device. However, I don't think that you have access to any API within your app.
There are some libraries available to implement AirPlay, but know that Apple will reject your app if you try to publish it on the App Store. At least, that's what happened to me.
I wrote a node.js module to support AirPlay. Even if you don't use node, you can just pipe your audio data through stdin.
https://github.com/lperrin/node_airtunes/
I don't think it's available. At least not in versions prior to 10.7.
I'm guessing that Airfoil uses something like DVD John did a while ago when he cracked the Airport Express key payload. He released the code (C#) you should be able to find it but it's pretty cryptic.
I'm not aware of what AirFlick uses but you could always try pinging Erica, she usually shares her stuff.
Someone recently managed to obtain the AirPlay private key which allows you to have your program listed in the AirPlay menus on devices on your network.
You can read about it here. There is also an open source project linked from that page.
http://mafipulation.org/blagoblig/2011/04/08#shairport
Be aware that obviously any application you create will never be approved by apple and the private key could potentially be changed in a firmware/software update.

How to access device settings on a Sony Ericsson mobile phone?

Edited on April 29th, content changed
Hello everyone,
I recently bought a Sony Ericsson mobile phone and I would like to add a missing feature myself. In fact I cannot actually disable Internet connection in an easy way when roaming, which cost me a lot of money last time I moved away ... So I would like to develop a little application that would just replace the actual Internet configuration with a fake configuration to avoid auto-connections.
So what I would like to know is how can I access programmatically to my phone settings? I know that Sony Ericsson provides a SDK to run Java applications on its customised JVM. So what I am actually looking for is to know if they extended the J2ME functionality to fit their devices requirements.
This is not well documented so I am asking this question with the hope that someone here already had experience with development targeted for Sony Ericsson devices.
Thanks.
NB: This is a Sony Ericsson Elm which is based on the Sony Ericsson OS with SE Java Platform 8.5.
Edit: I accepted QuickRecipesOnSymbianOS answer as it gave me a clue on the only feature that could have helped me, but which is unfornatunately missing. The Sony Ericsson Java Platform is the only API I could use to develop real programs on my phone. But the JP-8.5 does not implement the JSR-307 package which could help me in managing APN. Thanks everyone for your help.
Well, I hope you got the great Vivaz phone, not the Satio.
In order to learn about Symbian OS C++, first go to the Foundation website.
Relevant plug: the latest introduction to Symbian OS C++ in book form is Quick Recipes on Symbian OS
For now, you won't find a better way than Symbian OS C++ to manipulate your handset access points.
JavaME simply doesn't have the correct APIs for this, at least not until JSR-307 is implemented.
I believe Qt isn't integrated quite tightly enough just yet either but that should change soon enough. Keep an eye on it.
Extending the Symbian Python runtime to do what you want would require some Symbian OS C++ anyway.
Yes you will need to use Symbian C++ to modify the CommDB, which holds the list of connections. It is quite painful to work with it directly, but there are some utility classes that can help you out. Take a look at CApSelect, CApDataHandler and CApAccessPointItem, all in the developer library.
And yes, these will work on all modern Symbian handsets, independent of brand.
Note: My answer below assumed it was about a symbian device. Since it was actually a J2me device none of the below applies
The easiest way to achieve what you want to do is probably to just remove all the "destinations" when you want to prevent auto connections. Otherwise the device will test each destination in turn until it finds one that works.
You can also set up your destinations so that they are not allowed to be used automatically. This setting must be done individually for each destination.
You can also group your destinations and set one of the groups to the default. If you set the default to an empty group you should not get any automatic connections.
Note that I have not tested any of these methods myself. When I roam I turn off automatic updates in the apps that use them. Some apps can even detect when you are roaming and avoid auto connects.
There are S60 apps available that improves the connection management of vanilla S60, but I do not know if any of them can help you with your problem.
If you are dead set on doing the programming yourself you have to use the C++ SDK for Symbian S60 available from Forum Nokia. Java ME does not allow you to manipulate the destinations of the device.
The Elm device should have (I haven't verified this) the access point API originally designed by Nokia. Not sure whether you can use it for the purpose you want though. The J2me developer guidelines available from developer.sonyericsson.com should have all the information you need.

Developing for iPhone on a PC? [duplicate]

This question already exists:
Closed 11 years ago.
Possible Duplicate:
iPhone development on Windows
Is it possible to create iPhone apps using a PC? I'm running windows vista and I want to learn objective-c, what better way can you be motivated then the potential to create something that someone, somewhere might use.
Are there any hacks that allow would allow me to make the apps?
Unfortunately this is not supported. Developing for the iPhone requires Xcode and Apple's gcc tool chain, and it is only supported on Intel Mac OS X (although some have gotten it to work on PPC Mac OS X).
NilObject is right that you can only develop for the iPhone officially on a recent (last few years) Mac with OS X.
That said, Objective-C isn't tied to the iPhone. You can write programs for your PC in Objective-C, which would give you experience without needing the iPhone and Mac. Objective-C is a standard part of the GNU Compiler Collection (GCC). It's rather easy to install with Cygwin.
If you really want to make iPhone applications, you should consider a Mac. You'll get all sorts of experience and can also program for OS X then. Since laptops were just released, many people are selling their previous models because they have upgraded. If you can find an old Intel chip based Mac Mini, it won't cost you much at all (a few hundred), but it won't be fast. The recent Minis haven't been updated in a very long time and are not a very good value anymore for their new price (in my opinion), but they may be available cheap too.
actually, there's an unofficial toolchain that works in windows and linux. you'll need cygwin installed on your pc to be able to work with it in windows.
here's a link to the basic setup: link
though this will not allow you to publish to the AppStore, it's just a good way to mess around with the SDK. Also, whenever Apple updates the iPhone firmware, you'll need to find/wait for the updated toolchain or do some hacking of your own to get the updates headers, etc...
Don't bother. I had a hackintosh and while it worked, Apple can (and does) regularly update the SDK's minimum platform requirement, which means your hackintosh won't be able to keep pace with the new cool features in the SDK, since Kalyway and whoever else need time to reverse engineer kexts or whatever to figure out the new OS.
If you're serious about iPhone, get a Mac. You could probably find a first gen Mac mini (intel) for a couple hundred bucks. Or spring for a macbook and be psyched. The new ones are awfully nice.
Lucas Aardvark wrote:
I am going to get a mac. Just gotta save up a little money ;-)
Although I thoroughly agree with the consensus: get a Mac, I just wanted to add a little based on this comment you left:
If you are planning to enter the iPhone arena to do one of those Cinderella ten-million downloads at a buck a pop stories you hear about, you'll need a killer app, something new and exciting. Good luck with that; I'm not gonna share my ideas with you, 'cause I'm trying to do the same. :)
That said, I'm in the same boat as you -- I don't have the extra green to buy a Mac -- so I will share some general advice that might help.
Rather than enter the iPhone arena, I've been looking into leveraging my Java skills on the Android phone first. Once I make a few bucks doing that, I'll buy a Mac and learn Objective-C and port my program(s) over. Since Android uses Java and is free/open source, I'm only out the twenty-five bucks to create a publisher account; I can do the rest with Eclipse on any platform I have.
I don't know if it will help you much, but it might be a more cost-effective way to write your Cinderella story. :)