public class JDK10AudioClip extends java.lang.Object implements LoopableAudioClip
LOOP_CONTINUOUSLY
Constructor and Description |
---|
JDK10AudioClip(byte[] samples,
int sampleRate)
For constructing directly from Jar entries, or any other
raw Audio data.
|
Modifier and Type | Method and Description |
---|---|
void |
loop() |
void |
loop(int count)
Starts looping playback from the current position.
|
void |
play() |
void |
stop() |
static void |
writeSunAudioHeader(byte[] data,
int sampleRate,
int datasize)
Overwrites the 24 first bites of the provided data array with
a sun audio header.
|
public JDK10AudioClip(byte[] samples, int sampleRate)
public void play()
play
in interface java.applet.AudioClip
public void loop()
loop
in interface java.applet.AudioClip
public void loop(int count)
count
times, and finally continue playback to the end of
the clip.
If the current position when this method is invoked is greater than the loop end point, playback simply continues to the end of the clip without looping.
A count
value of 0 indicates that any current looping should
cease and playback should continue to the end of the clip. The behavior
is undefined when this method is invoked with any other value during a
loop operation.
If playback is stopped during looping, the current loop status is cleared; the behavior of subsequent loop and start requests is not affected by an interrupted loop operation.
loop
in interface LoopableAudioClip
count
- the number of times playback should loop back from the
loop's end position to the loop's start position, or
LoopableAudioClip.LOOP_CONTINUOUSLY
to indicate that looping should
continue until interruptedpublic void stop()
stop
in interface java.applet.AudioClip
public static void writeSunAudioHeader(byte[] data, int sampleRate, int datasize)