Skip to content

Commit c0c295a

Browse files
committed
iOS: fixed #22; Android: add API - Synthesizer.resume
1 parent fc34ddd commit c0c295a

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

android/src/main/java/com/zphhhhh/speech/SpeechSynthesizerModule.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,13 @@ public void pause() {
160160
}
161161
}
162162

163+
@ReactMethod
164+
public void resume() {
165+
if (mTts.isSpeaking()) {
166+
mTts.resumeSpeaking();
167+
}
168+
}
169+
163170
@ReactMethod
164171
public void setParameter(String parameter, String value) {
165172
if (parameter.equals(SpeechConstant.TTS_AUDIO_PATH)) {

ios/RNSpeechIFlytek/SpeechSynthesizerModule.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ - (void) stopObserving {
8787
}
8888

8989
RCT_EXPORT_METHOD(resume) {
90-
if (![self.iFlySpeechSynthesizer isSpeaking]) {
90+
if ([self.iFlySpeechSynthesizer isSpeaking]) {
9191
[self.iFlySpeechSynthesizer resumeSpeaking];
9292
}
9393
}

0 commit comments

Comments
 (0)