Friday, September 21, 2012

Building my own SIRI

I was working on a mobile app for both android and iOS using titanium.  Found two interesting things.  Apple does not allow developer community access to SIRI and my phones do not have SIRI (iPhone 4).  But I want my app to be voice enabled.  How can I do this ?  Is this even possible?

Answer is Yes.  its possible.  Here is my approach.  If there is any interest I can share the code.

My requirement:

  1. App should be able to talk to user
  2. User should be able to respond specific commands by voice.
  3. App should be able to respond with action or error voice.


In my case i want get the user input via Voice like numbers.

Voice Synthesis (Talk your text to user)

  • I wanted the app to ask the user for inputs. Keeping it dynamic.
  • I used google to synthesize the voice
    • http://translate.google.com/translate_tts?tl=en&q=text
    • You send the question in text field of the above url, you will recieve a wav file back.
  • Use Ti.Media to play back the way file. Note: Ti.Media does not work for android.  Need to use third party module.

Voice Recognition

  • Use Ti.Media to get the input from speaker from user.  Note:  Android will have to use a thrid party module.
  • Record the wav file.  I recorded it as 8KHz file to keep the wav file small.
  • Send to to a conversion service online.  There are many services available online to accomplish this task.
  • I used this site http://api.ispeech.org/api/json which converts the voice to text.

Error Handling

  • When the text is returned from recognition call.  My call back will analyse if the data recieved is relevent.  There is confidence level also returned.  Based on confidence level and data recieved, I make decision to use the text or play back a custom error message.
  • For example:  I ask to enter numbers.  The translated text has alpha, then i play back a message that i expected only numbers.
Observation was that over 3G the recognition service was slow.  On LTE and WiFi it worked almost like SIRI.  But I used a non paid service.  Using google translate and voice you can have the app speak different languages too.  I tried using the codebox module for android got stuck, now am writing my own.

Any thoughts welcome.

Tuesday, September 18, 2012

Innovation Buzz

There is a lot of buzz these days about innovation.  Everyone wants to innovate.  Everyone wants a piece of it.  How can we be Innovators ?  I saw Pranav Mistry's Sixth Sense project video a while ago.  It was an out of the box thought.  But if you looked closely, Pranav used what was at his disposal and gave life to an idea of gesture based system.  Sometimes we forget that innovation is not always the next FaceBook or Apple. We forget that assembling what is available for a different purpose is also innovation.

I attended a session on Medici Effect by Frans Johansson a while ago.   It was an awesome experience. Frans was mainly talking about finding intersection.  Intersection of different thoughts of life.  Frans was telling all of us, it's about the number of ideas you have.  More the ideas,  better the outcome.  Some ideas will die and some will make more sense to move forward.  If you have not read Medici Effect by Frans, I would highly recommend it.




Tuesday, September 4, 2012

Mobile App development tutorial

Titanium Development

Here are some links that were quite helpful.

Drilldown navigation tutorial
http://mobile.tutsplus.com/tutorials/appcelerator/drilldown-navigation-with-titanium/

SQL Lite - Database driven tables
http://mobile.tutsplus.com/tutorials/appcelerator/titanium-mobile-database-driven-tables-with-sqlite/

Videos on tips and tricks of Titanium
http://vimeopro.com/appcelerator/forging-titanium

Charts in Titanium - Raphael JS, D3JS
http://boydlee.com/appcelerator-titanium/creating-charts-for-titanium-using-raphael-js.html

I have been able to use d3 successfully.

Tip: Ensure you rename the other java libraries to .lib instead of .js

let me know if you have any specific issues you need some advice on.

Funding your ideas

Well,  all of us are passionate about our ideas and thoughts.  One of us could have the idea for the next face book or google.  But, how can we take our idea further into making a tangible product or prototype ?  Now comes lots of questions.

Is it just funding my idea ?  What about the skill set that i need to get it accomplished ?  What about infrastructure ?  Hmmmm as I start thinking the list grows.   As am passionate about my ideas,  I dont want to let them die just yet.

Here is what i will do.  Make a list of what it takes and put a price tag around it.  Now I know tentatively what i need and money i need to raise.  Get ready to market the idea.

Create a power point presentation  
1.  Why my idea ?
2.  What does it do ?
3.  Why should you buy it ?
4.  Does it solve world peace ?  I guess not.

Create a 3 minute video about your idea and include a proto type if there is one.  We have a way to showcase it to the rest of the world.


Crowd source the funding for your project.  Create different tiers of support for your sourcing.  No amount is small amount.  Do not think $1 is small.  Ocean was created with droplets of water.  Have a strategy for these tiers.  Here is a sample.

$1 Tier -   Will get a Thank You note
$5 Tier -   Will get your name as bronze sponsor on our site
$15 Tier - Will give you a T-Shirt with our logo
$25 Tier -  Will get the app this idea is all about for free without any ads along with support and free updates
$50 Tier  - You get the idea.

Go to http://www.kickstarter.com/  and create your kickstarter.


All the best.

Monday, September 3, 2012

Mobile development Native vs Webcontainer vs hosted

I got my hands around developing a few mobile apps.  I will put my thoughts here.  It all depends what you plan to do.  What features do you need for your app?  The last one I worked on needed OCR (image recognition).  I was developing for both iPhone and android.

When you need to access the hardware, hands down native offers lot of tools. Titanium has ways to plugin native libraries into th app.  I did try both native and titanium.  I am happy camper for both of those.   But phone gap surprised me as well,  I found a way to write plugin for native libraries using phone gap.  My only soap box on phone gap is, I don't like performance of JQ touch yet.  The is lot of room for improvement.  

If your app is a simple one,  that uses simple device features like camera and geo location.  You could do with a webcontainer (Phone Gap + JQTouch/Sencha Touch).    But, I still have not found a web library (open source ) that does good job for UI.  Sencha touch does a good job for web container UI but, it's not free.  It's gpl v3 license.  Sencha touch costs about $199 for now.  Not too bad.  Combination of Sencha Touch, HTML5 and Phone Gap could give you a decent mobile app.

Hosted apps, for now are too slow.  With bandwidth becoming premium,  I'd stic to native for UI and hosted svcs for data.  REST based services to retrieve data from server. 

So for now, am sticking with free version of Titanium.  The main reason being, that i can develop both Android and iPhone apps from the same code base.  However, their supported version costs an atrocious $7500 which is too heavy for an entry developer.  Adobe's flash builder is also capable of delivering native apps.  My next task is to take a look at flash ( I know flash is dying).

BTW,  Phone Gap is now owned by Adobe.  Adobe donates Flash to apache open source foundation.  

Please share your thoughts.