Skip to content

Commit

Permalink
fixing AVSpeechSynthesisVoiceGender with available >= 13
Browse files Browse the repository at this point in the history
  • Loading branch information
dlutton committed Nov 26, 2023
1 parent 37c3573 commit 826eeee
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# ChangeLog

## 3.8.5

### Fixes

- **iOS:** Fix AVSpeechSynthesisVoiceGender with available on iOS 13 or greater

## 3.8.4

- **Android:** Fix 'Reply already submitted' bug
- **ioS:** Return additional voice information fields (quality, gender, and identifier)
- **ioS:** Fix synthesizeToFile on iOS 17+
- **iOS:** Return additional voice information fields (quality, gender, and identifier)
- **iOS:** Fix synthesizeToFile on iOS 17+

## 3.8.3

Expand Down
7 changes: 5 additions & 2 deletions ios/Classes/SwiftFlutterTtsPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,9 @@ public class SwiftFlutterTtsPlugin: NSObject, FlutterPlugin, AVSpeechSynthesizer
voiceDict["name"] = voice.name
voiceDict["locale"] = voice.language
voiceDict["quality"] = voice.quality.stringValue
voiceDict["gender"] = voice.gender.stringValue
if #available(iOS 13.0, *) {
voiceDict["gender"] = voice.gender.stringValue
}
voiceDict["identifier"] = voice.identifier
voices.add(voiceDict)
}
Expand Down Expand Up @@ -431,6 +433,7 @@ extension AVSpeechSynthesisVoiceQuality {
}
}

@available(iOS 13.0, *)
extension AVSpeechSynthesisVoiceGender {
var stringValue: String {
switch self {
Expand All @@ -442,4 +445,4 @@ extension AVSpeechSynthesisVoiceGender {
return "unspecified"
}
}
}
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_tts
description: A flutter plugin for Text to Speech. This plugin is supported on iOS, macOS, Android, Web, & Windows.
version: 3.8.4
version: 3.8.5
homepage: https://github.com/dlutton/flutter_tts

dependencies:
Expand Down

0 comments on commit 826eeee

Please sign in to comment.