Customise Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorised as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.

No cookies to display.

[ad_1]

I wish to add a number of music codecs to the LibGdx library, like .vgm, .mod, .s3m, .xm and so forth. I have already got the Java code to take action, but it surely’s exhausting to combine it with LibGdx code.

I do know there’s a backend class named OpenALLwjgl3Audio that has the next code:

    registerSound("ogg", Ogg.Sound.class);
    registerMusic("ogg", Ogg.Music.class);
    registerSound("wav", Wav.Sound.class);
    registerMusic("wav", Wav.Music.class);
    registerSound("mp3", Mp3.Sound.class);
    registerMusic("mp3", Mp3.Music.class);

So it will be good to name this registerMusic(“vgm”, Vgm.Music.class) from exterior this class.

  1. Sadly, as it’s a backend class, I am unable to entry it from ‘core’ mission:

     ((OpenALLwjgl3Audio) Gdx.audio).registerMusic("vgm", Vgm.Music.class);
     => Error: OpenALLwjgl3Audio cannot be resolved to a kind
    
  2. I attempted to entry the audio variable within the ‘desktop’ mission (DesktopLauncher.java), however it’s null till the applying is instantiated, after which it enter in a loop:

     ((OpenALLwjgl3Audio) Gdx.audio).registerMusic("vgm", Vgm.Music.class);
     => Nullpointer Exception, as audio is null till the code beneath executes:
     ...
     new Lwjgl3Application(new Sport(), config);
    
  3. Creating the category Vgm.Music.class within the LibGdx library itself, together with Mp3.class, Ogg.class and so forth and edit the OpenALLwjgl3Audio instantly. BUT: I would want to make use of a specific fork of the LibGdx code, because it in all probability would not enter in the primary develop department, making it more durable to maintain my mission up to date.

Any tips to realize this purpose?

[ad_2]

Leave a Reply

Your email address will not be published. Required fields are marked *