Codea 2.2 Beta

Hey beta testers

Codea 2.2 has a new speech API. It makes Codea talk.

This is how you use it:

speech.say("Some words")

There’s a new example project (Speakeasy) and the docs are in the “Sounds” chapter.

(If you have a toddler, the example project is a fun way to get them to have entire conversations with your iPad)

That looks like something I had on my Apple II back in the 70’s. It was called Apple Talker. I don’t remember the exact command, but it was about the same.

good news.
However, new codea beta wont install… and now it doesnt run anymore. I hope it will work again soon? Am i the only one with this problem? I have ios7.
EDIT: i’ve reverted to app store version to have codea running.

EDIT: got it working.

Speech API is awesome stuff, now we just need access to the voice recognition API :wink:

Bizarre bug: if I have a project with the same name as an example project, then I can’t set a project icon for it. When I set the icon, it changes to the corresponding example project’s icon.

First impression: Wow!

Bug: If you close the running project while Siri is speaking, the voice continues until it runs out of text or you close Codea.

Suggestion: speech.len(text), returns the time it would take to say specified text. Would be useful for lyrics, subtitles, etc.

Also, not sure where to post this, but there are a couple of errors in the Game Center add-ons:


static const luaL_Reg gamecenterLibs[] =
    {"enabled", gamecenter_enabled},
    {"showLeaderboards", gamecenter_showLeaderboards},
    {"showAchievements", gamecenter_showAchievements},
    {"showAchievements", gamecenter_submitScore},
    {"showAchievements", gamecenter_submitAchievement},
    {NULL, NULL}

should be this:

static const luaL_Reg gamecenterLibs[] =
    {"enabled", gamecenter_enabled},
    {"showLeaderboards", gamecenter_showLeaderboards},
    {"showAchievements", gamecenter_showAchievements},
    {"submitScore", gamecenter_submitScore},
    {"submitAchievement", gamecenter_submitAchievement},
    {NULL, NULL}

and the documentation shows gamecenter.enabled as being a boolean, but it is actually a function that returns a boolean

finally, in the function showGameCenterWithConfigurationBlock, nothing done to codeaController seems to work, e.g. setting paused to YES followed by a print of that value shows it is still NO, and it never presents the view controller, so achivements/leaderboards never come up

I have a similar problem to Jmv38, it failed to load and now it is stuck. At least I can still use Codea, but I can’t test the beta.

@Ignatz @Jmv38 really sorry, TestFlight was having some issues last night. You could try the install again.

@Ignatz I did make some changes relating to rendering based on profiling your example. Though I haven’t yet had the opportunity to test on iPad 3 to see if the changes improve performance.

@JakAttak thank you for the corrections! The showGameCenterWithConfigurationBlock function wasn’t working because the GameCenterAddon was inheriting CodeaAddon but also overrode the codeaDidRegisterAddon function (which the CodeaAddon base class uses to track the current controller). It should all be fixed in the github repo:

@Simeon - I tried again and it worked (although I wonder what to do with the inactive icon from the first attempt!)

I checked the speed, and it hasn’t increased, BUT I also ran an earlier version of my dungeon, which is faster as I remember it, so it is probably something I added recently that slowed it down.

In other words, the speed seems to be back where it was.

@Simeon very nice to have speech, thanks.
Is there a difference between:

local words = speech("Hello World")
speech.say( words )


local words = "Hello World"
speech.say( words )


@Jmv38 not in that case. In the first example you get an “utterance” object, so you can use it like this:

local w = speech("Hello")

w.rate = 0.1
w.pitch = 1.8


In the latter example you would have to configure those settings globally:

local w = "Hello"

speech.rate = 0.1
speech.pitch = 1.8


Shaders defined before setup are not being loaded. That is, putting the following in a tab outside a function (so that it is executed as the tab is read) means that the shader won’t be active:

m = mesh()
m.shader = shader("some shader")

I also find that my programs take a significantly long time to start up.

On the plus side, setting an image as the icon is great. Is there any way to trigger the “you’ve taken a photo, what would you like to do with it?” programmatically? Something like:


which brings up that dialog?

A bit like how doing stopRecording() brings up the “What do you want to do with that recording?” dialog.

@Andrew_Stacey really like the idea of being able to trigger the image share dialog programatically.

share(img) is an interesting function name. Maybe shareImage( img ) to be more specific and to fit-in with readImage and saveImage. Will have to give it some thought.

On shaders not being loaded outside of setup, that is likely because there is no longer any OpenGL context when your code is initially validated.

I will profile the run performance again, I thought I had improved it but will have to see if there is anything further to be done.


  • Anagrams project icon was not showing up

  • After I opened and closed it, icon showed up, but it is now in the examples folder and in my normal projects area

@JakAttak Anagrams should have been in the examples collection, how did it get to your normal projects area in the first place? That’s very odd.

@Simeon, it wasn’t there until I opened the example, then it seems to have copied itself. Opening one and closing it results in them switching spots

@Simeon I found that occasionally a recently opened example project would appear in my projects, I assumed it was intentional. It always disappeared shortly afterwards.

This happens for me on any example where the icon was not loaded initially, so Anagrams, Animation, and Parameters.

Other examples don’t have this bug

@Simeon So what does not having an OpenGL context mean in practical terms? It seems to affect shaders, but not meshes. Is it simply that I need to delay all shader initialisation until setup? Or is there more to it than that? How about setContext? Is that affected?