Skip to content

Commit

Permalink
Use "audio/mpeg" mime for mp3 samples
Browse files Browse the repository at this point in the history
  • Loading branch information
Feodor0090 committed Jun 21, 2023
1 parent 5f77039 commit 077f381
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/nmania/Sample.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ public Sample(String file, String type) throws IOException, MediaException {
player = Manager.createPlayer(file);
} else {
if (type == null) {
type = "audio/" + file.substring(file.lastIndexOf('.') + 1, file.length());
String ext = file.substring(file.lastIndexOf('.') + 1, file.length()).toLowerCase();
if ("mp3".equals(ext))
ext = "mpeg";
type = "audio/" + ext;
}
player = Manager.createPlayer(getClass().getResourceAsStream(file), type);
}
Expand Down

0 comments on commit 077f381

Please sign in to comment.