AWSPollySynthesizeSpeechURLBuilder Class Reference

Inherits from NSObject
Declared in AWSPollySynthesizeSpeechURLBuilder.h
AWSPollySynthesizeSpeechURLBuilder.m

+ defaultPollySynthesizeSpeechURLBuilder

Returns the singleton service client. If the singleton object does not exist, the SDK instantiates the default service client with defaultServiceConfiguration from [AWSServiceManager defaultServiceManager]. The reference to this object is maintained by the SDK, and you do not need to retain it manually.

+ (instancetype)defaultPollySynthesizeSpeechURLBuilder

Return Value

The default service client.

Discussion

For example, set the default service configuration in - application:didFinishLaunchingWithOptions:

Swift

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    let credentialProvider = AWSCognitoCredentialsProvider(regionType: .USEast1, identityPoolId: "YourIdentityPoolId")
    let configuration = AWSServiceConfiguration(region: .USEast1, credentialsProvider: credentialProvider)
    AWSServiceManager.default().defaultServiceConfiguration = configuration

    return true
}

Objective-C

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    AWSCognitoCredentialsProvider *credentialsProvider = [[AWSCognitoCredentialsProvider alloc] initWithRegionType:AWSRegionUSEast1 identityPoolId:@"YourIdentityPoolId"];
    AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:credentialsProvider];
    [AWSServiceManager defaultServiceManager].defaultServiceConfiguration = configuration;

    return YES;
}

Then call the following to get the default service client:

Swift

let PollyURLBuilder = AWSPollySynthesizeSpeechURLBuilder.default()

Objective-C

AWSPollySynthesizeSpeechURLBuilder *PollyURLBuilder = [AWSPollySynthesizeSpeechURLBuilder defaultPollySynthesizeSpeechURLBuilder];

Declared In

AWSPollySynthesizeSpeechURLBuilder.h

+ registerPollySynthesizeSpeechURLBuilder:forKey:

Creates a service client with the given service configuration and registers it for the key.

+ (void)registerPollySynthesizeSpeechURLBuilder:(AWSServiceConfiguration *)configuration forKey:(NSString *)key

Parameters

configuration

A service configuration object.

key

A string to identify the service client.

Discussion

For example, set the default service configuration in - application:didFinishLaunchingWithOptions:

Swift

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    let credentialProvider = AWSCognitoCredentialsProvider(regionType: .USEast1, identityPoolId: "YourIdentityPoolId")
    let configuration = AWSServiceConfiguration(region: .USWest2, credentialsProvider: credentialProvider)
    AWSPollySynthesizeSpeechURLBuilder.register(configuration, forKey: "USWest2Polly")

    return true
}

Objective-C

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    AWSCognitoCredentialsProvider *credentialsProvider = [[AWSCognitoCredentialsProvider alloc] initWithRegionType:AWSRegionUSEast1 identityPoolId:@"YourIdentityPoolId"];
    AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSWest2 credentialsProvider:credentialsProvider];
    [AWSPollySynthesizeSpeechURLBuilder registerPollySynthesizeSpeechURLBuilder:configuration forKey:@"USWest2Polly"];

    return YES;
}

Then call the following to get the service client:

Swift

let PollyURLBuilder = AWSPollySynthesizeSpeechURLBuilder(forKey: "USWest2Polly")

Objective-C

AWSPollySynthesizeSpeechURLBuilder *PollyURLBuilder = [AWSPollySynthesizeSpeechURLBuilder PollySynthesizeSpeechURLBuilderForKey:@"USWest2Polly"];

Warning: After calling this method, do not modify the configuration object. It may cause unspecified behaviors.

Declared In

AWSPollySynthesizeSpeechURLBuilder.h

+ PollySynthesizeSpeechURLBuilderForKey:

Creates a service client with the given service configuration and registers it for the key.

+ (instancetype)PollySynthesizeSpeechURLBuilderForKey:(NSString *)key

Parameters

configuration

A service configuration object.

key

A string to identify the service client.

Discussion

For example, set the default service configuration in - application:didFinishLaunchingWithOptions:

Swift

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    let credentialProvider = AWSCognitoCredentialsProvider(regionType: .USEast1, identityPoolId: "YourIdentityPoolId")
    let configuration = AWSServiceConfiguration(region: .USWest2, credentialsProvider: credentialProvider)
    AWSPollySynthesizeSpeechURLBuilder.register(configuration, forKey: "USWest2Polly")

    return true
}

Objective-C

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    AWSCognitoCredentialsProvider *credentialsProvider = [[AWSCognitoCredentialsProvider alloc] initWithRegionType:AWSRegionUSEast1 identityPoolId:@"YourIdentityPoolId"];
    AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSWest2 credentialsProvider:credentialsProvider];
    [AWSPollySynthesizeSpeechURLBuilder registerPollySynthesizeSpeechURLBuilder:configuration forKey:@"USWest2Polly"];

    return YES;
}

Then call the following to get the service client:

Swift

let Polly = AWSPollySynthesizeSpeechURLBuilder(forKey: "USWest2Polly")

Objective-C

AWSPollySynthesizeSpeechURLBuilder *Polly = [AWSPollySynthesizeSpeechURLBuilder PollySynthesizeSpeechURLBuilderForKey:@"USWest2Polly"];

Warning: After calling this method, do not modify the configuration object. It may cause unspecified behaviors.

Declared In

AWSPollySynthesizeSpeechURLBuilder.h

+ removePollySynthesizeSpeechURLBuilderForKey:

Removes the service client associated with the key and release it.

+ (void)removePollySynthesizeSpeechURLBuilderForKey:(NSString *)key

Parameters

key

A string to identify the service client.

Discussion

Warning: Before calling this method, make sure no method is running on this client.

Declared In

AWSPollySynthesizeSpeechURLBuilder.h

– getPreSignedURL:

Build a time-limited pre-signed URL to synthesize speech from Amazon Polly, return nil if build process failed.

- (AWSTask<NSURL*> *)getPreSignedURL:(AWSPollySynthesizeSpeechURLBuilderRequest *)getPreSignedURLRequest

Parameters

preSignedURLRequest

The AWSPollySynthesizeSpeechURLBuilderRequest that defines the parameters of the operation.

Return Value

A pre-signed NSURL for the resource. return nil if any errors occured.

Declared In

AWSPollySynthesizeSpeechURLBuilder.h