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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:54:09+00:00 2026-06-06T13:54:09+00:00

I have a method called setSound() which is setting up a queue and adding

  • 0

I have a method called setSound() which is setting up a queue and adding a track to it and then playing it. I call the method in simpleInitGame(). However no sound plays and the console in eclipse says:

Mar 13, 2012 10:15:55 PM com.jmex.audio.openal.OpenALSystem setupSourcePool
INFO: max source channels: 32
Mar 13, 2012 10:15:55 PM com.jme.util.resource.ResourceLocatorTool locateResource
WARNING: Unable to locate: src/com/preston/sounds/background.ogg
Mar 13, 2012 10:15:55 PM com.jmex.audio.openal.OpenALSystem createAudioTrack
WARNING: Could not locate audio file: src/com/preston/sounds/background.ogg

Here is the method:

protected void setSound()
    {
        audio = AudioSystem.getSystem();
        sound1 = audio.createAudioTrack("src/com/preston/sounds/background.ogg", false);
        queue = AudioSystem.getSystem().getMusicQueue();
        queue.setCrossfadeinTime(0);
        queue.setRepeatType(RepeatType.ONE);
        queue.addTrack(sound1);
queue.play();

    }

I don’t think it’s the directory as my textures are in the same directory (except instead of preston/sounds its preston/textures).

  • 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-06-06T13:54:10+00:00Added an answer on June 6, 2026 at 1:54 pm

    this is most probably a problem with your relative path. The default directory of the ResourceLocatorTool in jMonkeyEngine is not the root of your project. Try to open it with an absolute path and see if it works.

    Also, the location of your file is not a wise choice. The src folder is intended for java source files, not resources. You should put them in assets/Sounds. See jME best practices

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

Sidebar

Related Questions

I have a controller which has a method called history class UsersController < ApplicationController
I have a method called getTheUserInput in a class which returns a String which
I have a method called xyz which returns an object. private XYZ xyz() {
In ObjectDataSource we have a method called SelectMethod and TypeName in which we can
I have a method called GetObjectsRelatedToAType, e.g. GetCarsRelatedToDealership. Which approach is better from a
I have a method called getTitle which is in a NSString category, and it
I have a method called -showMoreTools: which is: - (IBAction) showMoreTools:(id)sender { UIActionSheet *popupQuery
I have a method called myMethod which maps to the following DWR method: List<MyObject>
Say I have a method called GetCatsByColor which takes a color as a string,
I have a method called funct which i want to have as my callback

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.