Skip to content
This repository has been archived by the owner on Oct 13, 2024. It is now read-only.

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Tianscar committed May 18, 2023
1 parent 6fab06c commit a4d9b80
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repositories {
```groovy
dependencies {
...
implementation 'com.tianscar.javasound:javasound-resloader:0.1.2'
implementation 'com.tianscar.javasound:javasound-resloader:0.1.3'
}
```

Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ ext {
libraryGroupName = 'com.tianscar.javasound'
libraryVendorName = 'Tianscar'

libraryVersionCode = 3
libraryVersionName = '0.1.2'
libraryVersionCode = 4
libraryVersionName = '0.1.3'

librarySourceCompatibility = JavaVersion.VERSION_1_8
libraryTargetCompatibility = JavaVersion.VERSION_1_8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ public class JDKSoundbankResourceReader implements SoundbankResourceReader {

@Override
public Soundbank getSoundbank(ClassLoader resourceLoader, String name) throws InvalidMidiDataException, IOException {
InputStream stream = resourceLoader.getResourceAsStream(name);
if (stream == null) throw new IOException("could not load resource \"" + name + "\" with ClassLoader \"" + resourceLoader + "\"");
else return MidiSystem.getSoundbank(stream);
try (InputStream stream = resourceLoader.getResourceAsStream(name)) {
if (stream == null) throw new IOException("could not load resource \"" + name + "\" with ClassLoader \"" + resourceLoader + "\"");
else return MidiSystem.getSoundbank(stream);
}
}

}

0 comments on commit a4d9b80

Please sign in to comment.