diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4a253ea --- /dev/null +++ b/.gitignore @@ -0,0 +1,26 @@ +# Don't save SpeechKit in repo -- have developer add it from distribution +ATTSpeechKit/ + +.svn + +# Mac ignores +.DS_Store + +# Rails ignores +*.log +tmp/ + +# Xcode ignores +build/ +*.pbxuser +*.mode1v3 +*.mode2v3 +*.swp +*~.nib +*.pbxuser +*.perspective +*.perspectivev3 + +# Xcode 4.0 ignores +xcuserdata/ +*.xcuserstate diff --git a/Speech/iOS/SimpleSpeech/Classes/SimpleSpeechAppDelegate.h b/Speech/iOS/SimpleSpeech/Classes/SimpleSpeechAppDelegate.h new file mode 100755 index 0000000..945d3b9 --- /dev/null +++ b/Speech/iOS/SimpleSpeech/Classes/SimpleSpeechAppDelegate.h @@ -0,0 +1,19 @@ +// SimpleSpeechAppDelegate.h +// SimpleSpeech +// +// Licensed by AT&T under 'Software Development Kit Tools Agreement' 2012. +// TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com/sdk_agreement/ +// Copyright 2012 AT&T Intellectual Property. All rights reserved. +// For more information contact developer.support@att.com http://developer.att.com + +#import + +@class SimpleSpeechViewController; + +@interface SimpleSpeechAppDelegate : NSObject + +@property (nonatomic, retain) IBOutlet UIWindow *window; +@property (nonatomic, retain) IBOutlet SimpleSpeechViewController *viewController; + +@end + diff --git a/Speech/iOS/SimpleSpeech/Classes/SimpleSpeechAppDelegate.m b/Speech/iOS/SimpleSpeech/Classes/SimpleSpeechAppDelegate.m new file mode 100755 index 0000000..85e53fa --- /dev/null +++ b/Speech/iOS/SimpleSpeech/Classes/SimpleSpeechAppDelegate.m @@ -0,0 +1,46 @@ +// SimpleSpeechAppDelegate.m +// SimpleSpeech +// +// Licensed by AT&T under 'Software Development Kit Tools Agreement' 2012. +// TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com/sdk_agreement/ +// Copyright 2012 AT&T Intellectual Property. All rights reserved. +// For more information contact developer.support@att.com http://developer.att.com + +#import "SimpleSpeechAppDelegate.h" +#import "SimpleSpeechViewController.h" + +@implementation SimpleSpeechAppDelegate + +@synthesize window; +@synthesize viewController; + + +#pragma mark - +#pragma mark Application lifecycle + +- (BOOL) application: (UIApplication*) application didFinishLaunchingWithOptions: (NSDictionary*) launchOptions +{ + // Override point for customization after application launch. + + // Hook up the UI from Interface Builder. + self.window.rootViewController = self.viewController; + [self.window makeKeyAndVisible]; + + return YES; +} + +- (void) applicationDidBecomeActive: (UIApplication*) application +{ + // Since the app has come to the foreground, (re-)initialize SpeechKit. + [viewController prepareSpeech]; +} + +- (void) dealloc +{ + [viewController release]; + [window release]; + [super dealloc]; +} + + +@end diff --git a/Speech/iOS/SimpleSpeech/Classes/SimpleSpeechViewController.h b/Speech/iOS/SimpleSpeech/Classes/SimpleSpeechViewController.h new file mode 100755 index 0000000..891a5d0 --- /dev/null +++ b/Speech/iOS/SimpleSpeech/Classes/SimpleSpeechViewController.h @@ -0,0 +1,25 @@ +// SimpleSpeechViewController.h +// SimpleSpeech +// +// Licensed by AT&T under 'Software Development Kit Tools Agreement' 2012. +// TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com/sdk_agreement/ +// Copyright 2012 AT&T Intellectual Property. All rights reserved. +// For more information contact developer.support@att.com http://developer.att.com + +#import +#import "ATTSpeechKit.h" + + +@interface SimpleSpeechViewController : UIViewController + +@property (retain, nonatomic) IBOutlet UITextView* textView; +@property (retain, nonatomic) IBOutlet UIButton* talkButton; + +// Initialize SpeechKit for this app. +- (void) prepareSpeech; + +// Message sent by "Press to Talk" button in UI +- (IBAction) listen: (id) sender; + +@end + diff --git a/Speech/iOS/SimpleSpeech/Classes/SimpleSpeechViewController.m b/Speech/iOS/SimpleSpeech/Classes/SimpleSpeechViewController.m new file mode 100755 index 0000000..c77f1ca --- /dev/null +++ b/Speech/iOS/SimpleSpeech/Classes/SimpleSpeechViewController.m @@ -0,0 +1,159 @@ +// SimpleSpeechViewController.m +// SimpleSpeech +// +// Licensed by AT&T under 'Software Development Kit Tools Agreement' 2012. +// TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com/sdk_agreement/ +// Copyright 2012 AT&T Intellectual Property. All rights reserved. +// For more information contact developer.support@att.com http://developer.att.com + +#import "SimpleSpeechViewController.h" +#import "SpeechAuth.h" + +// Replace the URLs below with the appropriate ones for your Speech API account. +#define SPEECH_URL @"https://api.att.com/rest/1/SpeechToText" +#define OAUTH_URL @"http://api.att.com/oauth/token" +#error Add code to unobfuscate your Speech API credentials in the macros below, then delete this line. +#define API_KEY MY_UNOBFUSCATOR(my_obfuscated_api_key) +#define API_SECRET MY_UNOBFUSCATOR(my_obfuscated_api_key) + +@interface SimpleSpeechViewController () +- (void) speechAuthFailed: (NSError*) error; +@end + +@implementation SimpleSpeechViewController + +@synthesize textView; +@synthesize talkButton; + +#pragma mark - +#pragma mark Lifecyle + +- (void) dealloc +{ + [textView release]; + [talkButton release]; + [super dealloc]; +} + + +// Initialize SpeechKit for this app. +- (void) prepareSpeech +{ + // Access the SpeechKit singleton. + ATTSpeechService* speechService = [ATTSpeechService sharedSpeechService]; + + // Point to the SpeechToText API. + speechService.recognitionURL = [NSURL URLWithString: SPEECH_URL]; + + // Hook ourselves up as a delegate so we can get called back with the response. + speechService.delegate = self; + + // Use default speech UI. + speechService.showUI = YES; + + // Choose the speech recognition package. + speechService.speechContext = @"BusinessSearch"; + + // Start the OAuth background operation, disabling the Talk button until + // it's done. + talkButton.enabled = NO; + [[SpeechAuth authenticatorForService: [NSURL URLWithString: OAUTH_URL] + withId: API_KEY secret: API_SECRET] + fetchTo: ^(NSString* token, NSError* error) { + if (token) { + speechService.bearerAuthToken = token; + talkButton.enabled = YES; + } + else + [self speechAuthFailed: error]; + }]; + + // Wake the audio components so there is minimal delay on the first request. + [speechService prepare]; +} + + +#pragma mark - +#pragma mark Actions + +// Perform the action of the "Push to talk" button +- (IBAction) listen: (id) sender +{ + NSLog(@"Starting speech request"); + + // Start listening via the microphone. + ATTSpeechService* speechService = [ATTSpeechService sharedSpeechService]; + [speechService startWithMicrophone]; +} + +#pragma mark - +#pragma mark Speech Service Delegate Methods + +- (void) speechServiceSucceeded: (ATTSpeechService*) speechService +{ + NSLog(@"Speech service succeeded"); + + // Extract the needed data from the SpeechService object: + // For raw bytes, read speechService.responseData. + // For a JSON tree, read speechService.responseDictionary. + // For the n-best ASR strings, use speechService.responseStrings. + + // In this example, use the ASR strings. + // There can be 0 strings, 1 empty string, or 1 non-empty string. + // Display the recognized text in the interface is it's non-empty, + // otherwise have the user try again. + NSArray* nbest = speechService.responseStrings; + NSString* recognizedText = @""; + if (nbest != nil && nbest.count > 0) + recognizedText = [nbest objectAtIndex: 0]; + if (recognizedText.length) // non-empty? + [self.textView setText: recognizedText]; + else { + UIAlertView* alert = [[UIAlertView alloc] initWithTitle: @"Didn't recognize speech" + message: @"Please try again." + delegate: self + cancelButtonTitle: @"OK" + otherButtonTitles: nil]; + [alert show]; + [alert release]; + } +} + +- (void) speechService: (ATTSpeechService*) speechService + failedWithError: (NSError*) error +{ + if ([error.domain isEqualToString: ATTSpeechServiceErrorDomain] + && (error.code == ATTSpeechServiceErrorCodeCanceledByUser)) { + NSLog(@"Speech service canceled"); + // Nothing to do in this case + return; + } + NSLog(@"Speech service had an error: %@", error); + + UIAlertView* alert = [[UIAlertView alloc] initWithTitle: @"An error occurred" + message: @"Please try again later." + delegate: self + cancelButtonTitle: @"OK" + otherButtonTitles: nil]; + [alert show]; + [alert release]; +} + +#pragma mark - +#pragma mark OAuth + +/* The SpeechAuth authentication failed. */ +- (void) speechAuthFailed: (NSError*) error +{ + NSLog(@"OAuth error: %@", error); + UIAlertView* alert = + [[UIAlertView alloc] initWithTitle: @"Speech Unavailable" + message: @"This app was rejected by the speech service. Contact the developer for an update." + delegate: self + cancelButtonTitle: @"OK" + otherButtonTitles: nil]; + [alert show]; + [alert release]; +} + +@end diff --git a/Speech/iOS/SimpleSpeech/Classes/SpeechAuth.h b/Speech/iOS/SimpleSpeech/Classes/SpeechAuth.h new file mode 100755 index 0000000..f3b2249 --- /dev/null +++ b/Speech/iOS/SimpleSpeech/Classes/SpeechAuth.h @@ -0,0 +1,38 @@ +// SpeechAuth.h +// +// Licensed by AT&T under 'Software Development Kit Tools Agreement' 2012. +// TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com/sdk_agreement/ +// Copyright 2012 AT&T Intellectual Property. All rights reserved. +// For more information contact developer.support@att.com http://developer.att.com + +#import + +@class NSString, NSError; + +/** + * Type of block called when SpeechAuth gets credential or fails. + * token will be the OAuth bearer token. + * If there's an problem authenticating, token will be nil and + * error will contain the error. + * TO DO: document the keys in error.userInfo +**/ +typedef void (^SpeechAuthBlock)(NSString* token, NSError* error); + +/** + * Fetches OAuth client credentials, calling a block when done. +**/ +@interface SpeechAuth : NSObject { +} + +/** Creates a SpeechAuth object with the given credentials. **/ ++ (SpeechAuth*) authenticatorForService: (NSURL*) oauth_url + withId: (NSString*) client_id + secret: (NSString*) client_secret; + +/*! Beging fetching the credentials. Will call block when done. !*/ +- (void) fetchTo: (SpeechAuthBlock) block; + +/*! Stop fetching. Once stopped, loading may not resume. !*/ +- (void) cancel; + +@end diff --git a/Speech/iOS/SimpleSpeech/Classes/SpeechAuth.m b/Speech/iOS/SimpleSpeech/Classes/SpeechAuth.m new file mode 100755 index 0000000..90c15cf --- /dev/null +++ b/Speech/iOS/SimpleSpeech/Classes/SpeechAuth.m @@ -0,0 +1,262 @@ +// SpeechAuth.m +// +// Licensed by AT&T under 'Software Development Kit Tools Agreement' 2012. +// TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com/sdk_agreement/ +// Copyright 2012 AT&T Intellectual Property. All rights reserved. +// For more information contact developer.support@att.com http://developer.att.com + +#import "SpeechAuth.h" +#import "ATTSpeechKit.h" + +typedef enum +{ + LoaderStateUnknown = 0, + LoaderStateInitialized, + LoaderStateConnecting, + LoaderStateReceivedResponse, + LoaderStateReceivedData, + LoaderStateFinished, + LoaderStateFailed, + LoaderStateCanceling, + LoaderStateCanceled +} LoaderState; + +// Memory Management +// +// This object will retain its initialiation parameters (the NSURLRequest) +// during the lifetime of this object. +// It will retain the connection, response, data, and delegate only between +// the call to start and the callbacks to the delegate. +// It will also add a retain of itself during that interval. That way, the +// client can autorelease this object after starting, and this object +// will remain in memory while active. + +@interface SpeechAuth () { + @private + LoaderState state; +} +@property (copy) SpeechAuthBlock authenticatedBlock; +@property (copy) NSURLRequest* request;// Make a copy in case it's mutable +@property (retain) NSURLConnection* connection; +@property (retain) NSURLResponse* response; +@property (retain) NSMutableData* data; + +- (NSInteger) statusCode; +- (void) clear; +@end + +@implementation SpeechAuth + +@synthesize authenticatedBlock = _authenticatedBlock; +@synthesize request = _request; +@synthesize connection = _connection; +@synthesize response = _response; +@synthesize data = _data; + + +- (id) initWithRequest: (NSURLRequest*) request +{ + self = [super init]; + if (self != nil) + { + // First see if the request can be handled. + if (![NSURLConnection canHandleRequest: request]) { + [self release]; + return nil; + } + self.request = request; + self.data = [NSMutableData data]; + _connection = nil; // Create connection when client wants to start loading. + _response = nil; + state = LoaderStateInitialized; + } + return self; +} + ++ (SpeechAuth*) authenticatorForService: (NSURL*) oauth_url + withId: (NSString*) client_id + secret: (NSString*) client_secret +{ + NSMutableURLRequest* request = [NSMutableURLRequest requestWithURL: oauth_url]; + NSString* postString = [NSString stringWithFormat: + @"grant_type=client_credentials&scope=SPEECH&client_id=%@&client_secret=%@", + client_id, client_secret]; + request.HTTPMethod = @"POST"; + request.HTTPBody = [postString dataUsingEncoding:NSUTF8StringEncoding]; + + // The OAuth server is quite quick. + // The only timeouts will be on network failures. + request.timeoutInterval = 5; + return [[[self alloc] initWithRequest: request] autorelease]; + +} + +- (void) dealloc +{ + // We should have already been cleared, but just in case... + [_connection cancel]; + + self.request = nil; + self.response = nil; + self.data = nil; + self.authenticatedBlock = nil; + self.connection = nil; + + [super dealloc]; +} + +- (NSInteger) statusCode +{ + int code; + if (_response == nil) + code= 100; // HTTP "Continue" + else if ([_response respondsToSelector: @selector(statusCode)]) + code = [(NSHTTPURLResponse*)_response statusCode]; + // The other kind of response we support is file: URLs. + // The behavior of NSURLConnection in that case is to only call connection:didReceiveResponse: + // when the file is found. + // When it's not found, it calls connection:didFailWithError: directly. + // So if our response is non-nil, assume it's OK. + else + code = 200 ; + return code; +} + +- (void) start +{ + state = LoaderStateConnecting; + // Add a retention to this object do it doesn't dispose during the connection. + [self retain]; + + // Allocate the NSURLConnection and start it in one step. + self.connection = [NSURLConnection connectionWithRequest: _request + delegate: self]; + + if (_connection == nil) { + state = LoaderStateFailed; + // Report the error the delegate on the next time through the runloop. + [[NSOperationQueue mainQueue] addOperationWithBlock: ^{ + // TO DO: the arguments to NSError are completely arbitrary! + NSError* error = [NSError errorWithDomain: ATTSpeechServiceErrorDomain + code: ATTSpeechServiceErrorCodeConnectionFailure + userInfo: nil]; + _authenticatedBlock(nil, error); + [self clear]; + }]; + return; + } + // Don't call [_connection start], since it's already started. +} + +- (void) fetchTo: (SpeechAuthBlock) block +{ + self.authenticatedBlock = block; + [self start]; +} + +- (void) clear +{ + // Completely dispose the connection, delegate, and response data + // when we are done. + self.authenticatedBlock = nil; + [_connection cancel]; + self.connection = nil; + self.response = nil; + _data.length = 0; + // And release the retain count we added during start. + [self release]; +} + +- (void) cancel +{ + // Completely dispose the connection when we cancel it. + if (state != LoaderStateFinished) + { + state = LoaderStateCanceling; + [self clear]; + } +} + +// NSURLConnection delegate methods + + +- (void) connection: (NSURLConnection*) connection + didReceiveResponse: (NSURLResponse*) response +{ + // The connection just got a new response. Clear out anything we've already loaded. + self.response = response; + _data.length = 0; + state = LoaderStateReceivedResponse; +} + +- (void) connection: (NSURLConnection*) connection + didReceiveData: (NSData*) data +{ + // The connection is sending us some data incrementally. + [_data appendData: data]; + state = LoaderStateReceivedData; +} + +- (void) connectionDidFinishLoading: (NSURLConnection*) connection +{ + // Loading is complete. + state = LoaderStateFinished; + + NSError* error = nil; + BOOL succeeded = NO; + if (self.statusCode == 200 && _data.length) { + // Use iOS 5 JSON library to decode OAuth response. + // Be very circumspect about the data types so that we don't crash on bad data. + NSDictionary* json = [NSJSONSerialization JSONObjectWithData: _data options: 0 error: &error]; + if ([json isKindOfClass: [NSDictionary class]]) { + id token = [json objectForKey: @"access_token"]; + if (token != nil) { + // We have a token, so give it to the delegate. + _authenticatedBlock([token description], nil); + succeeded = YES; + } + } + } + if (!succeeded) { + // TO DO: What data should we put in the userInfo? + if (error == nil) + [NSError errorWithDomain: ATTSpeechServiceHTTPErrorDomain + code: self.statusCode userInfo: nil]; + _authenticatedBlock(nil, error); + } + + // The callback is complete, so clean up. + [self clear]; +} + +- (void) connection: (NSURLConnection*) connection didFailWithError: (NSError*) error +{ + // Loading failed. + state = LoaderStateFailed; + + _authenticatedBlock(nil, error); + + // The callback is complete, so clean up. + [self clear]; +} + +// HACK: For bad SSL servers +-(BOOL) connection: (NSURLConnection*) connection + canAuthenticateAgainstProtectionSpace: (NSURLProtectionSpace*) protectionSpace +{ + return [protectionSpace.authenticationMethod isEqualToString: NSURLAuthenticationMethodServerTrust]; +} + +-(void) connection: (NSURLConnection*) connection + didReceiveAuthenticationChallenge: (NSURLAuthenticationChallenge*) challenge +{ + if ([challenge.protectionSpace.authenticationMethod isEqualToString: NSURLAuthenticationMethodServerTrust]) + //if ([trustedHosts containsObject: challenge.protectionSpace.host]) + [challenge.sender useCredential: [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust] + forAuthenticationChallenge: challenge]; + [challenge.sender continueWithoutCredentialForAuthenticationChallenge: challenge]; +} + +@end + + diff --git a/Speech/iOS/SimpleSpeech/MainWindow.xib b/Speech/iOS/SimpleSpeech/MainWindow.xib new file mode 100755 index 0000000..458a40d --- /dev/null +++ b/Speech/iOS/SimpleSpeech/MainWindow.xib @@ -0,0 +1,444 @@ + + + + 1024 + 10D571 + 786 + 1038.29 + 460.00 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 112 + + + YES + + + + YES + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + YES + + YES + + + YES + + + + YES + + IBFilesOwner + IBCocoaTouchFramework + + + IBFirstResponder + IBCocoaTouchFramework + + + IBCocoaTouchFramework + + + SimpleSpeechViewController + + + 1 + + IBCocoaTouchFramework + NO + + + + 292 + {320, 480} + + 1 + MSAxIDEAA + + NO + NO + + IBCocoaTouchFramework + YES + + + + + YES + + + delegate + + + + 4 + + + + viewController + + + + 11 + + + + window + + + + 14 + + + + + YES + + 0 + + + + + + -1 + + + File's Owner + + + 3 + + + SimpleSpeech App Delegate + + + -2 + + + + + 10 + + + + + 12 + + + + + + + YES + + YES + -1.CustomClassName + -2.CustomClassName + 10.CustomClassName + 10.IBEditorWindowLastContentRect + 10.IBPluginDependency + 12.IBEditorWindowLastContentRect + 12.IBPluginDependency + 3.CustomClassName + 3.IBPluginDependency + + + YES + UIApplication + UIResponder + SimpleSpeechViewController + {{234, 376}, {320, 480}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + {{525, 346}, {320, 480}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + SimpleSpeechAppDelegate + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 15 + + + + YES + + UIWindow + UIView + + IBUserSource + + + + + SimpleSpeechAppDelegate + NSObject + + YES + + YES + viewController + window + + + YES + SimpleSpeechViewController + UIWindow + + + + YES + + YES + viewController + window + + + YES + + viewController + SimpleSpeechViewController + + + window + UIWindow + + + + + IBProjectSource + Classes/SimpleSpeechAppDelegate.h + + + + SimpleSpeechAppDelegate + NSObject + + IBUserSource + + + + + SimpleSpeechViewController + UIViewController + + IBProjectSource + Classes/SimpleSpeechViewController.h + + + + + YES + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UIAccessibility.h + + + + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UINibLoading.h + + + + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UIResponder.h + + + + UIApplication + UIResponder + + IBFrameworkSource + UIKit.framework/Headers/UIApplication.h + + + + UIResponder + NSObject + + + + UISearchBar + UIView + + IBFrameworkSource + UIKit.framework/Headers/UISearchBar.h + + + + UISearchDisplayController + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UISearchDisplayController.h + + + + UIView + + IBFrameworkSource + UIKit.framework/Headers/UITextField.h + + + + UIView + UIResponder + + IBFrameworkSource + UIKit.framework/Headers/UIView.h + + + + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UINavigationController.h + + + + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UIPopoverController.h + + + + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UISplitViewController.h + + + + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UITabBarController.h + + + + UIViewController + UIResponder + + IBFrameworkSource + UIKit.framework/Headers/UIViewController.h + + + + UIWindow + UIView + + IBFrameworkSource + UIKit.framework/Headers/UIWindow.h + + + + + 0 + IBCocoaTouchFramework + + com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS + + + + com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 + + + YES + SimpleSpeech.xcodeproj + 3 + 112 + + diff --git a/Speech/iOS/SimpleSpeech/README.markdown b/Speech/iOS/SimpleSpeech/README.markdown new file mode 100755 index 0000000..90d25aa --- /dev/null +++ b/Speech/iOS/SimpleSpeech/README.markdown @@ -0,0 +1,29 @@ +Licensed by AT&T under 'Software Development Kit Tools Agreement' 2012. +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com/sdk_agreement/ +Copyright 2012 AT&T Intellectual Property. All rights reserved. +For more information contact developer.support@att.com http://developer.att.com + +# SimpleSpeech example app for AT&T SpeechKit + +This sample app includes source code and an Xcode project to show how to call the AT&T SpeechKit from an application. The app displays a bare-bones screen with button that initiates a speech interaction and a text area to show the recognition result. + +## Setting up the project + +The SimpleSpeech Xcode project is already configured to link with SpeechKit, but it needs a copy of the files from the SpeechKit distribution. Follow these steps to add the latest SpeechKit to the project. + +1. Unzip the AT&T Speech SDK into its own folder. +2. Copy the files `ATTSpeechKit.a` and `ATTSpeechKit.h` into the `ATTSpeechKit` subfolder of this sample app. +3. Open the SimpleSpeech Xcode project. +4. Expand the `ATTSpeechKit` group within the project window. Both files should appear in black text, not red (which would indicate that Xcode can't find them). + +## Running the sample + +Before building the sample app, you will need to add the configuration for your Speech Enabler account: the URL of the service, your application's API key and API secret. Add those strings to the top of `SimpleSpeechViewController.m`. (Make sure you obfuscate your API key and secret before releasing your app to the public.) + +## Understanding the speech code + +The main code of the sample app is in the SimpleSpeechViewController class. Look in the `-[prepareSpeech]` and `-[listen:]` methods for examples of setting up and starting a speech interaction. Look in the `-[speechServiceSucceeded:]` and `[speechService:failedWithError:]` methods for examples of handling recognition responses. Look in `-[prepareSpeech]` for examples of obtaining an OAuth access token. + +## OAuth sample code + +The SpeechAuth class provides example code for authenticating your application with the OAuth client credentials protocol. It performs an asynchronous network request for an OAuth access token that can be used in the Speech API. diff --git a/Speech/iOS/SimpleSpeech/SimpleSpeech-Info.plist b/Speech/iOS/SimpleSpeech/SimpleSpeech-Info.plist new file mode 100755 index 0000000..3289444 --- /dev/null +++ b/Speech/iOS/SimpleSpeech/SimpleSpeech-Info.plist @@ -0,0 +1,30 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + com.yourcompany.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + NSMainNibFile + MainWindow + + diff --git a/Speech/iOS/SimpleSpeech/SimpleSpeech.xcodeproj/project.pbxproj b/Speech/iOS/SimpleSpeech/SimpleSpeech.xcodeproj/project.pbxproj new file mode 100755 index 0000000..544dfab --- /dev/null +++ b/Speech/iOS/SimpleSpeech/SimpleSpeech.xcodeproj/project.pbxproj @@ -0,0 +1,300 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 1D3623260D0F684500981E51 /* SimpleSpeechAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* SimpleSpeechAppDelegate.m */; }; + 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; + 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; + 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; + 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; }; + 2899E5220DE3E06400AC0155 /* SimpleSpeechViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2899E5210DE3E06400AC0155 /* SimpleSpeechViewController.xib */; }; + 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; }; + 28D7ACF80DDB3853001CB0EB /* SimpleSpeechViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28D7ACF70DDB3853001CB0EB /* SimpleSpeechViewController.m */; }; + 7E7553CC159E681300E521B0 /* SpeechAuth.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E7553CB159E681300E521B0 /* SpeechAuth.m */; }; + 7E87FE3714EC83800006D40C /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E87FE3514EC83800006D40C /* AVFoundation.framework */; }; + 7E87FE3814EC83800006D40C /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E87FE3614EC83800006D40C /* Security.framework */; }; + BBFA2BF314181BD800514E52 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BBFA2BF214181BD800514E52 /* AudioToolbox.framework */; }; + BBFA2BF514181BD800514E52 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BBFA2BF414181BD800514E52 /* CFNetwork.framework */; }; + BBFA2C4D141845C800514E52 /* ATTSpeechKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BBFA2C4B141845C800514E52 /* ATTSpeechKit.a */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 1D3623240D0F684500981E51 /* SimpleSpeechAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleSpeechAppDelegate.h; sourceTree = ""; }; + 1D3623250D0F684500981E51 /* SimpleSpeechAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SimpleSpeechAppDelegate.m; sourceTree = ""; }; + 1D6058910D05DD3D006BFB54 /* SimpleSpeech.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SimpleSpeech.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 288765A40DF7441C002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 2899E5210DE3E06400AC0155 /* SimpleSpeechViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SimpleSpeechViewController.xib; sourceTree = ""; }; + 28AD733E0D9D9553002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = ""; }; + 28D7ACF60DDB3853001CB0EB /* SimpleSpeechViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleSpeechViewController.h; sourceTree = ""; }; + 28D7ACF70DDB3853001CB0EB /* SimpleSpeechViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SimpleSpeechViewController.m; sourceTree = ""; }; + 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 32CA4F630368D1EE00C91783 /* SimpleSpeech_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleSpeech_Prefix.pch; sourceTree = ""; }; + 7E7553CA159E681300E521B0 /* SpeechAuth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpeechAuth.h; sourceTree = ""; }; + 7E7553CB159E681300E521B0 /* SpeechAuth.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SpeechAuth.m; sourceTree = ""; }; + 7E87FE3514EC83800006D40C /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; + 7E87FE3614EC83800006D40C /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; + 8D1107310486CEB800E47090 /* SimpleSpeech-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "SimpleSpeech-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; + BBFA2BF214181BD800514E52 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; + BBFA2BF414181BD800514E52 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; }; + BBFA2C4B141845C800514E52 /* ATTSpeechKit.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = ATTSpeechKit.a; sourceTree = ""; }; + BBFA2C4C141845C800514E52 /* ATTSpeechKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ATTSpeechKit.h; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 7E87FE3714EC83800006D40C /* AVFoundation.framework in Frameworks */, + 7E87FE3814EC83800006D40C /* Security.framework in Frameworks */, + 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, + 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, + 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */, + BBFA2BF314181BD800514E52 /* AudioToolbox.framework in Frameworks */, + BBFA2BF514181BD800514E52 /* CFNetwork.framework in Frameworks */, + BBFA2C4D141845C800514E52 /* ATTSpeechKit.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 080E96DDFE201D6D7F000001 /* Classes */ = { + isa = PBXGroup; + children = ( + 1D3623240D0F684500981E51 /* SimpleSpeechAppDelegate.h */, + 1D3623250D0F684500981E51 /* SimpleSpeechAppDelegate.m */, + 28D7ACF60DDB3853001CB0EB /* SimpleSpeechViewController.h */, + 28D7ACF70DDB3853001CB0EB /* SimpleSpeechViewController.m */, + 7E7553CA159E681300E521B0 /* SpeechAuth.h */, + 7E7553CB159E681300E521B0 /* SpeechAuth.m */, + ); + path = Classes; + sourceTree = ""; + }; + 19C28FACFE9D520D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 1D6058910D05DD3D006BFB54 /* SimpleSpeech.app */, + ); + name = Products; + sourceTree = ""; + }; + 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { + isa = PBXGroup; + children = ( + 7E87FE3514EC83800006D40C /* AVFoundation.framework */, + 7E87FE3614EC83800006D40C /* Security.framework */, + 080E96DDFE201D6D7F000001 /* Classes */, + 29B97315FDCFA39411CA2CEA /* Other Sources */, + 29B97317FDCFA39411CA2CEA /* Resources */, + 29B97323FDCFA39411CA2CEA /* Frameworks */, + BBFA2C4A141845C800514E52 /* ATTSpeechKit */, + 19C28FACFE9D520D11CA2CBB /* Products */, + ); + name = CustomTemplate; + sourceTree = ""; + }; + 29B97315FDCFA39411CA2CEA /* Other Sources */ = { + isa = PBXGroup; + children = ( + 32CA4F630368D1EE00C91783 /* SimpleSpeech_Prefix.pch */, + 29B97316FDCFA39411CA2CEA /* main.m */, + ); + name = "Other Sources"; + sourceTree = ""; + }; + 29B97317FDCFA39411CA2CEA /* Resources */ = { + isa = PBXGroup; + children = ( + 2899E5210DE3E06400AC0155 /* SimpleSpeechViewController.xib */, + 28AD733E0D9D9553002E5188 /* MainWindow.xib */, + 8D1107310486CEB800E47090 /* SimpleSpeech-Info.plist */, + ); + name = Resources; + sourceTree = ""; + }; + 29B97323FDCFA39411CA2CEA /* Frameworks */ = { + isa = PBXGroup; + children = ( + 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, + 1D30AB110D05D00D00671497 /* Foundation.framework */, + 288765A40DF7441C002DB57D /* CoreGraphics.framework */, + BBFA2BF214181BD800514E52 /* AudioToolbox.framework */, + BBFA2BF414181BD800514E52 /* CFNetwork.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + BBFA2C4A141845C800514E52 /* ATTSpeechKit */ = { + isa = PBXGroup; + children = ( + BBFA2C4B141845C800514E52 /* ATTSpeechKit.a */, + BBFA2C4C141845C800514E52 /* ATTSpeechKit.h */, + ); + path = ATTSpeechKit; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 1D6058900D05DD3D006BFB54 /* SimpleSpeech */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "SimpleSpeech" */; + buildPhases = ( + 1D60588D0D05DD3D006BFB54 /* Resources */, + 1D60588E0D05DD3D006BFB54 /* Sources */, + 1D60588F0D05DD3D006BFB54 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SimpleSpeech; + productName = SimpleSpeech; + productReference = 1D6058910D05DD3D006BFB54 /* SimpleSpeech.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 29B97313FDCFA39411CA2CEA /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0440; + }; + buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "SimpleSpeech" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 1; + knownRegions = ( + English, + Japanese, + French, + German, + ); + mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 1D6058900D05DD3D006BFB54 /* SimpleSpeech */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 1D60588D0D05DD3D006BFB54 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */, + 2899E5220DE3E06400AC0155 /* SimpleSpeechViewController.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 1D60588E0D05DD3D006BFB54 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1D60589B0D05DD56006BFB54 /* main.m in Sources */, + 1D3623260D0F684500981E51 /* SimpleSpeechAppDelegate.m in Sources */, + 28D7ACF80DDB3853001CB0EB /* SimpleSpeechViewController.m in Sources */, + 7E7553CC159E681300E521B0 /* SpeechAuth.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 1D6058940D05DD3E006BFB54 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = SimpleSpeech_Prefix.pch; + INFOPLIST_FILE = "SimpleSpeech-Info.plist"; + PRODUCT_NAME = SimpleSpeech; + }; + name = Debug; + }; + 1D6058950D05DD3E006BFB54 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + COPY_PHASE_STRIP = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = SimpleSpeech_Prefix.pch; + INFOPLIST_FILE = "SimpleSpeech-Info.plist"; + PRODUCT_NAME = SimpleSpeech; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + C01FCF4F08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_THUMB_SUPPORT = NO; + GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 4.0; + SDKROOT = iphoneos; + }; + name = Debug; + }; + C01FCF5008A954540054247B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 4.0; + OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; + SDKROOT = iphoneos; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "SimpleSpeech" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1D6058940D05DD3E006BFB54 /* Debug */, + 1D6058950D05DD3E006BFB54 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C01FCF4E08A954540054247B /* Build configuration list for PBXProject "SimpleSpeech" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C01FCF4F08A954540054247B /* Debug */, + C01FCF5008A954540054247B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; +} diff --git a/Speech/iOS/SimpleSpeech/SimpleSpeech.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Speech/iOS/SimpleSpeech/SimpleSpeech.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100755 index 0000000..62542e8 --- /dev/null +++ b/Speech/iOS/SimpleSpeech/SimpleSpeech.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Speech/iOS/SimpleSpeech/SimpleSpeechViewController.xib b/Speech/iOS/SimpleSpeech/SimpleSpeechViewController.xib new file mode 100755 index 0000000..6cebd09 --- /dev/null +++ b/Speech/iOS/SimpleSpeech/SimpleSpeechViewController.xib @@ -0,0 +1,362 @@ + + + + 1280 + 11E53 + 2182 + 1138.47 + 569.00 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 1181 + + + YES + IBUITextView + IBUIButton + IBUIView + IBUILabel + IBProxyObject + + + YES + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + PluginDependencyRecalculationVersion + + + + YES + + IBFilesOwner + IBCocoaTouchFramework + + + IBFirstResponder + IBCocoaTouchFramework + + + + 274 + + YES + + + 292 + {{20, 20}, {77, 21}} + + + + NO + YES + 7 + NO + IBCocoaTouchFramework + Response + + 1 + MC41IDAuNSAwLjUAA + + + 3 + MQA + + + 1 + MC41IDAuNSAwLjUAA + + 1 + 10 + + 1 + 17 + + + Helvetica + 17 + 16 + + + + + 292 + {{20, 49}, {280, 113}} + + + + + 1 + MSAxIDEAA + + YES + YES + IBCocoaTouchFramework + NO + + + 2 + IBCocoaTouchFramework + + + + + + + 292 + {{100, 357}, {119, 37}} + + + + NO + IBCocoaTouchFramework + 0 + 0 + 1 + Please wait + Press to Talk + + + 1 + MC42MzU4Njk1NiAwLjYzNTg2OTU2IDAuNjM1ODY5NTYAA + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + 3 + MC41AA + + + Helvetica-Bold + Helvetica + 2 + 15 + + + Helvetica-Bold + 15 + 16 + + + + {{0, 20}, {320, 460}} + + + + + 3 + MC43NQA + + 2 + + + NO + + IBCocoaTouchFramework + + + + + YES + + + view + + + + 7 + + + + talkButton + + + + 13 + + + + textView + + + + 14 + + + + delegate + + + + 15 + + + + listen: + + + 7 + + 16 + + + + + YES + + 0 + + YES + + + + + + -1 + + + File's Owner + + + -2 + + + + + 6 + + + YES + + + + + + + + 10 + + + + + 11 + + + + + 12 + + + + + + + YES + + YES + -1.CustomClassName + -1.IBPluginDependency + -2.CustomClassName + -2.IBPluginDependency + 10.IBPluginDependency + 11.IBPluginDependency + 12.IBPluginDependency + 12.IBUIButtonInspectorSelectedStateConfigurationMetadataKey + 6.IBPluginDependency + + + YES + SimpleSpeechViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + YES + + + + + + YES + + + + + 16 + + + + YES + + SimpleSpeechViewController + UIViewController + + listen: + id + + + listen: + + listen: + id + + + + YES + + YES + talkButton + textView + + + YES + UIButton + UITextView + + + + YES + + YES + talkButton + textView + + + YES + + talkButton + UIButton + + + textView + UITextView + + + + + IBProjectSource + ./Classes/SimpleSpeechViewController.h + + + + + 0 + IBCocoaTouchFramework + + com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 + + + YES + 3 + 1181 + + diff --git a/Speech/iOS/SimpleSpeech/SimpleSpeech_Prefix.pch b/Speech/iOS/SimpleSpeech/SimpleSpeech_Prefix.pch new file mode 100755 index 0000000..083def6 --- /dev/null +++ b/Speech/iOS/SimpleSpeech/SimpleSpeech_Prefix.pch @@ -0,0 +1,11 @@ +// Prefix header for all source files of the 'SimpleSpeech' target in the 'SimpleSpeech' project +// +// Licensed by AT&T under 'Software Development Kit Tools Agreement' 2012. +// TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com/sdk_agreement/ +// Copyright 2012 AT&T Intellectual Property. All rights reserved. +// For more information contact developer.support@att.com http://developer.att.com + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/Speech/iOS/SimpleSpeech/main.m b/Speech/iOS/SimpleSpeech/main.m new file mode 100755 index 0000000..108ca5b --- /dev/null +++ b/Speech/iOS/SimpleSpeech/main.m @@ -0,0 +1,17 @@ +// main.m +// SimpleSpeech +// +// Licensed by AT&T under 'Software Development Kit Tools Agreement' 2012. +// TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com/sdk_agreement/ +// Copyright 2012 AT&T Intellectual Property. All rights reserved. +// For more information contact developer.support@att.com http://developer.att.com + +#import + +int main(int argc, char *argv[]) { + + NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; + int retVal = UIApplicationMain(argc, argv, nil, nil); + [pool release]; + return retVal; +}