Thanks, Sergey! Getting this to work is integral to the new functionality of my app. It would be such a waste of time if switching languages doesn’t work…
Yeah, and while you´re at it… I haven’t been able to get a single sound (speech) out of any iOS device for a while now. The device log from an attempt to say “horse” in English below:
Oct 20 22:33:32 Jenny-sin-iPhone Karate Squid[481] \<Notice\>: Speaking 'Horse' in en-GB Oct 20 22:33:32 Jenny-sin-iPhone Karate Squid[481] \<Notice\>: speech(Horse, nil, nil, nil) Oct 20 22:33:32 Jenny-sin-iPhone Karate Squid(AXSpeechImplementation)[481] \<Info\>: Using voice from language en-gb default: com.apple.ttsbundle.Daniel-compact Oct 20 22:33:32 Jenny-sin-iPhone mediaserverd(AudioToolbox)[23] \<Notice\>: 2577: ----\> sid:0x1804f, Karate Squid(481), 'prim' inActive = true, inFlags = 0 Oct 20 22:33:32 Jenny-sin-iPhone mediaserverd(AudioToolbox)[23] \<Notice\>: 3951: sid:0x1804f, Karate Squid(481), 'prim', playerref=0x1010af600, modes=Output(2), state=Started Oct 20 22:33:32 Jenny-sin-iPhone mediaserverd(AudioToolbox)[23] \<Notice\>: 3997: 0 running inputs, 2 running outputs, 0 running processors, 0 active nodes Oct 20 22:33:32 Jenny-sin-iPhone mediaserverd(AudioToolbox)[23] \<Info\>: 3243: aq@0x1010af600 volume 1.000 1.000 1.000 1.000 0.000 Oct 20 22:33:32 Jenny-sin-iPhone mediaserverd(AudioToolbox)[23] \<Notice\>: 194: AQME device AQDefaultDevice: client starting: \<AudioQueueObject@0x1010af600; sid:0x1804f, Karate Squid(481), 'prim'; play\>; running count now 2 Oct 20 22:33:32 Jenny-sin-iPhone routined(libcoreroutine.dylib)[27] \<Debug\>: caching CMMotionActivity, \<private\>, RTMotionActivity, \<private\> Oct 20 22:33:32 Jenny-sin-iPhone locationd[58] \<Notice\>: message 'kCLConnectionMessageWatchdog' received from client '/System/Library/PrivateFrameworks/AssistantServices.framework' Oct 20 22:33:33 Jenny-sin-iPhone CommCenter(libBasebandUSB.dylib)[73] \<Info\>: got kIOMessageDeviceHasPoweredOn, arg 0x16f4ca20c Oct 20 22:33:33 Jenny-sin-iPhone CommCenter(libBasebandUSB.dylib)[73] \<Info\>: event 3, error 0 (\<private\>) Oct 20 22:33:33 Jenny-sin-iPhone CommCenter(libBasebandUSB.dylib)[73] \<Info\>: fDeviceState is 1 Oct 20 22:33:33 Jenny-sin-iPhone CommCenter(libBasebandUSB.dylib)[73] \<Info\>: 3. got device event kResumed Oct 20 22:33:33 Jenny-sin-iPhone CommCenter(libBasebandUSB.dylib)[73] \<Info\>: 3. Resume transfer for type 1 Oct 20 22:33:33 Jenny-sin-iPhone CommCenter(libBasebandUSB.dylib)[73] \<Info\>: 5. got device event kResumed Oct 20 22:33:33 Jenny-sin-iPhone CommCenter(libBasebandUSB.dylib)[73] \<Info\>: 5. Resume transfer for type 1 Oct 20 22:33:33 Jenny-sin-iPhone CommCenter(libBasebandUSB.dylib)[73] \<Info\>: 7. got device event kResumed Oct 20 22:33:33 Jenny-sin-iPhone CommCenter(libBasebandUSB.dylib)[73] \<Info\>: 7. Resume transfer for type 1 Oct 20 22:33:33 Jenny-sin-iPhone CommCenter(libBasebandUSB.dylib)[73] \<Info\>: 9. got device event kResumed Oct 20 22:33:33 Jenny-sin-iPhone CommCenter(libBasebandUSB.dylib)[73] \<Info\>: 9. Resume transfer for type 1 Oct 20 22:33:33 Jenny-sin-iPhone CommCenter(libBasebandUSB.dylib)[73] \<Info\>: 11. got device event kResumed Oct 20 22:33:33 Jenny-sin-iPhone CommCenter(libBasebandUSB.dylib)[73] \<Info\>: 11. Resume transfer for type 1 Oct 20 22:33:33 Jenny-sin-iPhone CommCenter(libBasebandUSB.dylib)[73] \<Info\>: fDeviceState is 2 Oct 20 22:33:33 Jenny-sin-iPhone CommCenter(libATCommandStudioDynamic.dylib)[73] \<Notice\>: QMI: Svc=0x03(NAS) Ind MsgId=0x0051 Bin=['01 15 00 80 03 01 04 00 00 51 00 09 00 14 06 00 A8 F6 8B FF 36 00'] Oct 20 22:33:33 Jenny-sin-iPhone CommCenter(libBasebandUSB.dylib)[73] \<Info\>: got kIOMessageDeviceWillPowerOff, arg 0x16f4ca20c Oct 20 22:33:33 Jenny-sin-iPhone CommCenter(libBasebandUSB.dylib)[73] \<Info\>: event 2, error 0 (\<private\>) Oct 20 22:33:33 Jenny-sin-iPhone CommCenter(libBasebandUSB.dylib)[73] \<Info\>: 3. got device event kSuspended Oct 20 22:33:33 Jenny-sin-iPhone CommCenter(libBasebandUSB.dylib)[73] \<Info\>: 5. got device event kSuspended Oct 20 22:33:33 Jenny-sin-iPhone CommCenter(libBasebandUSB.dylib)[73] \<Info\>: 7. got device event kSuspended Oct 20 22:33:33 Jenny-sin-iPhone CommCenter(libBasebandUSB.dylib)[73] \<Info\>: 9. got device event kSuspended Oct 20 22:33:33 Jenny-sin-iPhone CommCenter(libBasebandUSB.dylib)[73] \<Info\>: 11. got device event kSuspended Oct 20 22:33:33 Jenny-sin-iPhone routined(libcoreroutine.dylib)[27] \<Debug\>: caching CMMotionActivity, \<private\>, RTMotionActivity, \<private\> Oct 20 22:33:33 Jenny-sin-iPhone mediaserverd(AudioToolbox)[23] \<Notice\>: 350: AQME device AQDefaultDevice: client stopping: \<AudioQueueObject@0x1010af600; sid:0x1804f, Karate Squid(481), 'prim'; play\>; running count now 1 Oct 20 22:33:33 Jenny-sin-iPhone mediaserverd(AudioToolbox)[23] \<Notice\>: 3951: sid:0x1804f, Karate Squid(481), 'prim', playerref=0x1010af600, modes=Output(2), state=Stopped Oct 20 22:33:33 Jenny-sin-iPhone mediaserverd(AudioToolbox)[23] \<Notice\>: 3997: 0 running inputs, 1 running outputs, 0 running processors, 0 active nodes Oct 20 22:33:34 Jenny-sin-iPhone CommCenter(libBasebandUSB.dylib)[73] \<Info\>: got kIOMessageDeviceHasPoweredOn, arg 0x16f4ca20c Oct 20 22:33:34 Jenny-sin-iPhone CommCenter(libBasebandUSB.dylib)[73] \<Info\>: event 3, error 0 (\<private\>) Oct 20 22:33:34 Jenny-sin-iPhone CommCenter(libBasebandUSB.dylib)[73] \<Info\>: fDeviceState is 1 Oct 20 22:33:34 Jenny-sin-iPhone CommCenter(libBasebandUSB.dylib)[73] \<Info\>: 3. got device event kResumed Oct 20 22:33:34 Jenny-sin-iPhone CommCenter(libBasebandUSB.dylib)[73] \<Info\>: 3. Resume transfer for type 1 Oct 20 22:33:34 Jenny-sin-iPhone CommCenter(libBasebandUSB.dylib)[73] \<Info\>: 5. got device event kResumed Oct 20 22:33:34 Jenny-sin-iPhone CommCenter(libBasebandUSB.dylib)[73] \<Info\>: 5. Resume transfer for type 1 Oct 20 22:33:34 Jenny-sin-iPhone CommCenter(libBasebandUSB.dylib)[73] \<Info\>: 7. got device event kResumed Oct 20 22:33:34 Jenny-sin-iPhone CommCenter(libBasebandUSB.dylib)[73] \<Info\>: 7. Resume transfer for type 1 Oct 20 22:33:34 Jenny-sin-iPhone CommCenter(libBasebandUSB.dylib)[73] \<Info\>: 9. got device event kResumed Oct 20 22:33:34 Jenny-sin-iPhone CommCenter(libBasebandUSB.dylib)[73] \<Info\>: 9. Resume transfer for type 1 Oct 20 22:33:34 Jenny-sin-iPhone CommCenter(libBasebandUSB.dylib)[73] \<Info\>: 11. got device event kResumed Oct 20 22:33:34 Jenny-sin-iPhone CommCenter(libBasebandUSB.dylib)[73] \<Info\>: 11. Resume transfer for type 1 Oct 20 22:33:34 Jenny-sin-iPhone CommCenter(libBasebandUSB.dylib)[73] \<Info\>: fDeviceState is 2 Oct 20 22:33:34 Jenny-sin-iPhone CommCenter(libATCommandStudioDynamic.dylib)[73] \<Notice\>: QMI: Svc=0x03(NAS) Ind MsgId=0x0061 Bin=[\<private\>] Oct 20 22:33:34 Jenny-sin-iPhone CommCenter(libCommCenterMCommandDrivers.dylib)[73] \<Notice\>: #reg.qmi #I Received current PLMN indication from baseband Oct 20 22:33:34 Jenny-sin-iPhone CommCenter(libCommCenterMCommandDrivers.dylib)[73] \<Notice\>: #reg.qmi #I Received long name (\<private\>) short name (\<private\>) service provider name (\<private\>) and name source (NetworkNameSource::kSourceOPL)
Also for this problem I’ve made a supersimple example:
main.lua:
W = display.actualContentWidth texttospeech = require("plugin.texttospeech") function initCB(e) txt = "------------------------- texttospeech.init() - Is error: " .. tostring(e.isError) print(txt) display.newText(txt, W/2, 300, native.systemFont, 0.03\*W) end texttospeech.init(initCB) texttospeech.speak(txt, {language = "en-GB"})
build.settings:
settings = { plugins = { ["plugin.texttospeech"] = { publisherId = "com.spiralcodestudio" }, }, }
Note, the text2speech works well on Android.
Here’s the device log from the init allback and on. Init seems to work well, but I don’t hear anything. Tested on an iPhone 5S and an iPad 3(?) iOS 10.0.2.
Oct 20 22:56:51 Jenny-sin-iPhone Text2Speech[555] \<Notice\>: ------------------------- texttospeech.init() - Is error: false Oct 20 22:56:51 Jenny-sin-iPhone mobileassetd[143] \<Notice\>: 0x1032233d0 Main Listener: XPC\_TYPE\_CONNECTION \<connection: 0x1032233d0\> { name = com.apple.mobileassetd (peer), listener = false, pid = 555, euid = 501, egid = 501, asid = 0 } Oct 20 22:56:51 Jenny-sin-iPhone mobileassetd[143] \<Notice\>: 0x1033de940 Client connection: XPC\_TYPE\_DICTIONARY \<dictionary: 0x1033de940\> { count = 6, transaction: 1, voucher = 0x10324a360, contents = "AssetType" =\> \<string: 0x1002bc370\> { length = 42, contents = "com.apple.MobileAsset.MacinTalkVoiceAssets" } "Predicate" =\> \<data: 0x1037402d0\>: { length = 1202 bytes, contents = 0x62706c6973743030d40102030405065e5f58247665727369... } "Local Cache Only" =\> \<bool: 0x1a38bb9e0\>: true "Timeout" =\> \<double: 0x1002b54e0\>: 15.000000 "\_IPC\_TYPE" =\> \<uint64: 0x1002b4280\>: 13 "ClientName" =\> \<string: 0x10342b9f0\> { length = 11, contents = "Text2Speech" } } Oct 20 22:56:51 Jenny-sin-iPhone mobileassetd[143] \<Notice\>: HANDLER - assetQuery [com.apple.MobileAsset.MacinTalkVoiceAssets]: (local=1) [Name == "Alex"] Oct 20 22:56:51 Jenny-sin-iPhone Text2Speech(MobileAsset)[555] \<Notice\>: 0x17414c760 Copy matching assets reply: XPC\_TYPE\_DICTIONARY \<dictionary: 0x17414c760\> { count = 2, transaction: 0, voucher = 0x0, contents = "Assets" =\> \<data: 0x17427e080\>: { length = 1229 bytes, contents = 0x62706c6973743030d4010203040506646558247665727369... } "Result" =\> \<int64: 0x1742285e0\>: 0 } Oct 20 22:56:51 Jenny-sin-iPhone mobileassetd[143] \<Notice\>: 0x1002b5e00 Main Listener: XPC\_TYPE\_CONNECTION \<connection: 0x1002b5e00\> { name = com.apple.mobileassetd (peer), listener = false, pid = 555, euid = 501, egid = 501, asid = 0 } Oct 20 22:56:51 Jenny-sin-iPhone mobileassetd[143] \<Notice\>: 0x1a38bbbc0 Client connection: XPC\_TYPE\_ERROR Connection invalid \<error: 0x1a38bbbc0\> { count = 1, transaction: 0, voucher = 0x0, contents = "XPCErrorDescription" =\> \<string: 0x1a38bbe18\> { length = 18, contents = "Connection invalid" } } Oct 20 22:56:51 Jenny-sin-iPhone mobileassetd[143] \<Notice\>: Client connection invalid (Connection invalid); terminating connection Oct 20 22:56:51 Jenny-sin-iPhone mobileassetd[143] \<Notice\>: 0x1002cb130 Client connection: XPC\_TYPE\_DICTIONARY \<dictionary: 0x1002cb130\> { count = 5, transaction: 1, voucher = 0x103409750, contents = "AssetType" =\> \<string: 0x1034097d0\> { length = 42, contents = "com.apple.MobileAsset.MacinTalkVoiceAssets" } "AssetProperties" =\> \<dictionary: 0x103730de0\> { count = 16, transaction: 0, voucher = 0x0, contents = "Name" =\> \<string: 0x103744a20\> { length = 4, contents = "Alex" } "\_CompressionAlgorithm" =\> \<string: 0x103449040\> { length = 3, contents = "zip" } "FormatVersion" =\> \<string: 0x10373c240\> { length = 1, contents = "1" } "\_DownloadSize" =\> \<int64: 0x1002b40f0\>: 884181650 "\_MasteredVersion" =\> \<string: 0x103442d30\> { length = 4, contents = "1978" } "\_MeasurementAlgorithm" =\> \<string: 0x10342b9f0\> { length = 5, contents = "SHA-1" } "\_\_CanUseLocalCacheServer" =\> \<bool: 0x1a38bb9e0\>: true "\_\_RelativePath" =\> \<string: 0x1002c13f0\> { length = 87, contents = "com\_apple\_MobileAsset\_MacinTalkVoiceAssets/d0b8c5e4dc39f60e04de2428553b66cf721ef388.zip" } "Language" =\> \<string: 0x103732120\> { length = 5, co Oct 20 22:56:51 Jenny-sin-iPhone mobileassetd[143] \<Notice\>: [Text2Speech] HANDLER - copyAssetAttributes [com.apple.MobileAsset.MacinTalkVoiceAssets]: com\_apple\_MobileAsset\_MacinTalkVoiceAssets/d0b8c5e4dc39f60e04de2428553b66cf721ef388.zip Oct 20 22:56:51 Jenny-sin-iPhone Text2Speech(MobileAsset)[555] \<Notice\>: 0x17014e440 Copy assets attributes reply: XPC\_TYPE\_DICTIONARY \<dictionary: 0x17014e440\> { count = 1, transaction: 0, voucher = 0x0, contents = "Result" =\> \<int64: 0x170225200\>: 1 } Oct 20 22:56:51 Jenny-sin-iPhone Text2Speech(MobileAsset)[555] \<Notice\>: [MobileAssetError:1] Unable to copy asset attributes Oct 20 22:56:51 Jenny-sin-iPhone Text2Speech(MobileAsset)[555] \<Notice\>: Could not get attribute 'LocalURL': Error Domain=MobileAssetError Code=1 "Unable to copy asset attributes" UserInfo={NSDescription=Unable to copy asset attributes} Oct 20 22:56:51 Jenny-sin-iPhone mobileassetd[143] \<Notice\>: No matching entries found Oct 20 22:56:51 Jenny-sin-iPhone Text2Speech(libsystem\_trace.dylib)[555] \<Notice\>: subsystem: com.apple.Accessibility, category: AVSpeechSynthesis, enable\_level: 0, persist\_level: 0, default\_ttl: 0, info\_ttl: 0, debug\_ttl: 0, generate\_symptoms: 0, enable\_oversize: 1, privacy\_setting: 2, enable\_private\_data: 0 Oct 20 22:56:51 Jenny-sin-iPhone Text2Speech(AXSpeechImplementation)[555] \<Info\>: Using voice from language en-gb default: com.apple.ttsbundle.Daniel-compact Oct 20 22:56:51 Jenny-sin-iPhone mobileassetd[143] \<Notice\>: Could not load local info Oct 20 22:56:51 Jenny-sin-iPhone mediaserverd(AudioToolbox)[23] \<Notice\>: 2577: ----\> sid:0x1807e, Text2Speech(555), 'prim' inActive = true, inFlags = 0 Oct 20 22:56:51 Jenny-sin-iPhone mobileassetd[143] \<Notice\>: Could not determine local download state: 1 Oct 20 22:56:51 Jenny-sin-iPhone mediaserverd(CoreMedia)[23] \<Notice\>: -CMSessionMgr- CMSession: 'sid:0x1807e, Text2Speech(555), 'prim'' going active Oct 20 22:56:51 Jenny-sin-iPhone mobileassetd[143] \<Notice\>: No matching entries found Oct 20 22:56:51 Jenny-sin-iPhone mobileassetd[143] \<Notice\>: Could not load local info Oct 20 22:56:51 Jenny-sin-iPhone mobileassetd[143] \<Notice\>: [Text2Speech] Asset is not present locally [com.apple.MobileAsset.MacinTalkVoiceAssets][com\_apple\_MobileAsset\_MacinTalkVoiceAssets/d0b8c5e4dc39f60e04de2428553b66cf721ef388.zip]: 1 \<MobileAssetAsset 0x103430e80 assetType="com.apple.MobileAsset.MacinTalkVoiceAssets" assetProperties=\<CFBasicHash 0x103433c00 [0x1a999bbb8]\>{type = mutable dict, count = 16, entries =\> 1 : \<CFString 0x103246c80 [0x1a999bbb8]\>{contents = "\_UnarchivedSize"} = \<CFNumber 0xb0000003657a0003 [0x1a999bbb8]\>{value = +911712256, type = kCFNumberSInt64Type} 4 : Name = Alex 5 : \<CFString 0x1036ed670 [0x1a999bbb8]\>{contents = "\_\_RelativePath"} = \<CFString 0x1036ed600 [0x1a999bbb8]\>{contents = "com\_apple\_MobileAsset\_MacinTalkVoiceAssets/d0b8c5e4dc39f60e04de2428553b66cf721ef388.zip"} 7 : \<CFString 0x1032d0340 [0x1a999bbb8]\>{contents = "\_MeasurementAlgorithm"} = SHA-1 9 : \<CFString 0x1032768e0 [0x1a999bbb8]\>{contents = "\_CompressionAlgorithm"} = zip 10 : \<CFString 0x1036ed5d0 [0x1a999bbb8]\>{contents = "\_\_CanUseLocalCacheServer"} = \<CFBoolean 0x1a999c110 [0x1a999bbb8]\>{value = Oct 20 22:56:51 Jenny-sin-iPhone mobileassetd[143] \<Notice\>: mobileassetd - \_localURLForAsset: [Text2Speech] \_localURLForAsset[com.apple.MobileAsset.MacinTalkVoiceAssets]: unable to get local URL for asset: Error Domain=MobileAssetError Code=1 "(null)" [com\_apple\_MobileAsset\_MacinTalkVoiceAssets/d0b8c5e4dc39f60e04de2428553b66cf721ef388.zip] Oct 20 22:56:51 Jenny-sin-iPhone mediaserverd(VirtualAudio)[23] \<Notice\>: 2264: Route configuration change requested using route configuration [voice processing configuration: []; sub-port preferences: { }; device hints: { \<CFData 0x10024d9e0 [0x1a999bbb8]\>{length = 48, capacity = 48, bytes = 0x666564767472736e626f6c6700000000 ... 7821bf0301000000} }; mode: 1768776806; category: 1668505974 ]. Oct 20 22:56:51 Jenny-sin-iPhone mediaserverd(VirtualAudio)[23] \<Info\>: 1222: Port update with port map { 'fcru': { } }. Oct 20 22:56:51 Jenny-sin-iPhone mediaserverd(VirtualAudio)[23] \<Info\>: 2647: Set route configuration [Category: csav; Mode: imdf; Screen Dark Policy: 0; Stream Coupling Policy: couple]. Oct 20 22:56:51 Jenny-sin-iPhone mediaserverd(VirtualAudio)[23] \<Notice\>: 1882: Client request to set nominal sample rate to 44100.000000 on VAD 370. Oct 20 22:56:51 Jenny-sin-iPhone mediaserverd(CoreMedia)[23] \<Notice\>: -CMVAEndptMgr- CMSession: Setting volume = 0.861 for device ID: 370 Oct 20 22:56:51 Jenny-sin-iPhone mediaserverd(VirtualAudio)[23] \<Info\>: 228: Client request to get virtual format ([32/44100/1; flags: 0x29; bpp: 4; fpp: 1; Bpf: 4]) on virtual audio stream 579. Oct 20 22:56:51 Jenny-sin-iPhone mediaserverd(CoreMedia)[23] \<Notice\>: -CMVAEndptMgr- CMSession: Setting volume = 0.861 for device ID: 370 Oct 20 22:56:51 Jenny-sin-iPhone mediaserverd(VirtualAudio)[23] \<Info\>: 228: Client request to get virtual format ([32/44100/1; flags: 0x29; bpp: 4; fpp: 1; Bpf: 4]) on virtual audio stream 579. Oct 20 22:56:51 Jenny-sin-iPhone mediaserverd(VirtualAudio)[23] \<Notice\>: 1882: Client request to set nominal sample rate to 44100.000000 on VAD 370. Oct 20 22:56:51 Jenny-sin-iPhone mediaserverd(AudioToolbox)[23] \<Info\>: 3258: sid:0x1807e, Text2Speech(555), 'prim', propertyID: 'pckr' Oct 20 22:56:51 Jenny-sin-iPhone SpringBoard(TelephonyUtilities)[52] \<Notice\>: Pickable Routes Changed: \<private\> Oct 20 22:56:51 Jenny-sin-iPhone SpringBoard(TelephonyUtilities)[52] \<Notice\>: Cached pickable routes for PhoneCall: \<private\> Oct 20 22:56:51 Jenny-sin-iPhone SpringBoard(TelephonyUtilities)[52] \<Notice\>: Cached pickable routes for PlayAndRecordVideo: \<private\> Oct 20 22:56:51 Jenny-sin-iPhone SpringBoard(TelephonyUtilities)[52] \<Notice\>: Cached pickable routes for PlayAndRecordVoice: \<private\> Oct 20 22:56:51 Jenny-sin-iPhone SpringBoard(TelephonyUtilities)[52] \<Notice\>: Cached pickable routes for PlayAndRecordRemoteVoice: \<private\> Oct 20 22:56:51 Jenny-sin-iPhone SpringBoard(TelephonyUtilities)[52] \<Notice\>: Cached pickable routes for Voicemail: \<private\> Oct 20 22:56:51 Jenny-sin-iPhone mediaserverd(AudioToolbox)[23] \<Info\>: 3258: sid:0x1804f, Karate Squid(481), 'prim', propertyID: 'pckr' Oct 20 22:56:51 Jenny-sin-iPhone mediaserverd(AudioToolbox)[23] \<Info\>: 3258: sid:0x17d6c, coreduetd(424), 'prim', propertyID: 'pckr' Oct 20 22:56:51 Jenny-sin-iPhone mediaserverd(AudioToolbox)[23] \<Info\>: 3258: sid:0x17ce5, InCallService(308), 'prim', propertyID: 'pckr' Oct 20 22:56:51 Jenny-sin-iPhone mediaserverd(AudioToolbox)[23] \<Info\>: 3258: sid:0x17009, callservicesd(107), 'prim', propertyID: 'pckr' Oct 20 22:56:51 Jenny-sin-iPhone mediaserverd(AudioToolbox)[23] \<Info\>: 3258: sid:0x17007, wifid(37), 'prim', propertyID: 'pckr' Oct 20 22:56:51 Jenny-sin-iPhone mediaserverd(AudioToolbox)[23] \<Info\>: 3258: sid:0x17005, CommCenter(73), 'prim', propertyID: 'pckr' Oct 20 22:56:51 Jenny-sin-iPhone mediaserverd(VirtualAudio)[23] \<Info\>: 1511: Converting RemoteVoiceChat mode to VoiceChat mode since the VP is not (yet) in use Oct 20 22:56:51 Jenny-sin-iPhone mediaserverd(VirtualAudio)[23] \<Info\>: 1511: Converting RemoteVoiceChat mode to VoiceChat mode since the VP is not (yet) in use Oct 20 22:56:51 Jenny-sin-iPhone mediaserverd(VirtualAudio)[23] \<Info\>: 1511: Converting RemoteVoiceChat mode to VoiceChat mode since the VP is not (yet) in use Oct 20 22:56:51 Jenny-sin-iPhone mediaserverd(VirtualAudio)[23] \<Info\>: 1511: Converting RemoteVoiceChat mode to VoiceChat mode since the VP is not (yet) in use Oct 20 22:56:51 Jenny-sin-iPhone mediaserverd(VirtualAudio)[23] \<Info\>: 1511: Converting RemoteVoiceChat mode to VoiceChat mode since the VP is not (yet) in use Oct 20 22:56:51 Jenny-sin-iPhone mediaserverd(VirtualAudio)[23] \<Info\>: 1511: Converting RemoteVoiceChat mode to VoiceChat mode since the VP is not (yet) in use Oct 20 22:56:51 Jenny-sin-iPhone mediaserverd(VirtualAudio)[23] \<Info\>: 1511: Converting RemoteVoiceChat mode to VoiceChat mode since the VP is not (yet) in use Oct 20 22:56:51 Jenny-sin-iPhone mediaserverd(VirtualAudio)[23] \<Info\>: 1511: Converting RemoteVoiceChat mode to VoiceChat mode since the VP is not (yet) in use Oct 20 22:56:51 Jenny-sin-iPhone mediaserverd(VirtualAudio)[23] \<Info\>: 1511: Converting RemoteVoiceChat mode to VoiceChat mode since the VP is not (yet) in use Oct 20 22:56:51 Jenny-sin-iPhone mediaserverd(VirtualAudio)[23] \<Info\>: 1511: Converting RemoteVoiceChat mode to VoiceChat mode since the VP is not (yet) in use Oct 20 22:56:51 Jenny-sin-iPhone mediaserverd(VirtualAudio)[23] \<Info\>: 1511: Converting RemoteVoiceChat mode to VoiceChat mode since the VP is not (yet) in use Oct 20 22:56:51 Jenny-sin-iPhone InCallService(TelephonyUtilities)[308] \<Notice\>: Pickable Routes Changed: \<private\> Oct 20 22:56:51 Jenny-sin-iPhone InCallService(TelephonyUtilities)[308] \<Notice\>: Cached pickable routes for PhoneCall: \<private\> Oct 20 22:56:51 Jenny-sin-iPhone InCallService(TelephonyUtilities)[308] \<Notice\>: Cached pickable routes for PlayAndRecordVideo: \<private\> Oct 20 22:56:51 Jenny-sin-iPhone InCallService(TelephonyUtilities)[308] \<Notice\>: Cached pickable routes for PlayAndRecordVoice: \<private\> Oct 20 22:56:51 Jenny-sin-iPhone InCallService(TelephonyUtilities)[308] \<Notice\>: Cached pickable routes for PlayAndRecordRemoteVoice: \<private\> Oct 20 22:56:51 Jenny-sin-iPhone InCallService(TelephonyUtilities)[308] \<Notice\>: Cached pickable routes for Voicemail: \<private\> Oct 20 22:56:51 Jenny-sin-iPhone InCallService(AVFAudio)[308] \<Info\>: AVAudioSession.mm:2227:-[AVAudioSession privateHandlePickableRoutesChange]: Notifying listeners that pickable routes changed Oct 20 22:56:51 Jenny-sin-iPhone CommCenter(AVFAudio)[73] \<Info\>: AVAudioSession.mm:2227:-[AVAudioSession privateHandlePickableRoutesChange]: Notifying listeners that pickable routes changed Oct 20 22:56:51 Jenny-sin-iPhone wifid(AVFAudio)[37] \<Info\>: AVAudioSession.mm:2227:-[AVAudioSession privateHandlePickableRoutesChange]: Notifying listeners that pickable routes changed Oct 20 22:56:51 Jenny-sin-iPhone mobileassetd[143] \<Notice\>: 0x1002c3800 Main Listener: XPC\_TYPE\_CONNECTION \<connection: 0x1002c3800\> { name = com.apple.mobileassetd (peer), listener = false, pid = 555, euid = 501, egid = 501, asid = 0 } Oct 20 22:56:51 Jenny-sin-iPhone mobileassetd[143] \<Notice\>: 0x103730de0 Client connection: XPC\_TYPE\_DICTIONARY \<dictionary: 0x103730de0\> { count = 6, transaction: 1, voucher = 0x1033dd560, contents = "AssetType" =\> \<string: 0x103733f30\> { length = 49, contents = "com.apple.MobileAsset.VoiceServicesVocalizerVoice" } "Predicate" =\> \<data: 0x1033dceb0\>: { length = 1650 bytes, contents = 0x62706c6973743030d40102030405068e8f58247665727369... } "Local Cache Only" =\> \<bool: 0x1a38bb9e0\>: true "Timeout" =\> \<double: 0x1037329a0\>: 15.000000 "\_IPC\_TYPE" =\> \<uint64: 0x1002b4280\>: 13 "ClientName" =\> \<string: 0x103732120\> { length = 11, contents = "Text2Speech" } } Oct 20 22:56:51 Jenny-sin-iPhone mobileassetd[143] \<Notice\>: HANDLER - assetQuery [com.apple.MobileAsset.VoiceServicesVocalizerVoice]: (local=1) ["no-NO" == Language OR "no-NO" IN Languages] Oct 20 22:56:51 Jenny-sin-iPhone Text2Speech(MobileAsset)[555] \<Notice\>: 0x17414c760 Copy matching assets reply: XPC\_TYPE\_DICTIONARY \<dictionary: 0x17414c760\> { count = 2, transaction: 0, voucher = 0x0, contents = "Assets" =\> \<data: 0x17427e440\>: { length = 5271 bytes, contents = 0x62706c6973743030d400010002000300040005000601b001... } "Result" =\> \<int64: 0x174228f00\>: 0 } Oct 20 22:56:51 Jenny-sin-iPhone mobileassetd[143] \<Notice\>: 0x1002c3580 Main Listener: XPC\_TYPE\_CONNECTION \<connection: 0x1002c3580\> { name = com.apple.mobileassetd (peer), listener = false, pid = 555, euid = 501, egid = 501, asid = 0 } Oct 20 22:56:51 Jenny-sin-iPhone mobileassetd[143] \<Notice\>: 0x1a38bbbc0 Client connection: XPC\_TYPE\_ERROR Connection invalid \<error: 0x1a38bbbc0\> { count = 1, transaction: 0, voucher = 0x0, contents = "XPCErrorDescription" =\> \<string: 0x1a38bbe18\> { length = 18, contents = "Connection invalid" } } Oct 20 22:56:51 Jenny-sin-iPhone mobileassetd[143] \<Notice\>: Client connection invalid (Connection invalid); terminating connection Oct 20 22:56:51 Jenny-sin-iPhone mobileassetd[143] \<Notice\>: 0x1002c39b0 Client connection: XPC\_TYPE\_DICTIONARY \<dictionary: 0x1002c39b0\> { count = 5, transaction: 1, voucher = 0x1002bd990, contents = "AssetType" =\> \<string: 0x1037324f0\> { length = 49, contents = "com.apple.MobileAsset.VoiceServicesVocalizerVoice" } "AssetProperties" =\> \<dictionary: 0x10371cb10\> { count = 26, transaction: 0, voucher = 0x0, contents = "FormatVersion" =\> \<string: 0x1002b8460\> { length = 1, contents = "7" } "Name" =\> \<string: 0x103449040\> { length = 4, contents = "nora" } "Type" =\> \<string: 0x1002c13f0\> { length = 9, contents = "vocalizer" } "\_DownloadSize" =\> \<int64: 0x1002b7440\>: 40342067 "Footprint" =\> \<string: 0x10373b3a0\> { length = 7, contents = "premium" } "\_MasteredVersion" =\> \<string: 0x103744a20\> { length = 4, contents = "2052" } "\_CompressionAlgorithm" =\> \<string: 0x10373c240\> { length = 3, contents = "zip" } "\_\_CanUseLocalCacheServer" =\> \<bool: 0x1a38bb9e0\>: true "\_MeasurementAlgorithm" =\> \<string: 0x1002b61f0\> { length = 5, contents = "SHA-1" } "\_\_RelativePath" =\> \<string: 0x10020a210\> { length = 94, co
I didn’t look at the log you posted but this here seems to have a scope issue.
In the following line, what do you expect txt to be?
texttospeech.speak(txt, {language = "en-GB"})
You declared it inside the initCB function yet that variable exists in the global scope. It is referencing e.isError which will be nil when this variable is referenced from outside the scope of initCB.
Try doing a print(txt) right before the texttospeech.speak() call and you will see what I mean.
By the way, you should declare all your variables inside a function as local. This will make sure everything stays within its own scope and the global scope is not polluted. Debugging and maintaining code this way will become much easier.
Ops! Thanks for spotting this chillfok!
That was a stupid mistake on my part… For some reason that txt variable found it’s way in to the speak function… It should have been something like this:
W = display.actualContentWidth texttospeech = require("plugin.texttospeech") function initCB(e) txt = "------------------------- texttospeech.init() - Is error: " .. tostring(e.isError) print(txt) display.newText(txt, W/2, 300, native.systemFont, 0.03\*W) end texttospeech.init(initCB) texttospeech.speak("Hello", {language = "en-GB"})
This particular stupidity is contained to this simplified example, though. In my app, the text2speech works fine in Android but not in iOS.
I’ll check this out when I get home and see if the simple example works in iOS or not.
I have now tested with stupidity removed and it is the same iOS devices are stubbornly silent.
@runewinse, it’s not stupidity, just an honest mistake.
For what it is worth, I just built this on my iPhone 6S (actual device, not simulator) and it worked without a problem. Straight copy/paste, no edits. iOS 10.0.2 (14A456)
I used Corona version 2016.2966 (2016.9.30).
Edit: typo
Thanks for testing!
I’m using 2016.2972 myself. Don’t know if that has anything to do with it though…
Hi Lerg,
I guess you did not have time to check this out this weekend after all. But can you see if you get the same error as I did here?
(speaker not going back to Norwegian)
https://forums.coronalabs.com/topic/59180-text-to-speech/?p=342179
runewinse, I’ve tested your sample (more advanced edit) and did not see any problems with it. All languages were switched to correctly.
Tested on an iPod 5G, latest iOS 9.
Hm. Maybe some settings on your devices affect something. Sometimes in software it’s possible to get bugs from simply changing the interface language.
chillfok, the app crashes after first sentence because you are calling a nil function inside onComplete.
Instead of
local readNextCard = function()
you should write
local function readNextCard()
I do see some quirks in the plugin itself, rewriting those bits of code.
Is this a Lua syntactic quirk? I don’t think I understand the difference. At risk of turning this into a Lua discussion, do you think this would work? (sorry, I don’t have access to my Corona machine here):
local readNextCard readNextCard = function()
chillfok, what you wrote is exactly how it works under the hood with my code.
Your original code didn’t have that extra “local readNextCard” before function definition, so it fails as an upvalue.
I am working on an update for the plugin. A few breaking changes. And support for macOS - will be able to run inside the Corona Simulator, but it won’t be the same as on iOS.
Lerg, can you test on iOS 10.0.2 while you’re at it?
A big update is here!
Breaking changes:
- texttospeech.setEngine() is deprecated, use texttospeech.init() again instead. http://docs.spiralcodestudio.com/plugin/texttospeech/init/
- All callbacks have been converted to proper listeners. They receive event tables.
- Android 2.3 support is dropped.
Improvements:
- Speech rate has been fixed for iOS.
New goodies:
- New platforms: macOS and tvOS. That includes Corona Simulator on macOS!
- Pause/Continue functions.
- Pause/Stop can have an additional argument waitForWordEnd - if true, the speech is not interrupted immediately.
- New listeners - onPause, onContinue.
- Synthesize to file support on Android and macOS.
API reference has been moved to the new site. http://docs.spiralcodestudio.com/
Be sure to read it.
Sample is updated as well.
https://github.com/Lerg/plugins-sample-texttospeech
Use Corona daily build 2979 or later.
runewinse, I don’t have iOS 10 device, but on my latest iOS 9 device it works fine.
Yes, I know that. I was just curious if my problems has anything to do with iOS 10.
I’ve just found out that if I put the app in iTunes and beta testers download it, it seems to work fine (also for iOS 10). The problem seems to be related to installing the app on a USB connected test device using XCode (on iOS 10).
Just to be clear: I experience two separate problems with text-to-speech.
1) Language switching problem
This seems to be a problem on Android devices, at least on my Android device (Nexus 6P running Android 7.1) and my colleagues device (Galaxy S6 Edge w/Android 6).
Have you tested my “advanced example” on an Android device?
2)**** Silcence problem
This is only an iOS problem. I have only tested on iOS 10.
BTW: At least the language switching problem is still present with the latest update and Corona SDK 2979.
runewinse, so if you build the app using Corona Simulator and transfer it via USB, does it work?
Also make sure the silence switch on the side of your device is not turned on.
Regarding Android problem. If you build the sample app using Corona 2979 and press different speak buttons, only one will speak?