Skip to content

Commit

Permalink
feat(AWSPolly): update models to latest (#5070)
Browse files Browse the repository at this point in the history
  • Loading branch information
awsmobilesdk authored and harsh62 committed Nov 17, 2023
1 parent ab2d08f commit 6307722
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 18 deletions.
19 changes: 11 additions & 8 deletions AWSPolly/AWSPollyModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ typedef NS_ENUM(NSInteger, AWSPollyEngine) {
AWSPollyEngineUnknown,
AWSPollyEngineStandard,
AWSPollyEngineNeural,
AWSPollyEngineLongForm,
};

typedef NS_ENUM(NSInteger, AWSPollyGender) {
Expand Down Expand Up @@ -226,6 +227,8 @@ typedef NS_ENUM(NSInteger, AWSPollyVoiceId) {
AWSPollyVoiceIdLisa,
AWSPollyVoiceIdIsabelle,
AWSPollyVoiceIdZayd,
AWSPollyVoiceIdDanielle,
AWSPollyVoiceIdGregory,
};

@class AWSPollyDeleteLexiconInput;
Expand Down Expand Up @@ -280,7 +283,7 @@ typedef NS_ENUM(NSInteger, AWSPollyVoiceId) {


/**
<p>Specifies the engine (<code>standard</code> or <code>neural</code>) used by Amazon Polly when processing input text for speech synthesis. </p>
<p>Specifies the engine (<code>standard</code>, <code>neural</code> or <code>long-form</code>) used by Amazon Polly when processing input text for speech synthesis. </p>
*/
@property (nonatomic, assign) AWSPollyEngine engine;

Expand Down Expand Up @@ -555,7 +558,7 @@ typedef NS_ENUM(NSInteger, AWSPollyVoiceId) {


/**
<p>Specifies the engine (<code>standard</code> or <code>neural</code>) for Amazon Polly to use when processing input text for speech synthesis. Using a voice that is not supported for the engine selected will result in an error.</p>
<p>Specifies the engine (<code>standard</code>, <code>neural</code> or <code>long-form</code>) for Amazon Polly to use when processing input text for speech synthesis. Using a voice that is not supported for the engine selected will result in an error.</p>
*/
@property (nonatomic, assign) AWSPollyEngine engine;

Expand Down Expand Up @@ -585,7 +588,7 @@ typedef NS_ENUM(NSInteger, AWSPollyVoiceId) {
@property (nonatomic, strong) NSString * _Nullable outputS3KeyPrefix;

/**
<p>The audio frequency specified in Hz.</p><p>The valid values for mp3 and ogg_vorbis are "8000", "16000", "22050", and "24000". The default value for standard voices is "22050". The default value for neural voices is "24000".</p><p>Valid values for pcm are "8000" and "16000" The default value is "16000". </p>
<p>The audio frequency specified in Hz.</p><p>The valid values for mp3 and ogg_vorbis are "8000", "16000", "22050", and "24000". The default value for standard voices is "22050". The default value for neural voices is "24000". The default value for long-form voices is "24000".</p><p>Valid values for pcm are "8000" and "16000" The default value is "16000". </p>
*/
@property (nonatomic, strong) NSString * _Nullable sampleRate;

Expand Down Expand Up @@ -641,7 +644,7 @@ typedef NS_ENUM(NSInteger, AWSPollyVoiceId) {
@property (nonatomic, strong) NSDate * _Nullable creationTime;

/**
<p>Specifies the engine (<code>standard</code> or <code>neural</code>) for Amazon Polly to use when processing input text for speech synthesis. Using a voice that is not supported for the engine selected will result in an error.</p>
<p>Specifies the engine (<code>standard</code>, <code>neural</code> or <code>long-form</code>) for Amazon Polly to use when processing input text for speech synthesis. Using a voice that is not supported for the engine selected will result in an error.</p>
*/
@property (nonatomic, assign) AWSPollyEngine engine;

Expand Down Expand Up @@ -671,7 +674,7 @@ typedef NS_ENUM(NSInteger, AWSPollyVoiceId) {
@property (nonatomic, strong) NSNumber * _Nullable requestCharacters;

/**
<p>The audio frequency specified in Hz.</p><p>The valid values for mp3 and ogg_vorbis are "8000", "16000", "22050", and "24000". The default value for standard voices is "22050". The default value for neural voices is "24000".</p><p>Valid values for pcm are "8000" and "16000" The default value is "16000". </p>
<p>The audio frequency specified in Hz.</p><p>The valid values for mp3 and ogg_vorbis are "8000", "16000", "22050", and "24000". The default value for standard voices is "22050". The default value for neural voices is "24000". The default value for long-form voices is "24000".</p><p>Valid values for pcm are "8000" and "16000" The default value is "16000". </p>
*/
@property (nonatomic, strong) NSString * _Nullable sampleRate;

Expand Down Expand Up @@ -719,7 +722,7 @@ typedef NS_ENUM(NSInteger, AWSPollyVoiceId) {


/**
<p>Specifies the engine (<code>standard</code> or <code>neural</code>) for Amazon Polly to use when processing input text for speech synthesis. For information on Amazon Polly voices and which voices are available in standard-only, NTTS-only, and both standard and NTTS formats, see <a href="https://docs.aws.amazon.com/polly/latest/dg/voicelist.html">Available Voices</a>.</p><p><b>NTTS-only voices</b></p><p>When using NTTS-only voices such as Kevin (en-US), this parameter is required and must be set to <code>neural</code>. If the engine is not specified, or is set to <code>standard</code>, this will result in an error. </p><p>Type: String</p><p>Valid Values: <code>standard</code> | <code>neural</code></p><p>Required: Yes</p><p><b>Standard voices</b></p><p>For standard voices, this is not required; the engine parameter defaults to <code>standard</code>. If the engine is not specified, or is set to <code>standard</code> and an NTTS-only voice is selected, this will result in an error. </p>
<p>Specifies the engine (<code>standard</code>, <code>neural</code> or <code>long-form</code>) for Amazon Polly to use when processing input text for speech synthesis. For information on Amazon Polly voices and which voices are available for each engine, see <a href="https://docs.aws.amazon.com/polly/latest/dg/voicelist.html">Available Voices</a>.</p><p><b>NTTS-only voices</b></p><p>When using NTTS-only voices such as Kevin (en-US), this parameter is required and must be set to <code>neural</code>. If the engine is not specified, or is set to <code>standard</code>, this will result in an error. </p><p><b>long-form-only voices</b></p><p>When using long-form-only voices such as Danielle (en-US), this parameter is required and must be set to <code>long-form</code>. If the engine is not specified, or is set to <code>standard</code> or <code>neural</code>, this will result in an error. </p><p>Type: String</p><p>Valid Values: <code>standard</code> | <code>neural</code> | <code>long-form</code></p><p>Required: Yes</p><p><b>Standard voices</b></p><p>For standard voices, this is not required; the engine parameter defaults to <code>standard</code>. If the engine is not specified, or is set to <code>standard</code> and an NTTS-only voice is selected, this will result in an error. </p>
*/
@property (nonatomic, assign) AWSPollyEngine engine;

Expand All @@ -739,7 +742,7 @@ typedef NS_ENUM(NSInteger, AWSPollyVoiceId) {
@property (nonatomic, assign) AWSPollyOutputFormat outputFormat;

/**
<p>The audio frequency specified in Hz.</p><p>The valid values for mp3 and ogg_vorbis are "8000", "16000", "22050", and "24000". The default value for standard voices is "22050". The default value for neural voices is "24000".</p><p>Valid values for pcm are "8000" and "16000" The default value is "16000". </p>
<p>The audio frequency specified in Hz.</p><p>The valid values for mp3 and ogg_vorbis are "8000", "16000", "22050", and "24000". The default value for standard voices is "22050". The default value for neural voices is "24000". The default value for long-form voices is "24000".</p><p>Valid values for pcm are "8000" and "16000" The default value is "16000". </p>
*/
@property (nonatomic, strong) NSString * _Nullable sampleRate;

Expand Down Expand Up @@ -825,7 +828,7 @@ typedef NS_ENUM(NSInteger, AWSPollyVoiceId) {
@property (nonatomic, strong) NSString * _Nullable name;

/**
<p>Specifies which engines (<code>standard</code> or <code>neural</code>) that are supported by a given voice.</p>
<p>Specifies which engines (<code>standard</code>, <code>neural</code> or <code>long-form</code>) are supported by a given voice.</p>
*/
@property (nonatomic, strong) NSArray<NSString *> * _Nullable supportedEngines;

Expand Down
60 changes: 60 additions & 0 deletions AWSPolly/AWSPollyModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,18 @@ + (NSValueTransformer *)engineJSONTransformer {
if ([value caseInsensitiveCompare:@"neural"] == NSOrderedSame) {
return @(AWSPollyEngineNeural);
}
if ([value caseInsensitiveCompare:@"long-form"] == NSOrderedSame) {
return @(AWSPollyEngineLongForm);
}
return @(AWSPollyEngineUnknown);
} reverseBlock:^NSString *(NSNumber *value) {
switch ([value integerValue]) {
case AWSPollyEngineStandard:
return @"standard";
case AWSPollyEngineNeural:
return @"neural";
case AWSPollyEngineLongForm:
return @"long-form";
default:
return nil;
}
Expand Down Expand Up @@ -792,13 +797,18 @@ + (NSValueTransformer *)engineJSONTransformer {
if ([value caseInsensitiveCompare:@"neural"] == NSOrderedSame) {
return @(AWSPollyEngineNeural);
}
if ([value caseInsensitiveCompare:@"long-form"] == NSOrderedSame) {
return @(AWSPollyEngineLongForm);
}
return @(AWSPollyEngineUnknown);
} reverseBlock:^NSString *(NSNumber *value) {
switch ([value integerValue]) {
case AWSPollyEngineStandard:
return @"standard";
case AWSPollyEngineNeural:
return @"neural";
case AWSPollyEngineLongForm:
return @"long-form";
default:
return nil;
}
Expand Down Expand Up @@ -1344,6 +1354,12 @@ + (NSValueTransformer *)voiceIdJSONTransformer {
if ([value caseInsensitiveCompare:@"Zayd"] == NSOrderedSame) {
return @(AWSPollyVoiceIdZayd);
}
if ([value caseInsensitiveCompare:@"Danielle"] == NSOrderedSame) {
return @(AWSPollyVoiceIdDanielle);
}
if ([value caseInsensitiveCompare:@"Gregory"] == NSOrderedSame) {
return @(AWSPollyVoiceIdGregory);
}
return @(AWSPollyVoiceIdUnknown);
} reverseBlock:^NSString *(NSNumber *value) {
switch ([value integerValue]) {
Expand Down Expand Up @@ -1533,6 +1549,10 @@ + (NSValueTransformer *)voiceIdJSONTransformer {
return @"Isabelle";
case AWSPollyVoiceIdZayd:
return @"Zayd";
case AWSPollyVoiceIdDanielle:
return @"Danielle";
case AWSPollyVoiceIdGregory:
return @"Gregory";
default:
return nil;
}
Expand Down Expand Up @@ -1601,13 +1621,18 @@ + (NSValueTransformer *)engineJSONTransformer {
if ([value caseInsensitiveCompare:@"neural"] == NSOrderedSame) {
return @(AWSPollyEngineNeural);
}
if ([value caseInsensitiveCompare:@"long-form"] == NSOrderedSame) {
return @(AWSPollyEngineLongForm);
}
return @(AWSPollyEngineUnknown);
} reverseBlock:^NSString *(NSNumber *value) {
switch ([value integerValue]) {
case AWSPollyEngineStandard:
return @"standard";
case AWSPollyEngineNeural:
return @"neural";
case AWSPollyEngineLongForm:
return @"long-form";
default:
return nil;
}
Expand Down Expand Up @@ -2184,6 +2209,12 @@ + (NSValueTransformer *)voiceIdJSONTransformer {
if ([value caseInsensitiveCompare:@"Zayd"] == NSOrderedSame) {
return @(AWSPollyVoiceIdZayd);
}
if ([value caseInsensitiveCompare:@"Danielle"] == NSOrderedSame) {
return @(AWSPollyVoiceIdDanielle);
}
if ([value caseInsensitiveCompare:@"Gregory"] == NSOrderedSame) {
return @(AWSPollyVoiceIdGregory);
}
return @(AWSPollyVoiceIdUnknown);
} reverseBlock:^NSString *(NSNumber *value) {
switch ([value integerValue]) {
Expand Down Expand Up @@ -2373,6 +2404,10 @@ + (NSValueTransformer *)voiceIdJSONTransformer {
return @"Isabelle";
case AWSPollyVoiceIdZayd:
return @"Zayd";
case AWSPollyVoiceIdDanielle:
return @"Danielle";
case AWSPollyVoiceIdGregory:
return @"Gregory";
default:
return nil;
}
Expand Down Expand Up @@ -2409,13 +2444,18 @@ + (NSValueTransformer *)engineJSONTransformer {
if ([value caseInsensitiveCompare:@"neural"] == NSOrderedSame) {
return @(AWSPollyEngineNeural);
}
if ([value caseInsensitiveCompare:@"long-form"] == NSOrderedSame) {
return @(AWSPollyEngineLongForm);
}
return @(AWSPollyEngineUnknown);
} reverseBlock:^NSString *(NSNumber *value) {
switch ([value integerValue]) {
case AWSPollyEngineStandard:
return @"standard";
case AWSPollyEngineNeural:
return @"neural";
case AWSPollyEngineLongForm:
return @"long-form";
default:
return nil;
}
Expand Down Expand Up @@ -2961,6 +3001,12 @@ + (NSValueTransformer *)voiceIdJSONTransformer {
if ([value caseInsensitiveCompare:@"Zayd"] == NSOrderedSame) {
return @(AWSPollyVoiceIdZayd);
}
if ([value caseInsensitiveCompare:@"Danielle"] == NSOrderedSame) {
return @(AWSPollyVoiceIdDanielle);
}
if ([value caseInsensitiveCompare:@"Gregory"] == NSOrderedSame) {
return @(AWSPollyVoiceIdGregory);
}
return @(AWSPollyVoiceIdUnknown);
} reverseBlock:^NSString *(NSNumber *value) {
switch ([value integerValue]) {
Expand Down Expand Up @@ -3150,6 +3196,10 @@ + (NSValueTransformer *)voiceIdJSONTransformer {
return @"Isabelle";
case AWSPollyVoiceIdZayd:
return @"Zayd";
case AWSPollyVoiceIdDanielle:
return @"Danielle";
case AWSPollyVoiceIdGregory:
return @"Gregory";
default:
return nil;
}
Expand Down Expand Up @@ -3494,6 +3544,12 @@ + (NSValueTransformer *)identifierJSONTransformer {
if ([value caseInsensitiveCompare:@"Zayd"] == NSOrderedSame) {
return @(AWSPollyVoiceIdZayd);
}
if ([value caseInsensitiveCompare:@"Danielle"] == NSOrderedSame) {
return @(AWSPollyVoiceIdDanielle);
}
if ([value caseInsensitiveCompare:@"Gregory"] == NSOrderedSame) {
return @(AWSPollyVoiceIdGregory);
}
return @(AWSPollyVoiceIdUnknown);
} reverseBlock:^NSString *(NSNumber *value) {
switch ([value integerValue]) {
Expand Down Expand Up @@ -3683,6 +3739,10 @@ + (NSValueTransformer *)identifierJSONTransformer {
return @"Isabelle";
case AWSPollyVoiceIdZayd:
return @"Zayd";
case AWSPollyVoiceIdDanielle:
return @"Danielle";
case AWSPollyVoiceIdGregory:
return @"Gregory";
default:
return nil;
}
Expand Down
Loading

0 comments on commit 6307722

Please sign in to comment.