Skip to content

Commit 8e3789e

Browse files
committed
fixed mp3 loading problem for osx and added failsafe if file is not existing.
1 parent 239710e commit 8e3789e

File tree

5 files changed

+11
-3
lines changed

5 files changed

+11
-3
lines changed
460 Bytes
Binary file not shown.
494 KB
Binary file not shown.

java/libraries/sound/src/cpp/processing_sound_MethClaInterface.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ JNIEXPORT jint JNICALL Java_processing_sound_MethClaInterface_engineNew (JNIEnv
8181
.addLibrary(methcla_plugins_tri)
8282
.addLibrary(methcla_plugins_pulse)
8383
.addLibrary(methcla_soundfile_api_libsndfile)
84+
.addLibrary(methcla_soundfile_api_mpg123)
8485
.addLibrary(methcla_plugins_patch_cable)
8586
.addLibrary(methcla_plugins_sampler)
8687
.addLibrary(methcla_plugins_white_noise)

java/libraries/sound/src/processing/sound/SoundFile.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package processing.sound;
22
import processing.core.*;
3+
import java.io.File;
34

45
public class SoundFile implements SoundObject {
56

@@ -14,8 +15,7 @@ public class SoundFile implements SoundObject {
1415
float m_add=0;
1516
int m_cue=0;
1617
float m_pos=0;
17-
boolean m_loop;
18-
18+
boolean m_loop;
1919

2020
public SoundFile(PApplet theParent, String path) {
2121
this.parent = theParent;
@@ -24,7 +24,13 @@ public SoundFile(PApplet theParent, String path) {
2424
m_engine.start();
2525
methCla = new MethClaInterface();
2626
m_filePath=theParent.dataPath(path);
27-
m_info = m_engine.soundFileInfo(m_filePath);
27+
File sample = new File(m_filePath);
28+
if(sample.isFile() == true){
29+
m_info = m_engine.soundFileInfo(m_filePath);
30+
}
31+
else {
32+
System.out.println("Error: Soundfile doesn't exist. Pleae check path");
33+
}
2834
}
2935

3036
public int frames(){

java/libraries/sound/todo.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
+ Fix problem of passing effects to Analyzers
1414
+ Make audio input work
1515
- Use Patch Cables for signal splitting for effects
16+
+ Fix MP3 thing
1617

1718
Features:
1819
+ Compile Windows Version

0 commit comments

Comments
 (0)