Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
OpenAL — Gideros Forum

OpenAL

jarosmartinjarosmartin Member
edited April 2012 in General questions
Hi there ! I'm new to Gideros. I've been searching the forums and reading the API and only found few options for working with sound: playback, volume and position (playback) . I would like to know how much of OpenAL's API is exposed. It seems to me that using a 3D audio engine it would only make sense if more features, such as emitters and listeners, are accessible.

Likes: gorkem, Zoyt, atilim

Tagged:
+1 -1 (+3 / -0 )Share on Facebook

Comments

  • Hi and welcome, jarosmartin :).

    I don't know OpenAL, but with Gideros Studio, using the Lua C API, you have access to all of iOS functionality.

    71squared did a Sound Manager class for iOS (disclaimer - I've only looked at this for a few minutes, but 71squared are great people):
    http://www.71squared.com/2010/01/latest-sound-manager-class/

    Theoretically (I haven't tried this), you could create a plugin that instantiates that sound manager class, and from Lua call C/C++ functions in the plugin that call methods in that class.

    How much iOS experience do you have?

    If you have a look at the forum plugins category here:
    http://www.giderosmobile.com/forum/categories/plugins
    and also the plugins section in the Ultimate Guide (link at the top of this page) it might help.
  • Thank you ! 71squared's Sound Manager looks great. I looked into soundmanager.h and their class features what I was looking for: positioning a sound source in a 3d space. I guess I will have to write a plugin.
  • Actually, after looking to it in more depth, there is a method on 71squared's Sound Manager for positioning the listener and the source when playing a sound file. But there is not method for changing the position of the source as the sound plays. OpenAL is something that I don't want to deal with (now) It'd be very good to have at least panning in Gideros. By controlling panning, gain, and using a distance model it is be possible to create the illusion of a sound moving.
  • atilimatilim Maintainer
    Hi,

    I think your primary need is 3d audio but as a side note panning is also not supported by OpenAL. OpenAL documentation states that:

    OpenAL is foremost a means to generate audio in a simulated three-dimensional space. Consequently, legacy audio concepts such as panning and left/right channels are not directly supported.
  • Very bad news indeed. Are there any other possibilities ? This can be a great feature and can make a difference. I hate to mention this, but the Cor...SDK offers this:
    http://blog.anscamobile.com/2011/07/the-secretundocumented-audio-apis-in-corona-sdk/
    Why Gideros can't ? It'll be a great addition !
  • CarolineCaroline Guru
    edited April 2012
    Reading further on other links on that site you linked to, it appears that for panning to work, you need to have a mono audio source, not stereo. They are using ALmixer, which is an Open AL wrapper.
    http://playcontrol.net/opensource/ALmixer/

    You could use that too for your plugin and get the same results. (I don't know how hard it would be, because I know nothing about audio.)

    Explanation of why it's mono, not stereo:
    http://developer.anscamobile.com/code/super-audio
  • atilimatilim Maintainer
    @Caroline I haven't known ALmixer, thank you. (It would be funny if there is a ALmixer plugin for Gideros :P)
  • atilimatilim Maintainer
    @jarosmartin I wonder, where do you need 3d audio? I mean because Gideros is mostly targets 2d games.
  • I'm a composer/researcher on sound spatialization currently writing an article about audio spatialization and mobile technologies. I also teach a course on digital audio and programming (for non-programmers) and Lua is a great language for that. My students get to know the basics of programming and in addition they create a nice mobile app with good sound. I designed the course using the Co..SDK (and I published some apps with it) but I don't really like the direction their company is heading. I switched to Gideros, not only because of the plugins and the IDE, but it seems to me that you guys have a different vision, etc. Having said that, look how the most horrible 2d movie can be enhanced by good sound and music. Just with a little of sound spatialization, I believe it is possible to add another dimension to a 2d game. I'm also looking for developing games for the blind with sound cues. I really want to see these features on Gideros, it will really make a difference out there. Thanks for listening !
  • Hello!
    At the moment i'm using C****a for developing my game, but i'v planned on porting it over to a different SDK for some time now. Gideros definitely suits me better since it seems like you focus more on the core functionality and have a way better focus on graphics features, rather than just updating useless libraries, as C****a has been doing since i first bought it around 8 month ago.
    So, the only thing that makes me doubt about porting the game, is that the soundlibrary seems a little too simple.
    Is there any plans on implementing OpenAL in Gideros?

    / Joel

    Likes: SinisterSoft

    +1 -1 (+1 / -0 )Share on Facebook
  • ianchiaianchia Member
    edited June 2012
    I would actually like to *disable* the built in audio engine in order to add a custom one. One of the founders of Beatnik, (a company I used to work for) open sourced (MIT) the Beatnik Audio Engine a while back. It would be great to be have the ability to rewrite it as a custom Gideros plugin, without the Gideros engine starting up OpenAL.

    Check it out: The Mini Beatnik Audio Engine https://github.com/heyigor/miniBAE

    It compiles fine under iOS, although there needs to be some additional work done on the MP3 decoder for wavetable samples, since it's not bundled within the engine (licensing issues.) So occasionally, some of the song samples will crash the demo iPad app because it's using a codec which is missing in the source.

    BAE is very CPU lean and powerful, in terms of programmability. Plays MIDI, RMF, samples and has tempo, panning control and the whole gamut of MIDI controllers. It was the core audio engine used by Java back in the day and used in a number of Shockwave, Flash and Director games + bazillion Nokia phones etc. A number of Beatnik engineers now work at Apple on Core Audio... Makes me all nostalgic running the miniBAE on my iPad (;

    Some choice words from the github repo:
    You can pause and resume any media playback at will, change pitch while a sound is playing, etc.The feature rich miniBAE API is full of opportunities for innovative integration of sound design into interactive virtual worlds, for example, miniBAE includes a MIDI synthesizer that your application, or user, can play in real-time ....

    ...The miniBAE music synthesizer is a high quality wavetable instrument with LFOs, ADSRs, and filters. It can be delivered with a complete General MIDI patch bank, or for small footprints a ‘light’ General MIDI approximation can be used. Custom instrument banks can be built with the Beatnik Editor application.
    - Ian

    Likes: phongtt

    +1 -1 (+1 / -0 )Share on Facebook
  • atilimatilim Maintainer
    edited June 2012
    @jarosmartin, @blancoberg it's really hard to wrap OpenAL but I'm planning to add pitch and panning.

    @ianchia That looks great. I'm already planning to defer OpenAL initialization http://bugs.giderosmobile.com/issues/112 and after that it's possible to create a plugin for Beatnik. Do you have any estimation about performance comparison of OpenAL Soft (which we're using on Android) and BAE?
Sign In or Register to comment.