Skip to content

Commit

Permalink
Updated README file.
Browse files Browse the repository at this point in the history
  • Loading branch information
kremizask committed Jan 26, 2012
1 parent 8393c46 commit 0e5c33b
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 8 deletions.
2 changes: 1 addition & 1 deletion OpenEars/OpenEarsLibrary/Classes/include/OpenEarsConfig.h
Expand Up @@ -33,7 +33,7 @@


#import "OpenEarsVoiceConfig.h" #import "OpenEarsVoiceConfig.h"


#define OPENEARSLOGGING // Turn this on to get logging output from audio driver initialization, etc. Please turn on and submit output when reporting a problem. //#define OPENEARSLOGGING // Turn this on to get logging output from audio driver initialization, etc. Please turn on and submit output when reporting a problem.
//#define VERBOSEPOCKETSPHINX // Leave this uncommented to get verbose output from Pocketsphinx, comment it out for quiet operation. I'd recommend starting with it uncommented and then commenting when you're pretty sure things are working. //#define VERBOSEPOCKETSPHINX // Leave this uncommented to get verbose output from Pocketsphinx, comment it out for quiet operation. I'd recommend starting with it uncommented and then commenting when you're pretty sure things are working.
//#define VERBOSEMITLM // Leave this uncommented to get more output from language model generation //#define VERBOSEMITLM // Leave this uncommented to get more output from language model generation
//#define USERCANINTERRUPTSPEECH // Turn this on if you wish to let users cut off Flite speech by talking (only possible when headphones are plugged in). Not sure if this is 100% functional in v 0.913 //#define USERCANINTERRUPTSPEECH // Turn this on if you wish to let users cut off Flite speech by talking (only possible when headphones are plugged in). Not sure if this is 100% functional in v 0.913
Expand Down
Empty file removed README
Empty file.
28 changes: 28 additions & 0 deletions README.mdown
@@ -0,0 +1,28 @@
Summary
===============

This is a simple iPhone application that uses the WolframAlpha API to display answers to the users queries.
There are three different ways to make a query. Users can either:

1. Type the entry they want to search for
2. use voice detection to provide their search term or
3. Choose among some predefined searches.

External Libraries
===============
The external libraries used by this app are:

* [OpenEars](http://www.politepix.com/openears) for voice recognition.
* [TouchXML](https://github.com/TouchCode/TouchXML), for the parsing of the WolframAlpha API XML response
* [ASIHTTPRequest](http://allseeing-i.com/ASIHTTPRequest/) for the HTTP requests.

For a more information on these libraries and on how to install use them and use them in your project visit the corresponding websites.

Specifically for OpenEars, in addition to the instructions described in the it's [website](http://www.politepix.com/openears) in order to make it work in this project I set the Header Search Paths both on project settings and the target settings.

Usage Notes
===============
* Even though the voice recognition module can run on the Simulator as well as on the device, it is optimized for the device.
* What should be also noted is that the quality of the voice recognition is dependent on the dictionary used. In this demo I am using For the .languagemodel file from the install (note: files that end with .DMP are fine to use as ARPA language model files): [OPENEARS]/CMULibraries/pocketsphinx-0.6.1/model/lm/en_US/hub4.5000.DMP
For the .dic I used [this](https://cmusphinx.svn.sourceforge.net/svnroot/cmusphinx/trunk/pocketsphinx/model/lm/en_US/hub4.5000.dic) file from the Pocketsphinx repository. As stated on the OpenEars documentation "This will set you up with a matching 5000 word vocabulary for the default acoustic model which you can then tell PocketsphinxController to start with. To the best of my understanding, 5000 words is the maximum size for decent recognition performance for Pocketsphinx and reasonable resource usage on the device. Keep in mind that using such a large model will increase your memory overhead, and reduce recognition speed and recognition accuracy."
As a result, quite a few of the voice searches I tried failed to be correctly recognized. Some search terms that worked for me in the "voice" mode are the following: "what is the population of China", "what is my name", "what time is it", "ice".
12 changes: 8 additions & 4 deletions WolframDemo.xcodeproj/project.pbxproj
Expand Up @@ -7,6 +7,7 @@
objects = { objects = {


/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
292895DB14D1D33D0054EF79 /* loadingIndicator.png in Resources */ = {isa = PBXBuildFile; fileRef = 292895DA14D1D33D0054EF79 /* loadingIndicator.png */; };
29329EAA14C6F303007A1D32 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 29329EA914C6F303007A1D32 /* UIKit.framework */; }; 29329EAA14C6F303007A1D32 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 29329EA914C6F303007A1D32 /* UIKit.framework */; };
29329EAC14C6F303007A1D32 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 29329EAB14C6F303007A1D32 /* Foundation.framework */; }; 29329EAC14C6F303007A1D32 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 29329EAB14C6F303007A1D32 /* Foundation.framework */; };
29329EAE14C6F303007A1D32 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 29329EAD14C6F303007A1D32 /* CoreGraphics.framework */; }; 29329EAE14C6F303007A1D32 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 29329EAD14C6F303007A1D32 /* CoreGraphics.framework */; };
Expand Down Expand Up @@ -96,7 +97,7 @@
29976C7714C8F09400B7C2D3 /* sampleSearches.plist in Resources */ = {isa = PBXBuildFile; fileRef = 29976C7614C8F09400B7C2D3 /* sampleSearches.plist */; }; 29976C7714C8F09400B7C2D3 /* sampleSearches.plist in Resources */ = {isa = PBXBuildFile; fileRef = 29976C7614C8F09400B7C2D3 /* sampleSearches.plist */; };
29976C8614C9328E00B7C2D3 /* ProgressView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 29976C8514C9328E00B7C2D3 /* ProgressView.xib */; }; 29976C8614C9328E00B7C2D3 /* ProgressView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 29976C8514C9328E00B7C2D3 /* ProgressView.xib */; };
29976C8914C9338F00B7C2D3 /* BaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 29976C8814C9338F00B7C2D3 /* BaseViewController.m */; }; 29976C8914C9338F00B7C2D3 /* BaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 29976C8814C9338F00B7C2D3 /* BaseViewController.m */; };
29976C8B14C9346900B7C2D3 /* loadingIndicator.png in Resources */ = {isa = PBXBuildFile; fileRef = 29976C8A14C9346700B7C2D3 /* loadingIndicator.png */; }; 29976C8B14C9346900B7C2D3 /* loadingIndicator_.png in Resources */ = {isa = PBXBuildFile; fileRef = 29976C8A14C9346700B7C2D3 /* loadingIndicator_.png */; };
29A7FA2C14CC9B2500FCFF2A /* hub4.5000.DMP in Resources */ = {isa = PBXBuildFile; fileRef = 29A7FA2B14CC9B2500FCFF2A /* hub4.5000.DMP */; }; 29A7FA2C14CC9B2500FCFF2A /* hub4.5000.DMP in Resources */ = {isa = PBXBuildFile; fileRef = 29A7FA2B14CC9B2500FCFF2A /* hub4.5000.DMP */; };
29A7FA2E14CC9BD500FCFF2A /* hub4.5000.dic in Resources */ = {isa = PBXBuildFile; fileRef = 29A7FA2D14CC9BD500FCFF2A /* hub4.5000.dic */; }; 29A7FA2E14CC9BD500FCFF2A /* hub4.5000.dic in Resources */ = {isa = PBXBuildFile; fileRef = 29A7FA2D14CC9BD500FCFF2A /* hub4.5000.dic */; };
29B17A8214C99DDE0032A724 /* OpenEars1.dic in Resources */ = {isa = PBXBuildFile; fileRef = 29B17A8014C99DDE0032A724 /* OpenEars1.dic */; }; 29B17A8214C99DDE0032A724 /* OpenEars1.dic in Resources */ = {isa = PBXBuildFile; fileRef = 29B17A8014C99DDE0032A724 /* OpenEars1.dic */; };
Expand Down Expand Up @@ -136,6 +137,7 @@
/* End PBXContainerItemProxy section */ /* End PBXContainerItemProxy section */


/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
292895DA14D1D33D0054EF79 /* loadingIndicator.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = loadingIndicator.png; path = resources/images/loadingIndicator.png; sourceTree = "<group>"; };
29329EA514C6F303007A1D32 /* WolframDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WolframDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 29329EA514C6F303007A1D32 /* WolframDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WolframDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
29329EA914C6F303007A1D32 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 29329EA914C6F303007A1D32 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
29329EAB14C6F303007A1D32 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 29329EAB14C6F303007A1D32 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
Expand Down Expand Up @@ -264,7 +266,7 @@
29976C8514C9328E00B7C2D3 /* ProgressView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ProgressView.xib; sourceTree = "<group>"; }; 29976C8514C9328E00B7C2D3 /* ProgressView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ProgressView.xib; sourceTree = "<group>"; };
29976C8714C9338F00B7C2D3 /* BaseViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseViewController.h; sourceTree = "<group>"; }; 29976C8714C9338F00B7C2D3 /* BaseViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseViewController.h; sourceTree = "<group>"; };
29976C8814C9338F00B7C2D3 /* BaseViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BaseViewController.m; sourceTree = "<group>"; }; 29976C8814C9338F00B7C2D3 /* BaseViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BaseViewController.m; sourceTree = "<group>"; };
29976C8A14C9346700B7C2D3 /* loadingIndicator.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = loadingIndicator.png; path = resources/images/loadingIndicator.png; sourceTree = "<group>"; }; 29976C8A14C9346700B7C2D3 /* loadingIndicator_.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = loadingIndicator_.png; path = resources/images/loadingIndicator_.png; sourceTree = "<group>"; };
29A7FA2B14CC9B2500FCFF2A /* hub4.5000.DMP */ = {isa = PBXFileReference; lastKnownFileType = file; name = hub4.5000.DMP; path = "OpenEars/CMULibraries/pocketsphinx-0.6.1/model/lm/en_US/hub4.5000.DMP"; sourceTree = SOURCE_ROOT; }; 29A7FA2B14CC9B2500FCFF2A /* hub4.5000.DMP */ = {isa = PBXFileReference; lastKnownFileType = file; name = hub4.5000.DMP; path = "OpenEars/CMULibraries/pocketsphinx-0.6.1/model/lm/en_US/hub4.5000.DMP"; sourceTree = SOURCE_ROOT; };
29A7FA2D14CC9BD500FCFF2A /* hub4.5000.dic */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = hub4.5000.dic; path = resources/languages_dictionaries/hub4.5000.dic; sourceTree = "<group>"; }; 29A7FA2D14CC9BD500FCFF2A /* hub4.5000.dic */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = hub4.5000.dic; path = resources/languages_dictionaries/hub4.5000.dic; sourceTree = "<group>"; };
29B17A8014C99DDE0032A724 /* OpenEars1.dic */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = OpenEars1.dic; sourceTree = "<group>"; }; 29B17A8014C99DDE0032A724 /* OpenEars1.dic */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = OpenEars1.dic; sourceTree = "<group>"; };
Expand Down Expand Up @@ -546,7 +548,8 @@
296D8E7614CD666600E41B39 /* Icon-Small@2x.png */, 296D8E7614CD666600E41B39 /* Icon-Small@2x.png */,
296D8E7714CD666600E41B39 /* Icon.png */, 296D8E7714CD666600E41B39 /* Icon.png */,
296D8E7814CD666600E41B39 /* Icon@2x.png */, 296D8E7814CD666600E41B39 /* Icon@2x.png */,
29976C8A14C9346700B7C2D3 /* loadingIndicator.png */, 292895DA14D1D33D0054EF79 /* loadingIndicator.png */,
29976C8A14C9346700B7C2D3 /* loadingIndicator_.png */,
29976C0C14C8B11000B7C2D3 /* back_btn_normal.png */, 29976C0C14C8B11000B7C2D3 /* back_btn_normal.png */,
29976C0D14C8B11000B7C2D3 /* back_btn_normal@2x.png */, 29976C0D14C8B11000B7C2D3 /* back_btn_normal@2x.png */,
29976C0E14C8B11000B7C2D3 /* back_btn_selected.png */, 29976C0E14C8B11000B7C2D3 /* back_btn_selected.png */,
Expand Down Expand Up @@ -751,7 +754,7 @@
29976C6414C8E8B900B7C2D3 /* SampleCell.xib in Resources */, 29976C6414C8E8B900B7C2D3 /* SampleCell.xib in Resources */,
29976C7714C8F09400B7C2D3 /* sampleSearches.plist in Resources */, 29976C7714C8F09400B7C2D3 /* sampleSearches.plist in Resources */,
29976C8614C9328E00B7C2D3 /* ProgressView.xib in Resources */, 29976C8614C9328E00B7C2D3 /* ProgressView.xib in Resources */,
29976C8B14C9346900B7C2D3 /* loadingIndicator.png in Resources */, 29976C8B14C9346900B7C2D3 /* loadingIndicator_.png in Resources */,
29C2DD8014C98CCB007514AD /* cmu07a.dic in Resources */, 29C2DD8014C98CCB007514AD /* cmu07a.dic in Resources */,
29C2DD8A14C98D23007514AD /* feat.params in Resources */, 29C2DD8A14C98D23007514AD /* feat.params in Resources */,
29C2DD8B14C98D23007514AD /* feat.params.bak in Resources */, 29C2DD8B14C98D23007514AD /* feat.params.bak in Resources */,
Expand All @@ -773,6 +776,7 @@
296D8E7C14CD666600E41B39 /* Icon-Small@2x.png in Resources */, 296D8E7C14CD666600E41B39 /* Icon-Small@2x.png in Resources */,
296D8E7D14CD666600E41B39 /* Icon.png in Resources */, 296D8E7D14CD666600E41B39 /* Icon.png in Resources */,
296D8E7E14CD666600E41B39 /* Icon@2x.png in Resources */, 296D8E7E14CD666600E41B39 /* Icon@2x.png in Resources */,
292895DB14D1D33D0054EF79 /* loadingIndicator.png in Resources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
Expand Down
11 changes: 8 additions & 3 deletions WolframDemo/SearchViewController.mm
Expand Up @@ -86,6 +86,10 @@ - (void)textFieldDidBeginEditing:(UITextField *)textField{
#pragma mark - Action methods #pragma mark - Action methods


- (IBAction)backBtnPressed:(id)sender { - (IBAction)backBtnPressed:(id)sender {
[recordButton setSelected:NO];
listeningLoopRunning=NO;
[self.pocketsphinxController stopListening];
[self hideLoadingIndicators];
[self.navigationController popViewControllerAnimated:YES]; [self.navigationController popViewControllerAnimated:YES];
} }


Expand Down Expand Up @@ -143,8 +147,8 @@ - (void) pocketsphinxDidReceiveHypothesis:(NSString *)hypothesis recognitionScor
initWithTitle:@"" initWithTitle:@""
message:[NSString stringWithFormat:@"Search for \"%@\"",hypothesis] message:[NSString stringWithFormat:@"Search for \"%@\"",hypothesis]
delegate:self delegate:self
cancelButtonTitle:NSLocalizedString(@"OK", @"Request failure alert OK.") cancelButtonTitle:@"NO"
otherButtonTitles:@"NO", nil]; otherButtonTitles:@"OK", nil];
[alert show]; [alert show];
[alert release]; [alert release];
} }
Expand All @@ -153,6 +157,7 @@ - (void) pocketsphinxDidReceiveHypothesis:(NSString *)hypothesis recognitionScor
- (void) audioSessionInterruptionDidBegin { - (void) audioSessionInterruptionDidBegin {
NSLog(@"AudioSession interruption began."); // Log it. NSLog(@"AudioSession interruption began."); // Log it.
[self.pocketsphinxController stopListening]; // React to it by telling Pocketsphinx to stop listening since it will need to restart its loop after an interruption. [self.pocketsphinxController stopListening]; // React to it by telling Pocketsphinx to stop listening since it will need to restart its loop after an interruption.
[self hideLoadingIndicators];
} }


// An optional delegate method of OpenEarsEventsObserver which informs that the interruption to the audio session ended. // An optional delegate method of OpenEarsEventsObserver which informs that the interruption to the audio session ended.
Expand Down Expand Up @@ -301,7 +306,7 @@ - (void) stopListening {
#pragma mark - UIAlertView delegate method #pragma mark - UIAlertView delegate method


- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex { - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
if (buttonIndex==0) { if (buttonIndex==1) {
[self.pocketsphinxController stopListening]; [self.pocketsphinxController stopListening];
[recordButton setSelected:NO]; [recordButton setSelected:NO];
listeningLoopRunning=NO; listeningLoopRunning=NO;
Expand Down
Binary file modified WolframDemo/resources/images/loadingIndicator.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0e5c33b

Please sign in to comment.