Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6626771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:56:01+00:00 2026-05-25T21:56:01+00:00

For a specific project, I am trying to write a voicexml file to play

  • 0

For a specific project, I am trying to write a voicexml file to play out some audio files. I have no problem about playing an file. But I need some directions for playing multiple files in a folder. I know I have to use ecmascript and tag to do this. But I can’t figure out how to access a folder to play the specific wav files.

Here is my code to play 1 audio file:

<?xml version="1.0" encoding="UTF-8"?> 
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml" xml:base="file://">
<var name="repeat" expr="session.user.repeat"/>
<form id="loopblock">
    <block>
        <if cond="repeat > 0">
        <prompt>
            <audio src="file://provisioned/music.wav"/>
        </prompt> 
        <assign name="repeat" expr="repeat - 1"/>
        <goto next="#loopblock"/>
        </if>
        <disconnect/>
    </block>
</form>
</vxml>

I have a folder which includes different .wav files.

  • /provisioned/music/a.wav
  • /provisioned/music/b.wav
  • /provisioned/music/c.wav

How can I play all of them without calling them one by one because anyone can customize this wav file. All I need to scan the folder and play them out with VoiceXML.

I’d be appreciated for any suggestion.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T21:56:01+00:00Added an answer on May 25, 2026 at 9:56 pm

    At First, VoiceXML can’t scan the folder.
    It needs other programming language.

    For example(JSP – http://localhost:8080/example/get_audio_list.jsp)

    <?xml version="1.0" encoding="UTF-8"?>
    <%
    String audioListCSV = "";
    File[] audioList = new File("/provisioned/music/").listFiles();
    for (int i = 0; i < audioList.length; ++i) {
        File audio = audioList[i];
        if (audio.isFile()) {
            audioListCSV += "\'file:///" + audio.getAbsolutePath() + "\'";
            if (i + 1 < audioList.length) {
                audioListCSV += ",";
            }
        }
    }
    %>    
    <vxml version="2.1">
        <form>
            <block>
                <var name="audioList" />
                <assign name="audioList" expr="[<%=audioListCSV%>]" />
                <return namelist="audioList" />
            </block>
        </form>
    </vxml>
    

    JSP is called subdialog.

    <?xml version="1.0" encoding="UTF-8"?>
    <vxml version="2.1">
        <script>
            var audioList;
        </script>
        <form id="getAudioList">
            <subdialog name="get_audio_list" src="http://localhost:8080/example/get_audio_list.jsp">
                <filled>
                    <assign name="audioList" expr="get_audio_list.audioList">
                    <goto next="#playAudioList" />
                </filled>
            </subdialog>
        </form>
        <form id="playAudioList">
            <block>
                <prompt bargein="true">
                    <foreach item="i" array="audioList">
                        <audio expr="i" />
                    </foreach>
                </prompt>
            </block>
            <block>
                <disconnect />
            </block>
        </form>
    </vxml>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For a small project I have to parse pdf files and take a specific
I'm trying to restructure some specific GUI code in a Java project, let's call
i have created a multi-module maven project and i am trying to write and
Update : I have changed this question to be about the specific problem I
I have a utility build script that gets called from a variety of project-specific
I have VS2005. How can I compile my project under specific version of .NET?
I have a project built and packaged with a specific version of jsp-apiand servlet-api
I am currently working on a project that will store specific financial information about
I am working on a dataManagement project that periodically deletes files in a specific
I'm trying to solve problem 50 on Project Euler . Don't give me the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.