I have application that searchs External storage for the file i want..Example for song named sound1.mp3 String path = getFullFilePath(getApplicationContext(), "sound1.mp3);
.I use loaded sound for soundpool. I want to get text from Preference Edittext and use it except "sound1.mp3".. I tried this :
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
SharedPreferences getPrefs = PreferenceManager
.getDefaultSharedPreferences(getBaseContext());
SharedPreferences settings = getSharedPreferences("EditText",0);
String zipStr = settings.getString("ime", "");
sp = new SoundPool(5, AudioManager.STREAM_MUSIC, 0);
String path = getFullFilePath(getApplicationContext(), zipStr);
Log.d("ime", "Path: " + path);
mSoundId = sp.load(path, 1);
LogCat gives this :
11-06 15:57:59.169: D/ime(5688): Path: /mnt/sdcard
11-06 15:57:59.539: E/SoundPool(5688): Unable to load sample: (null)
11-06 15:58:01.149: W/asset(5688): deep redirect failure from 0x0103003e => 0x02060007, defStyleAttr=0x00000000, defStyleRes=0x00000000, style=0x00000000
11-06 15:58:17.509: W/SoundPool(5688): sample 1 not READY