mirror of
https://github.com/shadowfacts/lwjgl2-arm64.git
synced 2026-04-04 14:07:52 +00:00
mod: now using getResourceAsStream to load, since this enables us to load from ./ and from classpath
This commit is contained in:
parent
2cc94ffd75
commit
8e992f3257
1 changed files with 9 additions and 9 deletions
|
|
@ -41,7 +41,7 @@ import javax.sound.sampled.*;
|
|||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.FileInputStream;
|
||||
//import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
|
|
@ -89,14 +89,14 @@ public class WaveData {
|
|||
* @return WaveData containing data, or null if a failure occured
|
||||
*/
|
||||
public static WaveData create(String filepath) {
|
||||
try {
|
||||
return create(
|
||||
AudioSystem.getAudioInputStream(
|
||||
new BufferedInputStream(new FileInputStream(filepath))));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return create(
|
||||
AudioSystem.getAudioInputStream(
|
||||
new BufferedInputStream(ClassLoader.getSystemClassLoader().getResourceAsStream(filepath))));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue