New OpenEars version .912 out now

I’m happy to announce the release of OpenEars .912, a bugfix release fixing the following issues:

• OpenEarsEventsObserver was never receiving a delegate message when a language model was being changed (thanks to Aleksey for finding this bug)
• LanguageModelGenerator was not finding alternate pronunciations of a word (thanks to Sarinsukumar for finding this bug)
• AudioSessionManager will now correctly reset audio session settings that a media player object (such as an AVPlayer or MPMusicPlayerController among others) overrides if startAudioSession is run a second time afterwards. If a PocketsphinxController object is already instantiated and its loop has been started at the time that a media player object has overridden its audio session settings, after AudioSessionManager startAudioSession is run the second time, you _may_ also need to restart the listening loop if the media player’s audio session override gave PocketsphinxController an interruption signal that caused it to make a controlled exit from the listening loop.

I strongly recommend upgrading to this version immediately if you use dynamic language model generation since it will improve recognition across different accents. Enjoy and let me know how it works for you, in the forums as usual.

0 Comments

New OpenEars version .911 is out now

I’m proud to release OpenEars version .911, primarily a bugfix fixing the following issues:

• Occasional crash in level metering after > 20 minutes of use
• There is now no limit on the size of the language model that can be generated by LanguageModelGenerator other than the time required. Very large language models will no longer crash, medium-sized language models will generate a bit more slowly, small-sized language models should be largely unaffected.
• An issue with codesigning on the device should be resolved.
• An issue with code display in Xcode should be resolved.
• An issue preventing running the simulator with the -all_load linker flag should be resolved

And adding the following feature:

Pitch, speed, variance control for text-to-speech.

0 Comments

New OpenEars version .91 is out now

Hello,

I just uploaded the new version of OpenEars, featuring the following new stuff among other things:

• All audio functions (Flite speech and Pocketsphinx recognition) handled in-memory
• Low-latency Audio Unit audio driver for Pocketsphinx
• Switching between all the Flite voices on the fly
• Dynamically creating ARPA language models in-app
• Switching between different ARPA language models on the fly
• Experimental Bluetooth support
• Improved Pocketsphinx accuracy
• Re-documented for Xcode 4.

Since this is such a big refactor under the hood, and there are a couple of APIs that have changed, I am still going to support the previous version 0.9.02 until 0.91 is known to be as stable as that version, so you can still download that older version too (previous docs are included in the download). Please check out OpenEars 0.91 and put it to the test! As always, bring any issues over to the forums and I will assist.

0 Comments

Open the Simulator sandbox folder of the app you just built and ran

Here’s another Applescript* tool for dealing with the Simulator, since I seem to be on an Applescript/Simulator kick**. Maybe I’m the only one with this problem: a common use of the Simulator for me is testing code that writes out to the Documents folder of the app. And yet, it’s always an unpleasant process to locate the app’s Simulator install folder inside of the Application Support/Simulator folder. It’s not always 100% obvious which SDK folder I ought to be looking in, the containing folder name changes, it’s not self-evidently named, etc. So, I have an Applescript that just finds and opens the Simulator install folder for whatever Simulator app I built and ran last.

Or at least, I had an Applescript, but it was dog-slow. But I recently asked for help on MacScripter here and it’s now optimized into a speed demon thanks to Hank and Stefan. The script, to be entered and saved in your Applescript Editor:


# By StefanK at MacScripter: http://macscripter.net/viewtopic.php?pid=140141

property findtype : quoted form of "kMDItemContentType = \"com.apple.application-bundle\""

set simulatorFolder to POSIX path of (path to application support folder from user domain) & "iPhone Simulator/"
set appFiles to paragraphs of (do shell script "mdfind -onlyin " & quoted form of simulatorFolder & " " & findtype)
if appFiles is not {} then
	set mostRecentApp to item 1 of appFiles
	tell application "Finder" to reveal ((POSIX file mostRecentApp) as alias)
	tell application "Finder" to activate
end if

Of you can just download it as an already-saved app if you prefer (it can still be opened and edited in Applescript Editor).

Put it in the dock and click it when you want to see the install folder. I hope it spares you as much annoyance as it spares me. Tip of the hat to MacScripter and regulus6633 and StefanK.

*”What’s the deal with all the Applescript?” you ask. Look, I just want to be well-practiced when Apple rolls out the Applescript Store at WWDC this year.

**My last AppleScript/Simulator post was linked on Alex Curlyo’s blog and it led to a discussion that raised two even better suggestions for accomplishing the same task which are now part of my standard workflow.

2 Comments

Low memory warning bombardment tool

This is an update on my old post here: Consider Yourself Warned.

I wanted to share a tool that I use in as part of checking an app for behaving correctly under low memory warnings, to the extent that is possible to do so using the Simulator. It’s an Applescript that just sends a low memory warning to the simulator every second or so, so you can go through every function of your app while debugging and see if a low memory warning ever causes a crash due to a required data structure not being available after a low memory warning. It will also smoke out some redraw bugs due to views being released, though for this it is less reliable than the device.

In order to use this tool, you need to turn go to Universal Access in the System Preferences and check “Enable access for assistive devices”, and if it doesn’t work immediately, you may need to open the script up in Applescript Editor (usually found in your Utilities folder) and make sure that the simulatorName variable actually corresponds to the name of your simulator app for the version of Xcode you use. You can also change the timer for how frequently simulated memory warnings are invoked.

This doesn’t tell you everything about how your app deals with memory on the device so it is not a substitute for functional device testing, but it will quickly show you if the app can be crashed on the simulator due to a missing data structure, which will often also happen on the device. It isn’t a panacea, just another tool to keep in the toolbox for catching some bugs easily.

If you are using a version of the simulator that has different titling in the menu (I don’t know if there are any around right now but that is likely in the future), you can change the strings in the script which refer to the menu element names.

When you quit the simulator, the script will quit. Since it is a loop that only exits when the simulator is quit, you may have to force quit it if you encounter some circumstance that I haven’t foreseen.

Here is the script uploaded as a zipped applet (you can still open it up in the script editor to edit it):

Politepix Memory Bombardment applet

If you don’t want to download a zipped applet, you can create your own Applescript applet from the following code:


# This requires going to Universal Access in the System Preferences and checking "Enable access for assistive devices".

# This will run until the iOS simulator is quit.

# Created by Halle Winkler, Politepix: http://www.politepix.com

#If you're using a different simulator version that is called something else, put its name here.
set simulatorName to "iOS Simulator"
# Change the .8 here to whatever interval you want to send simulated memory warnings at. These are seconds, so sleep 1 would mean that it repeats every second.
set repeatRate to "sleep .8"

# If the naming in the simulator menus is different for you, you can change them here

set menuName to "Hardware" # This is the main menu name
set menuItemName to "Simulate Memory Warning" # This is the name of the menu item

tell application simulatorName
	activate
end tell
repeat

	tell application "System Events"
		if application process simulatorName exists then
			tell application "System Events"
				tell process simulatorName
					tell menu bar 1
						tell menu bar item menuName
							tell menu menuName
								click menu item menuItemName
							end tell
						end tell
					end tell
				end tell
			end tell
			do shell script repeatRate
		else
			exit repeat
		end if
	end tell

end repeat

Hope this is helpful to others.

1 Comment

OpenEars version 0.9.02 is out

Just a quick note that OpenEars 0.9.02 is out now – this is a maintenance release which fixes a couple of bugs and adds two new features: 1) meaningful recognition confidence scores, and 2) the ability to use JSGF grammars. As always, please check out the forums to get support.

0 Comments

The Dream of One Thousand (* 80) Cranes

When you think of the crane, Brandenburg is perhaps not what springs immediately to mind, yet every October the village of Linum in our neighboring state is host to the largest or near-largest congregation of Eurasian Cranes in Europe. As many as 80,000 of the overall European population of 400,000 cranes depart Scandinavia and the Baltic region and take a multiweek rest here to fuel up before continuing their migration to Central Spain for the winter.

We go to Linum every October, since hearing and seeing these beautiful birds in their numbers takes some of the sting out of the otherwise grim onset of Central European autumn. So far, local observers have counted 30,000 cranes and the stopover season has only started.

The farmers there share the lore that if you scare off the cranes from your fields even once, you won’t see them again in your lifetime, so I guess Linum has shown the cranes some gentleness and hospitality and I’m glad of it. I took some pictures:

A single crane flies overhead

Two cranes are silhouetted at dusk
Many cranes fly overhead

A Peacock Butterfly

OK, the Peacock Butterfly is not a crane, but I saw it while I was waiting for cranes. NABU is the conservation society concerned with the support of sustainable tourism and species protection in the region and due to their efforts and that of the village and surrounds, Linum is host not only to cranes but also wild breeding populations of storks, and an equally-impressive stopover population of grey geese.

1 Comment

Voice Recognition / Speech Recognition and speech for the iPhone

I’m happy to announce that OpenEars is launched! OpenEars is an open-source iOS library for implementing continuous, multithreaded, and low-overhead speech recognition and text-to-speech, using CMU Pocketsphinx and CMU Flite, for the iPhone and iPad. It uses nice Cocoa-standard cross-project-referenced static libraries and it offers all the easy-to-use Objective-C methods you’ll need to bring round-trip speech functions to your app. The launch version is 0.9.0 and I hope that there will be some cool projects using it.

4 Comments

Ducklings weren’t on the balcony

They were in Kladow:
Swimming Duckling

Standing Duckling

Mom Duck and Two Ducklings

Mom Duck and Two Ducklings On Cobblestones

Close Shot of Mom Duck and Two Ducklings

0 Comments

Who is on the balcony, flying swan edition

A swan flies over, head downwards.

Swan Flies Over Berlin Balcony 1

Swan Flies Over Berlin Balcony 2

0 Comments