Example usage for javax.media.j3d PhysicalEnvironment setAudioDevice

List of usage examples for javax.media.j3d PhysicalEnvironment setAudioDevice

Introduction

In this page you can find the example usage for javax.media.j3d PhysicalEnvironment setAudioDevice.

Prototype

public void setAudioDevice(AudioDevice device) 

Source Link

Document

Sets the specified AudioDevice object as the device through which audio rendering for this PhysicalEnvironment will be performed.

Usage

From source file:MixedTest.java

protected View createView(ViewPlatform vp) {
    View view = new View();

    PhysicalBody pb = createPhysicalBody();
    PhysicalEnvironment pe = createPhysicalEnvironment();

    AudioDevice audioDevice = createAudioDevice(pe);

    if (audioDevice != null) {
        pe.setAudioDevice(audioDevice);
        audioDevice.initialize();//w w  w .  jav a  2 s.c om
    }

    view.setPhysicalEnvironment(pe);
    view.setPhysicalBody(pb);

    if (vp != null)
        view.attachViewPlatform(vp);

    view.setBackClipDistance(getBackClipDistance());
    view.setFrontClipDistance(getFrontClipDistance());

    Canvas3D c3d = createCanvas3D();
    view.addCanvas3D(c3d);
    addCanvas3D(c3d);

    return view;
}