B4J Question Sound mp3 file ok in Debug and release mode but fails in stand alone

Phil Thompson

Member
Licensed User
Longtime User
All I want is a very simple beep sound in a B4J app. I have looked at and tried a lot of examples that I could not get to work

In release or debug mode when I call Beep, it works fine
When I create the standalone package. the program exits on error

the debug code is shown below



Beep Sub:
Private mp As MediaPlayer

Sub Beep
    mp.Initialize("mp", File.GetUri(File.DirAssets, "sample.mp3"))
    mp.play

End Sub

I also tried with the same result
mp.Initialize("mp", File.GetUri(File.DirApp, "sample.mp3"))
mp.Initialize("mp", File.GetUri(xui.DefaultFolder, "sample.mp3"))

The sample.mp3 is in
C:\TimeClock\bin
and in
C:\Users\philg\AppData\Roaming\EventClock
and was put into files using the file manager



1732567775700.png
 
Last edited:

jahswant

Well-Known Member
Licensed User
Longtime User
 
Upvote 0
Top