Android Tutorial MediaPlayer tutorial

hgperli

Member
Licensed User
Longtime User
that's what I'm calling:

MinMP3_Player.Load("smb://192.168.178.25/public/_MUSIK_/A/ABBA/Waterloo/19-Waterloo.mp3")
so path is "smb://192.168.178.25/public/_MUSIK_/A/ABBA/Waterloo/"
file is "19-Waterloo.mp3"

Sub Process_Globals
Dim MP3_Server As SMB
Dim MinMP3_Player As MediaPlayerStream
End Sub
Sub Activity_Create(FirstTime As Boolean)
MP3_Server.Initialize("MP3_Server")
MP3_Server.ListFiles("smb://192.168.178.25/public/_MUSIK_/A/ABBA/Waterloo/","*") '<--------- this works perfect: lists all files

MinMP3_Player.Initialize("MinMP3_Player")
MinMP3_Player.Load("smb://192.168.178.25/public/_MUSIK_/A/ABBA/Waterloo/19-Waterloo.mp3") '<-------- this doesn't work at all: only error message
End Sub
 

Amadea

New Member
Earlier I think I asked the question in the wrong section, so I go ahead and ask it here. How do I include the audio file in the project? Where should I copy it? When I copy it to the emulator, it puts it in the download folder. I'm totally baffled as to what I need to do to get it find the audio file.
 

DonManfred

Expert
Licensed User
Longtime User
Earlier I think I asked the question in the wrong section, so I go ahead and ask it here.
This is your first post here in the forum. so you did not ask somewhere else (maybe in another forum).

You should create a new thread for your issue describing what the problem is and what code you are using (maybe upload your project (in the ide file -> Export as zip)

hat I need to do to get it find the audio file.
Put the file into your files-directory of your project before compiling.

See the example code in Post #1 of this thread.

Dont use the Android emulator. It is slow, not reliable and not suggested to use.

Use a real Device instead. Or an VM like Genymotion.
 

Amadea

New Member

Thank you very much. I'm now hearing something. I went ahead and deleted that question, it was in B4J section. BTW, I do use genymotion. Thanks again.
 

JonPM

Well-Known Member
Licensed User
Longtime User
For various audio files is it better to use different MediaPlayer objects (ie MP1, MP2, etc)? Or to have one MediaPlayer object and load the sound at the time needed (on button click for example)?
Also I use some of the same audio files across different activities. Should MP only be initialized and loaded in Main, or done in each activity?
 

AbbasMohammed

Member
Licensed User
Longtime User
hello,

I'm wondering where did you set the shapes of the seek bars ? I cant find it anywhere in the project!!!

thank you in advance
 

rtek1000

Active Member
Licensed User
Longtime User
Hello,

I would suggest to add in the usage hint text for MediaPlayer.Looping, explain that have been used after MediaPlayer.Load

I've tried using MediaPlayer.Looping before MediaPlayer.Load and it does not work.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…