/var/folders/p_/xlvwhg4101z8r81_nl13cds80000gn/T/build1312142854404591961xxx/dist/../build/xcode/src/app/userclasses_NativeCallsImpl.m: In function '-[userclasses_NativeCallsImpl readString:param1:]':
/var/folders/p_/xlvwhg4101z8r81_nl13cds80000gn/T/build1312142854404591961xxx/dist/../build/xcode/src/app/userclasses_NativeCallsImpl.m:9: error: 'AVSpeechSynthesisVoice' undeclared (first use in this function)
/var/folders/p_/xlvwhg4101z8r81_nl13cds80000gn/T/build1312142854404591961xxx/dist/../build/xcode/src/app/userclasses_NativeCallsImpl.m:9: error: (Each undeclared identifier is reported only once
/var/folders/p_/xlvwhg4101z8r81_nl13cds80000gn/T/build1312142854404591961xxx/dist/../build/xcode/src/app/userclasses_NativeCallsImpl.m:9: error: for each function it appears in.)
/var/folders/p_/xlvwhg4101z8r81_nl13cds80000gn/T/build1312142854404591961xxx/dist/../build/xcode/src/app/userclasses_NativeCallsImpl.m:9: error: 'voice' undeclared (first use in this function)
/var/folders/p_/xlvwhg4101z8r81_nl13cds80000gn/T/build1312142854404591961xxx/dist/../build/xcode/src/app/userclasses_NativeCallsImpl.m:10: error: 'AVSpeechUtterance' undeclared (first use in this function)
/var/folders/p_/xlvwhg4101z8r81_nl13cds80000gn/T/build1312142854404591961xxx/dist/../build/xcode/src/app/userclasses_NativeCallsImpl.m:10: error: 'utterance' undeclared (first use in this function)
/var/folders/p_/xlvwhg4101z8r81_nl13cds80000gn/T/build1312142854404591961xxx/dist/../build/xcode/src/app/userclasses_NativeCallsImpl.m:11: error: 'AVSpeechSynthesizer' undeclared (first use in this function)
/var/folders/p_/xlvwhg4101z8r81_nl13cds80000gn/T/build1312142854404591961xxx/dist/../build/xcode/src/app/userclasses_NativeCallsImpl.m:11: error: 'syn' undeclared (first use in this function)
/var/folders/p_/xlvwhg4101z8r81_nl13cds80000gn/T/build1312142854404591961xxx/dist/../build/xcode/src/app/userclasses_NativeCallsImpl.m:12: error: 'AVSpeechUtteranceDefaultSpeechRate' undeclared (first use in this function
My userclasses_NativeCallsImpl.m now contains the following :
#import "userclasses_NativeCallsImpl.h"#import <AVFoundation/AVFoundation.h>
@implementation userclasses_NativeCallsImpl
-(void)readString:(NSString*)param param1:(NSString*)param1{ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSString *lang = [[param1 stringAppendingString:@"-"] stringAppendingString:[param1 uppercaseString]]; AVSpeechSynthesisVoice *voice = [AVSpeechSynthesisVoice voiceWithLanguage:lang]; AVSpeechUtterance *utterance = [AVSpeechUtterance speechUtteranceWithString:param]; AVSpeechSynthesizer *syn = [[[AVSpeechSynthesizer alloc] init] autorelease]; utterance.rate = AVSpeechUtteranceDefaultSpeechRate; utterance.voice = voice; [syn speakUtterance:utterance]; [pool release];}
-(BOOL)isSupported{ return YES;}
@end
An adapted version of the code (with fewer lines) works fine on Xcode, and the test is working as intended, so I don't think it's an inner code issue.
Thanks again for your help !
#import <AVFoundation/AVFoundation.h>