If have login problems remove cookies and clear browser cache.



Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
UndertaleME
02-09-2021, 01:30 AM
Post: #21
Music 3rd Audio Engine on-going update
For the users that always see the chats, you have recently seen me complaining a lot about J2ME audio's architecture lol
Fuck you! Yiff you J2ME Sounds

I've been having issues recently when trying to Play audio simultaneous into Quality Mode, when multithreading them. I've managed to patch it partially but i still got these problems: the Audio Engines breaks completely when multithreading, throwing javax.microedition.media.MediaException, it doesn't has this problem when using only single thread. Compatibility Mode seems to have no problem to handle with multi-threading tho

[Image: 20210207_073217_HDR.jpg]

Another also known issue caught in both modes, audios seems to take a little long to load, randomly varying from 2ms to 3s. I've been classifying it as a limitation since them, but there's a workaround.

Currently, there's 2 modes for the Audio Engine, wich will define how'll it handle to sounds:
  • Quality Mode: SFX and Music. Only 1 playing-SFX supported (mixed with Music). Last version named as "Best Mode" and supporting >1 playing SFX.
  • Compatibility Mode: SFX and Music. Music will be interrupted while SFX are playing.
Additionally, there's an AUTO option that'll, currently, set what mode's suitable for your device according to you RAM Memory. <=1MB will be set to Compatibility Mode. >1MB will be set to Quality Mode.

But that way of getting phone's Audio capabilities is very unprecise. Some models does supports audio mixing with less than 1MB RAM, and some doesn't support with over than 1MB RAM

So, by looking at JSR-135 Javadoc (i did not find it before, it has some useful details that wans't in the one i used directly from Oracle), there's some implementations we can do for a more precise compatibility check...

By this graph, there's some keys we can use on MMAPI to know what can the device handle, and what it doesn't. Using the function System.getProperty(String key)

[Image: laufrhf.png]

By using the key supports.mixing, we can know if the phone handles playing multiple audios at once, and then we will not needed to pause the music to play another SFX. If it returns TRUE, it'll be automatically set to Quality Mode

There's also another key that interest us here... It's the streamable.contents key. It defines if the phone supports streamming audio and it doesn't need to load it entirely before playing it.
Currently, UndertaleME's Audio Engine only loads the audio entirely before playing it. And it takes time for it to encode files, store on the RAM and realize it. Streamming contents are useful because, if the phone supports it, it'll save some RAM space and allow us to bypass audio loading, so the audios will play much more quicker. But if the phone doesn't supports it, the Audio Engine will still load it completely before playing it.


On the next version, i also want to add 2 more modes to increase its compatibility and capabilities:

  • Ultra Mode: SFX and Music. No limitations for SFX. For high-end devices that supports higher amounts of playing-sounds and emulators.
  • Quality Mode: SFX and Music. Only 1 playing-SFX supported (mixed with Music). For mid-end devices that supports audio mixing.
  • Compatibility Mode: SFX and Music. Music will be interrupted while SFX are playing. For low-end devices that doesn't supports audio mixing.
  • Ripped Mode: Only Music. SFX are ignored. For low-end devices with very limited app-size. Sounds will be removed to save space and this mode won't throw an error if another audio is not found.

Conclusion
Concluding, these are what's planned to the next update:
  • Two new audio modes - Ultra Mode and Ripped Mode
  • Fix a glitch that Audio Engine breaks entirely when playing multiple SFX on multi-thread in Quality Mode (javax.microedition.media.MediaException)
  • Fix a bug where Music will still be playing after another SFX when it's called to Stop() while another SFX is playing
  • More precise audio compatibility check
  • Audio streamming for supported devices

I'm in mind to releasing a benchmark with this Audio Engine to make another research and stability check

[size=xx-small]Signature[/size]
[URL=https://www.exophase.com/user/JoseskVolpe/][IMG]https://card.exophase.com/2/0/45687.png?1612237163[/IMG][/URL]

[align=justify][size=x-small][b]OwO ¿¿¿What is this??? *wags tail*
Take my beret plz 7w7 ~[/b][/size][/align]
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
UndertaleME - JoseskVolpe - 07-10-2020, 10:51 PM
RE: UndertaleME - John Marcus - 07-11-2020, 11:43 AM
RE: UndertaleME - Oba amos - 07-13-2020, 04:51 PM
RE: UndertaleME - Oba amos - 07-13-2020, 06:59 PM
RE: UndertaleME - JoseskVolpe - 07-13-2020, 09:23 PM
RE: UndertaleME - Oba amos - 07-13-2020, 09:41 PM
RE: UndertaleME - Oba amos - 07-14-2020, 03:58 PM
RE: UndertaleME - Oba amos - 07-15-2020, 06:05 PM
Quick preview OwO - JoseskVolpe - 07-16-2020, 01:48 AM
RE: UndertaleME - Oba amos - 07-19-2020, 06:47 PM
RE: UndertaleME - Oba amos - 07-20-2020, 08:17 PM
RE: UndertaleME - rahuldv - 07-21-2020, 08:01 AM
RE: UndertaleME - java gamer - 11-08-2020, 06:53 AM
Forwarding the project - JoseskVolpe - 01-27-2021, 12:24 PM
RE: UndertaleME - Dip_Dey - 01-27-2021, 08:03 PM
RE: UndertaleME - John Marcus - 02-01-2021, 12:18 PM
RE: UndertaleME - JoseskVolpe - 02-02-2021, 02:40 AM
3rd Audio Engine on-going update - JoseskVolpe - 02-09-2021 01:30 AM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)