Having trouble getting started

Home Forums OpenEars Having trouble getting started

Viewing 4 posts - 1 through 4 (of 4 total)

  • Author
    Posts
  • #1017152
    andynov123
    Participant

    I’ve been reviewing the tutorial for synthesized speech/tts and I’ve placed the code snippets in my xcode project and added the framework folder. I have no idea where this from the tutorial is located “Make absolutely sure that in the add dialog “Create groups for any added folders” is selected and NOT “Create folder references for any added folders” because the wrong setting here will prevent your app from working.”

    I’m also confused on how to get this part working

    “In the method where you want to call speech (to test this out, add it to your viewDidLoad method), add the following method call:
    [self.fliteController say:@”A short statement” withVoice:self.slt];”

    If someone could show me how to properly set this up I would greatly appreciate it. I’ve been struggling with it for a few days.

    AppDelegate.h

    #import <UIKit/UIKit.h>
    #import <OpenEars/FliteController.h>
    #import <Slt/Slt.h>

    FliteController *fliteController;
    Slt *slt;

    @interface AppDelegate : UIResponder <UIApplicationDelegate>

    @property (strong, nonatomic) UIWindow *window;
    @property (strong, nonatomic) FliteController *fliteController;
    @property (strong, nonatomic) Slt *slt;

    @end

    AppDelegate.m

    #import “AppDelegate.h”

    @implementation AppDelegate
    @synthesize fliteController;
    @synthesize slt;

    – (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
    // Override point for customization after application launch.
    return YES;
    }

    – (void)applicationWillResignActive:(UIApplication *)application
    {
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
    }

    – (void)applicationDidEnterBackground:(UIApplication *)application
    {
    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
    }

    – (void)applicationWillEnterForeground:(UIApplication *)application
    {
    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
    }

    – (void)applicationDidBecomeActive:(UIApplication *)application
    {
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
    }

    – (void)applicationWillTerminate:(UIApplication *)application
    {
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
    }
    – (FliteController *)fliteController {
    if (fliteController == nil) {
    fliteController = [[FliteController alloc] init];
    }
    return fliteController;
    }

    – (Slt *)slt {
    if (slt == nil) {
    slt = [[Slt alloc] init];
    }
    return slt;
    }
    @end

    #1017158
    Halle Winkler
    Politepix

    Welcome,

    OK, the amount of help I can give with this is a bit limited, because it isn’t so much about OpenEars as it is about more general getting started issues. For general iOS development questions it’s important to find a group and connections where you can get those kinds of answers as you progress. But I have a couple of recommendations which might help.

    To start with, you are adding the tutorial code to the application delegate. That’s the origin of the confusion about the viewDidLoad method — the app delegate is not a view controller so it doesn’t have a viewDidLoad or similar view loading method. Generally, you shouldn’t ever be adding code to the app delegate unless you have a very specific rationale for putting it there. Cocoa Touch enforces the MVC pattern, which means that you are creating view controllers which have views, and the tutorial is written for the code to be added to a view controller. Any app type that Xcode creates will have a view controller in it as well, so look for that and you’ll find viewDidLoad.

    The instruction that is causing confusion is as follows:

    Inside your downloaded OpenEars distribution there is a folder called “Frameworks”. Drag that folder into your app project in Xcode. Make absolutely sure that in the add dialog “Create groups for any added folders” is selected and NOT “Create folder references for any added folders” because the wrong setting here will prevent your app from working.

    So, it says to find the folder called “Frameworks” and drag that entire folder from the Finder into your app project. When you’ve done that, you will see the add dialog that is referred to in the instruction, and the settings in the add dialog that are described in the instruction. This dialog appears any time any file or folder is added to an Xcode project.

    #1017159
    andynov123
    Participant

    Thanks for the advice. I got it working!

    #1017160
    Halle Winkler
    Politepix

    That’s great! Glad it helped.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.