Skip to content

Commit 7eca22f

Browse files
committed
Fix #93, Speech Speed Bug in SeekBar Simulator
1 parent 80f5238 commit 7eca22f

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

source-code/app/src/main/java/org/buildmlearn/toolkit/learnspelling/SpellingActivity.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ public class SpellingActivity extends Fragment implements
6767
private SeekBar mSb_SpeechRate;
6868
private View view;
6969

70+
private static final float MIN_SPEECH_RATE = 0.01f;
71+
7072
@Nullable
7173
@Override
7274
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
@@ -205,8 +207,11 @@ public void submit() {
205207

206208
private float getProgressValue(int percent) {
207209
float temp = ((float) percent / 100);
208-
float per = temp * 2;
209-
return per;
210+
float speechRate = temp * 2;
211+
212+
if (speechRate < MIN_SPEECH_RATE)
213+
speechRate = MIN_SPEECH_RATE;
214+
return speechRate;
210215
}
211216

212217

0 commit comments

Comments
 (0)