Top Inners Fields Constructors Methods
com.sun.media.jfxmediaimpl

pack-priv final Class NativeAudioClip

extends AudioClip
Class Inheritance
Imports
java.io.IOException, java.net.URI, .URISyntaxException, com.sun.media.jfxmedia.AudioClip, .MediaException, com.sun.media.jfxmedia.locator.Locator

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private static NativeAudioClip.NativeAudioClipDisposer
private final Locator
private long
Inherited from com.sun.media.jfxmedia.AudioClip:
clipBalanceclipPanclipPriorityclipRateclipVolumeloopCountSAMPLE_FORMAT_S16BESAMPLE_FORMAT_S16LESAMPLE_FORMAT_S24BESAMPLE_FORMAT_S24LESAMPLE_FORMAT_S8SAMPLE_FORMAT_U16BESAMPLE_FORMAT_U16LESAMPLE_FORMAT_U24BESAMPLE_FORMAT_U24LESAMPLE_FORMAT_U8

Constructor Summary

AccessConstructor and Description
private
private
NativeAudioClip(byte[] data, int dataOffset, int sampleCount, int sampleFormat, int channels, int sampleRate)

Method Summary

Modifier and TypeMethod and Description
public AudioClip
append(AudioClip clip)

Implements abstract com.sun.media.jfxmedia.AudioClip.append.

Create a new AudioClip by appending the given clip to the current clip.

public static AudioClip
create(byte[] data, int dataOffset, int sampleCount, int sampleFormat, int channels, int sampleRate)

Hides com.sun.media.jfxmedia.AudioClip.create.

Generate a AudioClip from raw LPCM audio data.

public AudioClip
createSegment(double startTime, double stopTime)

Implements abstract com.sun.media.jfxmedia.AudioClip.createSegment.

Create a new AudioClip from a segment of an existing AudioClip.

public AudioClip
createSegment(int startSample, int endSample)

Implements abstract com.sun.media.jfxmedia.AudioClip.createSegment.

Create a new AudioClip from a segment of an existing AudioClip.

public AudioClip
flatten()

Implements abstract com.sun.media.jfxmedia.AudioClip.flatten.

Creates a completely independent AudioClip.

pack-priv long
public static synchronized boolean
init()

public boolean
isPlaying()

Implements abstract com.sun.media.jfxmedia.AudioClip.isPlaying.

Test if any AudioClipPlayer has this AudioClip in its effect chain.

public static AudioClip
load(URI source)

Hides com.sun.media.jfxmedia.AudioClip.load.

Load an audio clip from the specified source URI.

private native NativeAudioClip
nacAppend(long handle, long otherClip)

private static native long
nacCreate(byte[] data, int dataOffset, int sampleCount, int sampleFormat, int channels, int sampleRate)

private native NativeAudioClip
nacCreateSegment(long handle, double startTime, double stopTime)

private native NativeAudioClip
nacCreateSegment(long handle, int startSample, int endSample)

private static native boolean
private native boolean
nacIsPlaying(long handle)

private static native long
nacLoad(Locator source)

private native void
nacPlay(long handle, double volume, double balance, double pan, double rate, int loopCount, int priority)

private native NativeAudioClip
nacResample(long handle, int startSample, int endSample, int sampleRate)

private native void
nacStop(long handle)

private static native void
private static native void
nacUnload(long handle)

public void
play()

Implements abstract com.sun.media.jfxmedia.AudioClip.play.

Play this AudioClip with the default parameters.

public void
play(double volume)

Implements abstract com.sun.media.jfxmedia.AudioClip.play.

Play this AudioClip at the given volume level.

public void
play(double volume, double balance, double rate, double pan, int loopCount, int priority)

Implements abstract com.sun.media.jfxmedia.AudioClip.play.

Play this AudioClip at the given volume level and relative pitch.

public AudioClip
resample(int startSample, int endSample, int newSampleRate)

Implements abstract com.sun.media.jfxmedia.AudioClip.resample.

Create a new AudioClip from an existing clip by resampling a segment of the source clip to the specified sample playbackRate.

public void
stop()

Implements abstract com.sun.media.jfxmedia.AudioClip.stop.

Stops all playback of this AudioClip.

public static void
stopAllClips()

Hides com.sun.media.jfxmedia.AudioClip.stopAllClips.

Stop all AudioClips that are currently playing.

Inherited from com.sun.media.jfxmedia.AudioClip:
balanceloopCountpanplaybackRateprioritysetBalancesetLoopCountsetPansetPlaybackRatesetPrioritysetVolumevolume

Field Detail

clipDisposerback to summary
private static NativeAudioClip.NativeAudioClipDisposer clipDisposer
mediaSourceback to summary
private final Locator mediaSource
nativeHandleback to summary
private long nativeHandle

Constructor Detail

NativeAudioClipback to summary
private NativeAudioClip(Locator source)
NativeAudioClipback to summary
private NativeAudioClip(byte[] data, int dataOffset, int sampleCount, int sampleFormat, int channels, int sampleRate)

Method Detail

appendback to summary
public AudioClip append(AudioClip clip)

Implements abstract com.sun.media.jfxmedia.AudioClip.append.

Doc from com.sun.media.jfxmedia.AudioClip.append.

Create a new AudioClip by appending the given clip to the current clip. The new clip is independent of the two source clips. If the sample rates are mismatched, the new clip will contain at least one resampled copy of a source clip. Which clip is resampled is implementation dependent.

Annotations
@Override
createback to summary
public static AudioClip create(byte[] data, int dataOffset, int sampleCount, int sampleFormat, int channels, int sampleRate)

Hides com.sun.media.jfxmedia.AudioClip.create.

Doc from com.sun.media.jfxmedia.AudioClip.create.

Generate a AudioClip from raw LPCM audio data. This can be used to programmatically create sound effects, either generated mathematically or loaded from some arbitrary source. Multiple channels must be interleaved properly, for stereo audio left channel is always first.

createSegmentback to summary
public AudioClip createSegment(double startTime, double stopTime)

Implements abstract com.sun.media.jfxmedia.AudioClip.createSegment.

Doc from com.sun.media.jfxmedia.AudioClip.createSegment.

Create a new AudioClip from a segment of an existing AudioClip. The new clip may copy or simply reference this existing clip, so be aware that this operation may have a severe memory usage impact for long segments. The default parameters are copied to the new clip. This variant specifies the start and end times of the segment. Specifying an end time beyond the duration of the clip will crop the new AudioClip to the end of the source clip. Specifying a start time less than zero or greater than end time is undefined and will return null.

Annotations
@Override
createSegmentback to summary
public AudioClip createSegment(int startSample, int endSample)

Implements abstract com.sun.media.jfxmedia.AudioClip.createSegment.

Doc from com.sun.media.jfxmedia.AudioClip.createSegment.

Create a new AudioClip from a segment of an existing AudioClip. The new clip may copy or simply reference this existing clip, so be aware that this operation may have a severe memory usage impact for long segments. The default parameters are copied to the new clip. This variant specifies the exact sample offsets of the segment, starting at sample zero. If endSample is greater than the number of samples in the source clip, it will be cropped to the last sample. Specifying a start sample less than zero or higher than endSample is undefined and will return null.

Annotations
@Override
flattenback to summary
public AudioClip flatten()

Implements abstract com.sun.media.jfxmedia.AudioClip.flatten.

Doc from com.sun.media.jfxmedia.AudioClip.flatten.

Creates a completely independent AudioClip. Any references contained will be copied and the references removed. The result will be a single AudioEffect containing all the audio data required to produce the effect. If the effect is already independent, then this will simply return the same AudioClip.

Annotations
@Override
getNativeHandleback to summary
pack-priv long getNativeHandle()
initback to summary
public static synchronized boolean init()
isPlayingback to summary
public boolean isPlaying()

Implements abstract com.sun.media.jfxmedia.AudioClip.isPlaying.

Doc from com.sun.media.jfxmedia.AudioClip.isPlaying.

Test if any AudioClipPlayer has this AudioClip in its effect chain.

Annotations
@Override
loadback to summary
public static AudioClip load(URI source)

Hides com.sun.media.jfxmedia.AudioClip.load.

Doc from com.sun.media.jfxmedia.AudioClip.load.

Load an audio clip from the specified source URI. Currently supported formats are AIFF and WAV files. Audio data in the file must be raw PCM, loading compressed files is not supported at this time.

nacAppendback to summary
private native NativeAudioClip nacAppend(long handle, long otherClip)
nacCreateback to summary
private static native long nacCreate(byte[] data, int dataOffset, int sampleCount, int sampleFormat, int channels, int sampleRate)
nacCreateSegmentback to summary
private native NativeAudioClip nacCreateSegment(long handle, double startTime, double stopTime)
nacCreateSegmentback to summary
private native NativeAudioClip nacCreateSegment(long handle, int startSample, int endSample)
nacInitback to summary
private static native boolean nacInit()
nacIsPlayingback to summary
private native boolean nacIsPlaying(long handle)
nacLoadback to summary
private static native long nacLoad(Locator source)
nacPlayback to summary
private native void nacPlay(long handle, double volume, double balance, double pan, double rate, int loopCount, int priority)
nacResampleback to summary
private native NativeAudioClip nacResample(long handle, int startSample, int endSample, int sampleRate)
nacStopback to summary
private native void nacStop(long handle)
nacStopAllback to summary
private static native void nacStopAll()
nacUnloadback to summary
private static native void nacUnload(long handle)
playback to summary
public void play()

Implements abstract com.sun.media.jfxmedia.AudioClip.play.

Doc from com.sun.media.jfxmedia.AudioClip.play.

Play this AudioClip with the default parameters. This is a fire and forget method, the clip will play exactly once using the default parameters.

Annotations
@Override
playback to summary
public void play(double volume)

Implements abstract com.sun.media.jfxmedia.AudioClip.play.

Doc from com.sun.media.jfxmedia.AudioClip.play.

Play this AudioClip at the given volume level. This is a fire and forget method, the clip will play exactly once using the given volume and default pitch and pan.

Annotations
@Override
playback to summary
public void play(double volume, double balance, double rate, double pan, int loopCount, int priority)

Implements abstract com.sun.media.jfxmedia.AudioClip.play.

Doc from com.sun.media.jfxmedia.AudioClip.play.

Play this AudioClip at the given volume level and relative pitch. This is a fire and forget method, the clip will play exactly once using the given parameters.

Annotations
@Override
resampleback to summary
public AudioClip resample(int startSample, int endSample, int newSampleRate)

Implements abstract com.sun.media.jfxmedia.AudioClip.resample.

Doc from com.sun.media.jfxmedia.AudioClip.resample.

Create a new AudioClip from an existing clip by resampling a segment of the source clip to the specified sample playbackRate.

Annotations
@Override
stopback to summary
public void stop()

Implements abstract com.sun.media.jfxmedia.AudioClip.stop.

Doc from com.sun.media.jfxmedia.AudioClip.stop.

Stops all playback of this AudioClip.

Annotations
@Override
stopAllClipsback to summary
public static void stopAllClips()

Hides com.sun.media.jfxmedia.AudioClip.stopAllClips.

Doc from com.sun.media.jfxmedia.AudioClip.stopAllClips.

Stop all AudioClips that are currently playing.

com.sun.media.jfxmediaimpl back to summary

private Class NativeAudioClip.NativeAudioClipDisposer

extends Object
implements ResourceDisposer
Class Inheritance
  • java.lang.Object
  • com.sun.media.jfxmediaimpl.NativeAudioClip.NativeAudioClipDisposer
All Implemented Interfaces
com.sun.media.jfxmediaimpl.MediaDisposer.ResourceDisposer

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

NativeAudioClipDisposerback to summary
private NativeAudioClipDisposer()

Method Detail

disposeResourceback to summary
public void disposeResource(Object resource)

Implements com.sun.media.jfxmediaimpl.MediaDisposer.ResourceDisposer.disposeResource.

Doc from com.sun.media.jfxmediaimpl.MediaDisposer.ResourceDisposer.disposeResource.

Dispose the provided resource.

Annotations
@Override