View Single Post
thp's Avatar
Posts: 1,391 | Thanked: 4,272 times | Joined on Sep 2007 @ Vienna, Austria
#14
Originally Posted by Art-O View Post
I started this ApkEnv support module development thread so that maybe we get more devs working on this.
Nice work there! Glad that somebody finally created a working module

Originally Posted by Art-O View Post
which both lack sound support and I hope somebody could help with these.
Have a look at the nativeMixData function - all JNI methods take an JNIEnv * as their first method, the second one is the object on which the function is called (for our purposes, this is mostly "any" object - I usually pass a pointer to the global object there, but any random pointer should work). The third parameter is a long that you can use to pass an application-specific pointer. The fourth is a pointer to the buffer which is filled with audio data, and the fifth is the length of that buffer.

SDL has audio output built-in: SDL_OpenAudio() with the right parameters. At some point each game might open an AudioOutput and request a specific format (sample rate, channels, bitrate, buffer size, etc..). The SDL_AudioSpec "callback" then is a simple callback function that will be called by SDL and that should probably call some "native (audio) mixing data" function to fill the buffer.

Would be great if you could submit your modules as pull request to apkenv on Github
 

The Following 13 Users Say Thank You to thp For This Useful Post: