Skip to content

Commit

Permalink
Added pitch support
Browse files Browse the repository at this point in the history
  • Loading branch information
IhorShevchuk committed Feb 17, 2024
1 parent fee2f33 commit 3bf3cec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions Sources/RHVoice/PublicHeaders/RHVoice/RHSpeechUtterance.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, strong) RHSpeechSynthesisVoice *voice;
@property (nonatomic, assign) double rate;
@property (nonatomic, assign) double volume;
@property (nonatomic, assign) double pitch;
@property (nonatomic, assign) RHSpeechUtteranceQuality quality;

- (instancetype)initWithText:(NSString * _Nullable)text;
Expand Down
2 changes: 2 additions & 0 deletions Sources/RHVoice/RHSpeechUtterance.mm
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ - (instancetype)initWithSSML:(NSString * _Nullable)ssml {
_ssml = ssml;
self.rate = 1.0;
self.volume = 1.0;
self.pitch = 1.0;
self.quality = RHSpeechUtteranceQualityStandart;
self.voice = [[RHSpeechSynthesisVoice speechVoices] firstObject];
}
Expand Down Expand Up @@ -79,6 +80,7 @@ - (BOOL)isEmpty {
voiceProfile);
doc->speech_settings.relative.rate = self.rate;
doc->speech_settings.relative.volume = self.volume;
doc->speech_settings.relative.pitch = self.pitch;
doc->quality.set_from_string(self.rhVoiceQuality);

return doc;
Expand Down

0 comments on commit 3bf3cec

Please sign in to comment.