read text aloud
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import HelderServices
|
||||
|
||||
/// Records what would have been read aloud; `finish()` plays the voice reaching the end.
|
||||
@MainActor
|
||||
final class FakeSpeech: SpeechServicing {
|
||||
var onFinish: (() -> Void)?
|
||||
private(set) var spoken: [String] = []
|
||||
private(set) var stops = 0
|
||||
|
||||
func speak(_ text: String) { spoken.append(text) }
|
||||
func stop() { stops += 1 }
|
||||
func finish() { onFinish?() }
|
||||
}
|
||||
Reference in New Issue
Block a user