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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:28:44+00:00 2026-05-22T17:28:44+00:00

when I try to play a sound with Phonegap i get the following error:

  • 0

when I try to play a sound with Phonegap i get the following error:

05-29 16:26:14.225  1749  2777 I System.out: AudioPlayer Error: stopPlaying() called during invalid state: 0
05-29 16:26:14.257  1749  2778 W System.err: java.io.FileNotFoundException: www/sounds/863.ogg
05-29 16:26:14.257  1749  2778 W System.err:    at android.content.res.AssetManager.openAssetFd(Native Method)
05-29 16:26:14.257  1749  2778 W System.err:    at android.content.res.AssetManager.openFd(AssetManager.java:331)
05-29 16:26:14.257  1749  2778 W System.err:    at com.phonegap.AudioPlayer.startPlaying(AudioPlayer.java:201)
05-29 16:26:14.257  1749  2778 W System.err:    at com.phonegap.AudioHandler.startPlayingAudio(AudioHandler.java:181)
05-29 16:26:14.257  1749  2778 W System.err:    at com.phonegap.AudioHandler.execute(AudioHandler.java:64)
05-29 16:26:14.257  1749  2778 W System.err:    at com.phonegap.api.PluginManager$1.run(PluginManager.java:86)
05-29 16:26:14.257  1749  2778 W System.err:    at java.lang.Thread.run(Thread.java:1096)

here is my play function:

lastMedia = null
function play(id){
    alert('playing ' + id)
    if (lastMedia){
        lastMedia.stop()
        lastMedia.release()
    }
    lastMedia = new Media('/android_asset/www/sounds/'+id+'.ogg', function(){}/*, function(err){alert('error: ' + err)}*/)
    lastMedia.play()
}

any ideas?

  • 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-22T17:28:45+00:00Added an answer on May 22, 2026 at 5:28 pm

    One thing you probably want to do is make sure you’re trying to stop something that is actually currently playing. Something like this:

    if (lastMedia != null && lastMedia.isPlaying()){
        lastMedia.stop()
        lastMedia.release()
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I try to play the sound file Windows Critical Stop.wav I get the
I'm using the following code to try to play a sound clip with the
i try to off a sound effect on my app play method is '
I want to try out Joda Time with Play Framework 2.0. So I have
i am using the following code to play a sound when user touches anywhere
I have a problem. When I try to play sound using Soundpool there is
when I try to make a addEventListener I get an error: Line 20 1046:
I am using the following code to play a sound and after a while
I am using the following code to play a sound file using the java
I hope the title is not too misleading... :) I play a system sound

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.