-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#58 Add a pause between each paragraph #89
#58 Add a pause between each paragraph #89
Conversation
private StoryBookChapterGson storyBookChapter; | ||
|
||
protected String chapterText = ""; | ||
protected String[] chapterText = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps rename to chapterParagraphs
?
@@ -200,7 +199,7 @@ public void onClick(View view) { | |||
}); | |||
} | |||
|
|||
public void playAudio(final String chapterText, final AudioListener audioListener) { | |||
public void playAudio(final String[] chapterText, final AudioListener audioListener) { | |||
List<StoryBookParagraphGson> storyBookParagraphs = storyBookChapter.getStoryBookParagraphs(); | |||
StoryBookParagraphGson storyBookParagraphGson = storyBookParagraphs.get(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like we have hardcoded a selection of only the first paragraph, which is probably the audio is not being played correctly for chapters containing more than 1 paragraph.
I created a separate issue for this here: #90
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll take that issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll take that issue
@gscdev Great, thank you! 🙂
@@ -189,7 +188,7 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat | |||
super.onViewCreated(view, savedInstanceState); | |||
|
|||
// Add button for initializing Text-to-Speech (TTS) | |||
final String finalChapterText = chapterText; | |||
final String[] finalChapterText = chapterText; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
finalChapterText
might be mistaken for meaning "the final text of this chapter", so perhaps we should rename this variable?
@@ -61,7 +61,7 @@ | |||
|
|||
private StoryBookChapterGson storyBookChapter; | |||
|
|||
protected String[] chapterText = {}; | |||
protected String[] chapterParagraph = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And perhaps make the name plural, since it's an array?
protected String[] chapterParagraph = {}; | |
protected String[] chapterParagraphs = {}; |
@@ -54,19 +54,19 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, | |||
int[] titleFontSize = getResources().getIntArray(R.array.cover_title_font_size); | |||
int[] descriptionFontSize = getResources().getIntArray(R.array.chapter_text_font_size); | |||
|
|||
for (int i=0; i<chapterText.length; i++) { | |||
chapterText[i] = setWordSpacing(chapterText[i]); | |||
for (int i=0; i<chapterParagraph.length; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for (int i=0; i<chapterParagraph.length; i++) { | |
for (int i = 0; i < chapterParagraph.length; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ready to be merged 👍
No description provided.