Skip to content
This repository was archived by the owner on Dec 26, 2018. It is now read-only.

[3.0] Example: Integrate with GvrAudioEngine

Yuya Matsuo edited this page Mar 30, 2017 · 5 revisions

Meganekko has AudioEngine and Sound (and its descendants SoundObject, SoundField and StereoSound) which are a simple wrapper for GvrAudioEngine. You can get AudioEngine with getAudioEngine().

public class App extends MeganekkoApp {
    private Sound sound;

    @Override
    public void init() {
        super.init();

        AudioEngine audioEngine = getAudioEngine();
        sound = audioEngine.createSoundObject("se.ogg");
        sound.setPosition(0, 0, -2);
        sound.play(true);
    }
}

AudioEngine requires Google VR SDK. You have to include dependency com.google.vr:sdk-audio:X.X.X in build.gradle.

android {
    ...

    defaultConfig {
        ...

        ndk {
            abiFilters "armeabi-v7a"
        }
    }
}

dependencies {
    ...

    compile 'com.google.vr:sdk-audio:1.40.0'
}

See https://developers.google.com/vr/android/get-started to add Google VR library in your project.

Clone this wiki locally