Hekkus Sound System for ZGE

Use of external libraries (DLLs) from ZGE.

Moderator: Moderators

User avatar
Rado1
Posts: 770
Joined: Wed May 05, 2010 12:16 pm

Hekkus Sound System for ZGE

Postby Rado1 » Fri Jul 04, 2014 4:35 pm

For those of you who would like to play mp3, ogg, but also several mod formats (it, xm, s3m, mod) on Windows and Android in ZGE I prepared a new external library ZgeHekkus which is an adapter to the free (donateware) multi-platform Hekkus Sound System library.

The ZGE demo project and Windows dll can be downloaded from here.

I'm working on Android version now. Later, I'll update also the demo project to show more possibilities, put the sources and manuals to Goodle Code, etc, etc.

Have a fun! Any comments are welcome.

Note: As Kjell tells you, this library is not actually needed for playing mp3 files on Windows. That's true. However, to create ZGE applications which use files of the aforementioned music formats for free on Windows and Android, Hekkus is a very good option.

User avatar
Rado1
Posts: 770
Joined: Wed May 05, 2010 12:16 pm

Postby Rado1 » Sat Jul 05, 2014 11:21 pm

ZgeHekkus sound library has been compiled for Android and also a new demo showing dynamic setting of sound's pan and pitch has been added. The both demos now run on Windows and Android.

The previously published API was slightly changed and the current version is officially v0.9.

You can download all this from the download page.
Attachments
scr1.jpg
screenshots from demos
scr1.jpg (46.89 KiB) Viewed 3421 times

User avatar
VilleK
Site Admin
Posts: 1896
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Postby VilleK » Sun Jul 06, 2014 6:42 pm

Cool stuff as usual Rado1 :)

User avatar
Rado1
Posts: 770
Joined: Wed May 05, 2010 12:16 pm

Postby Rado1 » Tue Jul 08, 2014 6:29 pm

Thanks Ville. I'm still trying to to come up with an optimal solution for good and free music support in ZGE for Windows and Android platforms. Hekkus is an interesting feature-rich library with relatively simple and easy-to-use interface. So I had to try it... and it works perfectly.

Do you think it can be included in the official ZGE distribution's library?

(However, I haven't stopped looking for perfection in external music player... it will become reality in my next ZGE extension. :-) )

Imerion
Posts: 196
Joined: Sun Feb 09, 2014 4:42 pm

Postby Imerion » Tue Jul 08, 2014 10:37 pm

Looks great! I really need a free library that can play .ogg files. But is this also free for commercial projects?

Also, you're making me very curious about that next extension. :)

User avatar
Rado1
Posts: 770
Joined: Wed May 05, 2010 12:16 pm

Postby Rado1 » Tue Jul 08, 2014 11:00 pm

Imerion wrote:Looks great! I really need a free library that can play .ogg files. But is this also free for commercial projects?

Yes, it's free also for commercial projects. However, if you make enough money by a project with this library, you can donate the author; see the Hekkus web page (licence) for details.

User avatar
Kjell
Posts: 1613
Joined: Sat Feb 23, 2008 11:15 pm

Postby Kjell » Tue Jul 08, 2014 11:28 pm

Hi guys,

Keep in mind that in order to play a OGG / MP3 on Android, you basically only need to do this in Java ( or C++ ) ..

Code: Select all

MediaPlayer foo = MediaPlayer.create(context, resource);
foo.start();

Just need to wrap that into a extension ( or component ).

K

User avatar
Rado1
Posts: 770
Joined: Wed May 05, 2010 12:16 pm

Postby Rado1 » Wed Jul 09, 2014 6:56 am

Kjell wrote:Keep in mind that in order to play a OGG / MP3 on Android, you basically only need to do this in Java ( or C++ ) ..

The problem is that the MediaPlayer class is available only in Java, there's no equivalent in NDK. It can be accessible from NDK via JNI, but you need to create an ZGE adapter library anyway (C++ to Java JNI interfacing is really a mess in the case of many non-static methods). Another option would be to create ZGE built-in functions to call OS API for playing mp3(+ogg) files, but I'm not sure Ville would like to do it.

Instead, I'm working on a small OpenSL ES library for ZGE which also would bring more possibilities than MediaPlayer, if needed (positional 3D audio, effects, better playback control, ...).


Return to “Extensions”

Who is online

Users browsing this forum: No registered users and 1 guest