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 3694948
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:33:30+00:00 2026-05-19T04:33:30+00:00

A month ago I started working with phonegap, html5, css3 and jQtouch. I am

  • 0

A month ago I started working with phonegap, html5, css3 and jQtouch.
I am working on an application and I need to play sound in the application. I have a serious problem with this task.
First I’ve found out that I can play .mp3 files through phonegap using the new Media(…) function. I am not sure about .wav files, can I play those?
Second I’ve found that files must be less than 30 sec, is this so?
Third I can’t find the right place for my sound files. My project structure is the following:

project
-- src
-- gen
-- assets
-- -- www
-- -- DANCE.mp3
-- -- jqtouch
-- -- -- (some folders and files)
-- -- phonegap.js
-- libs
-- res

I’ve tried placing the file in ‘www’ folder and creating a new one called ‘audio’. None of this gave me what I wanted.
I am using this code for executing the song:

function playStream() {
    mp3file = new Media("DANCE.mp3",
            function() {
                alert("playAudio():Audio Success");
            },
                function(err) {
                    alert(err);
            }
            );
          mp3file.play();
}

I use Android 2.1 Simulator and I’ve tried 2.2 as well without success.
I hope I was clear enough.
I am looking forward to hearing from you.
Yours,
Mihail Velikov

  • 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-19T04:33:30+00:00Added an answer on May 19, 2026 at 4:33 am

    PhoneGap for Android lets you store local audio files in two places:
    android_asset: file name must start with /android_asset/sound.mp3
    sdcard: file name is just sound.mp3

    If you place your DANCE.mp3 file in your project’s assets directory, then you can play it using the path:

    mp3file = new Media("/android_asset/DANCE.mp3",
            function() {
                alert("playAudio():Audio Success");
            },
                function(err) {
                    alert(err);
            }
            );
          mp3file.play();
    

    (You can read the source for AudioPlayer.java in the Android PhoneGap sources to see how this works.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just started working on a small team of .NET programmers about a month
so i started android programming like a month ago, and i've got a probleme
A couple of weeks ago i have started my research in Iphone app development
My application written month ago in Delphi 7. Now I want to convert a
I joined a new company about a month ago. The company is rather small
I installed Visual Studio 2008 Standard Edition a month or so ago after a
Few months ago, I have came across a Silverlight tutorial of Eric Cartman (South
I wrote a small PHP application several months ago that uses the WordPress XMLRPC
I've started working on an existing project at my company that was check into
Woo, I have a doozy of a problem (might even be one for 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.