lfoster0

Forum Replies Created

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

  • Author
    Posts
  • in reply to: NeatSpeech not playing audio after stopping #1024401
    lfoster0
    Participant

    Alright so here is ViewController.mm

    //  ViewController.m
    //  OpenEarsSampleApp
    //
    //  ViewController.m demonstrates the use of the OpenEars framework. 
    //
    //  Copyright Politepix UG (haftungsbeschränkt) 2014. All rights reserved.
    //  https://www.politepix.com
    //  Contact at https://www.politepix.com/contact
    //
    //  This file is licensed under the Politepix Shared Source license found in the root of the source distribution.
    
    #import "ViewController.h"
    
    @implementation ViewController
    
    #pragma mark View Lifecycle
    
    - (void)viewDidLoad {
        [super viewDidLoad];
        
        [self.audioToggleButton addTarget:self action:@selector(toggleAudio) forControlEvents:UIControlEventTouchUpInside];
        
        
        self.openEarsEventsObserver = [[OEEventsObserver alloc] init];
        [self.openEarsEventsObserver setDelegate:self];
        self.audioEnabled = YES;
        
        self.voiceController = [[OEFliteController alloc] init];
        self.voice = [[EmmaAlternate alloc] initWithPitch:0.0 speed:0.0 transform:0.0];
        
        self.tripDescription = @"The route of the tour can be seen on the above map; we begin by walking out of the civic plaza, along 7th until we reach City Hall and the Cenotaph and the beginning of George Street.  We then walk down George Street until 3rd Avenue.  We follow 3rd avenue for 3 blocks until we reach Brunswick Street.  We walk up Brunswick street until 5th Avenue, back towards the library for one block along 5th, we turn left down Quebec and then right onto 4th Avenue to see a few more historic sites before turning right onto Dominion and heading back to the Civic Plaza and the Library for the end of our tour.";
        
    }
    
    - (void) toggleAudio {
        NSLog(@"pressed");
        NSLog(@"Audio Enabled: %i",self.audioEnabled);
        if (self.audioEnabled) {
            NSLog(@"saying text: %@", self.tripDescription);
            [self.voiceController sayWithNeatSpeech:self.tripDescription withVoice:self.voice];
        }
        else {
            [self.voiceController stopSpeaking];
        }
        self.audioEnabled  = !self.audioEnabled;
    }
    
    - (void) neatSpeechWillSay:(NSString *)statement {
        NSLog(@"neatSpeechWillSay %@",statement);
    }
    
    - (void) fliteDidStartSpeaking {
        NSLog(@"SPEEEEAAKKKINNNGGGGG");
    }
    
    - (void) fliteDidFinishSpeaking {
        NSLog(@"DONE SPEAKING");
    }
    
    @end
    

    Here is ViewController.h

    //  ViewController.h
    //  OpenEarsSampleApp
    //
    //  ViewController.h demonstrates the use of the OpenEars framework. 
    //
    //  Copyright Politepix UG (haftungsbeschränkt) 2014. All rights reserved.
    //  https://www.politepix.com
    //  Contact at https://www.politepix.com/contact
    //
    //  This file is licensed under the Politepix Shared Source license found in the root of the source distribution.
    
    #import <UIKit/UIKit.h>
    #import <OpenEars/OEEventsObserver.h>
    #import <EmmaAlternate/EmmaAlternate.h>
    #import <OpenEars/OEFliteController.h>
    #import <NeatSpeechDemo/OEFliteController+NeatSpeech.h>
    
    @interface ViewController : UIViewController <OEEventsObserverDelegate> // This is how we implement the delegate protocol of OEEventsObserver.
    
    @property (weak, nonatomic) IBOutlet UIButton *audioToggleButton;
    
    /* Audio Related */
    @property (nonatomic) BOOL audioEnabled;
    @property (strong, nonatomic) OEEventsObserver *openEarsEventsObserver;
    @property (strong, nonatomic) OEFliteController *voiceController;
    @property (strong, nonatomic) NeatSpeechVoice *voice;
    @property (strong,nonatomic) NSString *tripDescription;
    
    @end
    

    And in the ViewController_iPhone.xib I deleted everything and just added a single button hooked up to
    @property (weak, nonatomic) IBOutlet UIButton *audioToggleButton;

    Same issue as before running on my iPhone 4 running iOS 7.0

    Hope this helps, let me know if theres any other information I can provide!

    in reply to: NeatSpeech not playing audio after stopping #1024381
    lfoster0
    Participant

    Sorry, just having a little trouble setting up the demo application with neat speech. Here is the error I’m getting:

    Undefined symbols for architecture armv7:
      "_OBJC_CLASS_$_EmmaAlternate", referenced from:
          objc-class-ref in ViewController.o
    ld: symbol(s) not found for architecture armv7
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    I set up the project like it said here https://www.politepix.com/neatspeech/ with the -ObjC linker flag, .mm and the libstdc++ set. I have the voices inside of the Framework folder as well for the demo version. Thanks!

    in reply to: NeatSpeech not playing audio after stopping #1024338
    lfoster0
    Participant

    Thanks for the quick response, I really appreciate it :)

    I have only used OpenEars 2.x and I’m initializing the objects in – viewDidLoad.

    Here is the code with some more logging:

    - (void) toggleAudio {
        NSLog(@"pressed");
        NSLog(@"Audio Enabled: %i",self.audioEnabled);
        if (self.audioEnabled) {
            NSLog(@"saying text: %@", self.currentTrip.trip_description);
            [self.voiceController sayWithNeatSpeech:self.currentTrip.trip_description withVoice:self.voice];
        }
        else {
            [self.voiceController stopSpeaking];
        }
        self.audioEnabled  = !self.audioEnabled;
    }
    
    - (void) neatSpeechWillSay:(NSString *)statement {
        NSLog(@"neatSpeechWillSay %@",statement);
    }
    
    - (void) fliteDidStartSpeaking {
        NSLog(@"SPEEEEAAKKKINNNGGGGG");
    }
    
    - (void) fliteDidFinishSpeaking {
        NSLog(@"DONE SPEAKING");
    }
    

    Here is the log from pressing the button 3 times:

    So the first time I press it everything is fine:

    2015-01-15 14:19:06.773 gyyde[11166:60b] pressed
    2015-01-15 14:19:06.789 gyyde[11166:60b] Audio Enabled: 1
    2015-01-15 14:19:06.792 gyyde[11166:60b] saying text: The route of the tour can be seen on the above map; we begin by walking out of the civic plaza, along 7th until we reach City Hall and the Cenotaph and the beginning of George Street.  We then walk down George Street until 3rd Avenue.  We follow 3rd avenue for 3 blocks until we reach Brunswick Street.  We walk up Brunswick street until 5th Avenue, back towards the library for one block along 5th, we turn left down Quebec and then right onto 4th Avenue to see a few more historic sites before turning right onto Dominion and heading back to the Civic Plaza and the Library for the end of our tour.
    2015-01-15 14:19:06.867 gyyde[11166:60b] SPEEEEAAKKKINNNGGGGG

    And then I give it a few seconds to read through things and we have:

    2015-01-15 14:19:10.936 gyyde[11166:60b] neatSpeechWillSay The route of the tour can be seen on the above map;
    2015-01-15 14:19:13.994 gyyde[11166:60b] neatSpeechWillSay we begin by walking out of the civic plaza,

    I press it again and it stops fine, and self.audioEnabled is 0:

    2015-01-15 14:19:20.589 gyyde[11166:60b] pressed
    2015-01-15 14:19:20.596 gyyde[11166:60b] Audio Enabled: 0

    And then pressing it again I get:

    2015-01-15 14:19:39.745 gyyde[11166:60b] pressed
    2015-01-15 14:19:39.748 gyyde[11166:60b] Audio Enabled: 1
    2015-01-15 14:19:39.751 gyyde[11166:60b] saying text: The route of the tour can be seen on the above map; we begin by walking out of the civic plaza, along 7th until we reach City Hall and the Cenotaph and the beginning of George Street.  We then walk down George Street until 3rd Avenue.  We follow 3rd avenue for 3 blocks until we reach Brunswick Street.  We walk up Brunswick street until 5th Avenue, back towards the library for one block along 5th, we turn left down Quebec and then right onto 4th Avenue to see a few more historic sites before turning right onto Dominion and heading back to the Civic Plaza and the Library for the end of our tour.

    So self.audioEnabled is true the next time and it still has the correct text to say again. I left it sitting there for a few minutes and nothing happened :(

    Thanks!

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