-
Notifications
You must be signed in to change notification settings - Fork 383
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate EZBingLanguageVoice to Swift (#191)
* perf: migrate EZBingLanguageVoice to Swift * perf: adjust header order
- Loading branch information
1 parent
0748f64
commit 5efe957
Showing
3 changed files
with
32 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// EZBingLanguageVoice.swift | ||
// Easydict | ||
// | ||
// Created by Jerry on 2023-10-25. | ||
// Copyright © 2023 izual. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
// Docs: https://learn.microsoft.com/zh-cn/azure/ai-services/speech-service/language-support?tabs=tts | ||
|
||
@objc class EZBingLanguageVoice: NSObject { | ||
|
||
@objc var lang: String // BCP-47, en-US | ||
@objc var voiceName: String // en-US-JennyNeural | ||
|
||
init(lang: String, voiceName: String) { | ||
self.lang = lang | ||
self.voiceName = voiceName | ||
} | ||
|
||
@objc class func voice(withLanguage language: String, voiceName: String) -> | ||
EZBingLanguageVoice { | ||
return EZBingLanguageVoice(lang: language, voiceName: voiceName) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters