mirror of
https://github.com/2OOP/pism.git
synced 2026-02-04 02:44:50 +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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
try {
|
||||
@@ -146,13 +144,17 @@ public class SoundEffectAsset extends BaseResource implements LoadableResource,
|
||||
|
||||
@Override
|
||||
public long duration() {
|
||||
return 0; // TODO
|
||||
if (clip != null) {
|
||||
return (long) (clip.getMicrosecondLength() / 1_000_000.0);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
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