Skip to content
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

adding multiple audio links (refer) in a single prompt tag? #20

Open
D41138761 opened this issue Sep 20, 2021 · 2 comments
Open

adding multiple audio links (refer) in a single prompt tag? #20

D41138761 opened this issue Sep 20, 2021 · 2 comments
Labels

Comments

@D41138761
Copy link

How to add multipe audio links (refer) in a single prompt tag?

@gawi gawi added the question label Sep 20, 2021
@gawi
Copy link
Member

gawi commented Sep 20, 2021

For a Message turn, simply call addAudioItem() multiple times on the builder:

String contextPath = context.getContextPath();
Message message = OutputTurns.message("welcome-message")
                             .addAudioItem(AudioFile.fromLocation(contextPath + "/audio/1.wav"))
                             .addAudioItem(AudioFile.fromLocation(contextPath + "/audio/2.wav"))
                             .build();

For an interaction, you can pass multiple AudioFileobjects to the addPrompt method:

String contextPath = context.getContextPath();
Interaction interaction = OutputTurns.interaction("interaction")
                                             .addPrompt(AudioFile.fromLocation(contextPath + "/audio/3.wav"),
                                                        AudioFile.fromLocation(contextPath + "/audio/4.wav"))
                                             .build();

You can also create multiple prompts:

String contextPath = context.getContextPath();
Interaction interaction = OutputTurns.interaction("interaction")
                                     .addPrompt(AudioFile.fromLocation(contextPath + "/audio/3.wav"))
                                     .addPrompt(AudioFile.fromLocation(contextPath + "/audio/4.wav"))
                                     .build();

@D41138761
Copy link
Author

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants