- Home /
Passing Audio to an Android service?
Hey guys, I'm making a white noise app for Android and despite being extremely green with my coding, I've actually made a functional, professionally looking app. But I've hit a brick wall. When the app loses focus, the audio goes off.
I've spent days researching the issue and I've made an Android project that can launch an Android media player as a service. I can also export the class as a JAR and import it into Unity. UnityPlayer is also set up in Android Studio.
The wall I need to get over is getting the audio out of Unity and into my Java plug in. Right now it kind of just plays the default ring tone.
The app works by layering 3 sound files. I have 3 slider objects which contains the scripts that plays the sound files and a master volume slider which changes the overall volume on the audio listener. So is there away I can pass what the audio listener hears to my plugin? Or will I need to remove the master volume control and pass on the 3 audio sources from the sliders?
Any help, or pointing me in the direction I need to go would be greatly appreciated.