Android Question Audio LIB is for B4A, what can I use for B4J and B4I ?

kohlenach

Member
Licensed User
Hi I cant to make a cross platform app, but I dont see a lib what works on the 3 platforms.
What I can use for B4J and B4i ?

rgs
J.
 

LucaMs

Expert
Licensed User
Longtime User
In B4J and B4I, you need to create a variable of type MediaPlayer, obviously initialize it, and then use it.
However, in B4J you don't need to import libraries, while in B4I you need to use the iMedia library.

Note: I don't have B4I, so this information may not be 100% accurate. Try it and let me know.
 
Last edited:
Upvote 0

kohlenach

Member
Licensed User
Hi,
the mediaplayer is good for playing like one time. In my project (little game) I have to click serval buttons
one after the other. Each time there must be a sound.
Now I use for b4a:
Dim sounds As SoundPool
sounds.Initialize(1)
IDsoundSelectStone = sounds.Load(File.DirAssets,"move6.wav")

where i click the button:
sounds.Play(IDsoundSelectStone,1,1,2,0,1)

With the mediaplayer I must
for every click : play, stop , load the file from asset folder and play. There is a lack of time...that dont work out
 
Upvote 0

kohlenach

Member
Licensed User
a feedback :
I use with #if ... #endif for my crossplattform developing

b4a - audio lib (intern)
b4j - AudioClip lib (extern, thanks Steve)
b4i - igameview lib (intern)
 
Upvote 0
Top