AWSPollySynthesizeSpeechURLBuilder
Objective-C
@interface AWSPollySynthesizeSpeechURLBuilder : NSObject
/**
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.
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];
@return The default service client.
*/
+ (instancetype)defaultPollySynthesizeSpeechURLBuilder;
/**
Creates a service client with the given service configuration and registers it for the key.
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.
@param configuration A service configuration object.
@param key A string to identify the service client.
*/
+ (void)registerPollySynthesizeSpeechURLBuilder:(AWSServiceConfiguration *)configuration forKey:(NSString *)key;
/**
Creates a service client with the given service configuration and registers it for the key.
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.
@param configuration A service configuration object.
@param key A string to identify the service client.
*/
+ (instancetype)PollySynthesizeSpeechURLBuilderForKey:(NSString *)key;
/**
Removes the service client associated with the key and release it.
@warning Before calling this method, make sure no method is running on this client.
@param key A string to identify the service client.
*/
+ (void)removePollySynthesizeSpeechURLBuilderForKey:(NSString *)key;
/**
Build a time-limited pre-signed URL to synthesize speech from Amazon Polly, return nil if build process failed.
@param preSignedURLRequest The AWSPollySynthesizeSpeechURLBuilderRequest that defines the parameters of the operation.
@return A pre-signed NSURL for the resource. return nil if any errors occured.
@see AWSPollySynthesizeSpeechURLBuilderRequest
*/
- (AWSTask<NSURL *> *)getPreSignedURL:(AWSPollySynthesizeSpeechURLBuilderRequest *)getPreSignedURLRequest;
@end
Swift
class AWSPollySynthesizeSpeechURLBuilder : NSObject
Undocumented
-
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.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];
Declaration
Objective-C
+ (nonnull instancetype)defaultPollySynthesizeSpeechURLBuilder;
Swift
class func `default`() -> Self
Return Value
The default service client.
-
Creates a service client with the given service configuration and registers it for the key.
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.
Declaration
Objective-C
+ (void)registerPollySynthesizeSpeechURLBuilder:(id)configuration forKey:(nonnull NSString *)key;
Swift
class func register(_ configuration: Any!, forKey key: String)
Parameters
configuration
A service configuration object.
key
A string to identify the service client.
-
Creates a service client with the given service configuration and registers it for the key.
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.
Declaration
Objective-C
+ (nonnull instancetype)PollySynthesizeSpeechURLBuilderForKey: (nonnull NSString *)key;
Swift
convenience init(forKey key: String)
Parameters
configuration
A service configuration object.
key
A string to identify the service client.
-
Removes the service client associated with the key and release it.
Warning
Before calling this method, make sure no method is running on this client.
Declaration
Objective-C
+ (void)removePollySynthesizeSpeechURLBuilderForKey:(nonnull NSString *)key;
Swift
class func remove(forKey key: String)
Parameters
key
A string to identify the service client.
-
Build a time-limited pre-signed URL to synthesize speech from Amazon Polly, return nil if build process failed.
See
AWSPollySynthesizeSpeechURLBuilderRequestDeclaration
Objective-C
- (id)getPreSignedURL: (nonnull AWSPollySynthesizeSpeechURLBuilderRequest *)getPreSignedURLRequest;
Swift
func getPreSignedURL(_ getPreSignedURLRequest: AWSPollySynthesizeSpeechURLBuilderRequest) -> Any!
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.