Android Question audio file is missing from files tab

Albi

Active Member
Licensed User
Longtime User
Hello,

This error only happens the first time that the app is run. (or run after closing it down completely) I get a pop up which says
"An error has occured in sub:
java.io.FileNotFoundException:
testAudio.wav
Continue?
No Yes"

I followed the tutorial to get the below code (i can't find the code tag on the forum to get it to post properly?!) The issue is in this code within Activity_Create:

If FirstTime Then
MediaPlayer1.Initialize()
MediaPlayer1.load(File.DirAssets, "testAudio.wav")
End If

The code that is underlined is the following:
MediaPlayer1.load(File.DirAssets, "testAudio.wav")

The error message that comes up in the IDE is
File 'testaudio.wav' is missing from the Files tab. (warning #17)

(MediaPlayer1 is dimed in Process_Globals as MediaPlayer)

I thought I read somewhere on this forum not to worry about that message for audio but can't find it any more.
I tried to add the file through the designer, as I have for images, however, it only looks for images, not audio files.

After the first time the error messages comes up, all other times everything runs fine!
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
You need to add the image to the Files tab.
SS-2015-01-06_09.02.35.png
 
Upvote 0
Top