mirror of
https://github.com/2OOP/pism.git
synced 2026-02-04 19:04:49 +00:00
Clips now also return positional information
This commit is contained in:
@@ -40,8 +40,6 @@ public class SoundEffectAsset extends BaseResource implements LoadableResource,
|
|||||||
return AudioSystem.getAudioInputStream(decodedFormat, audioInputStream);
|
return AudioSystem.getAudioInputStream(decodedFormat, audioInputStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void load() {
|
public void load() {
|
||||||
try {
|
try {
|
||||||
@@ -146,13 +144,17 @@ public class SoundEffectAsset extends BaseResource implements LoadableResource,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long duration() {
|
public long duration() {
|
||||||
return 0; // TODO
|
if (clip != null) {
|
||||||
|
return (long) (clip.getMicrosecondLength() / 1_000_000.0);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long currentPosition() {
|
public long currentPosition() {
|
||||||
return 0; // TODO
|
if (clip != null) {
|
||||||
|
return (long) (clip.getMicrosecondPosition() / 1_000_000.0);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user