B4J Question Audio Beeper

Phil Thompson

Member
Licensed User
Longtime User
Waiting for debugger to connect...
Program started.
java.lang.NoClassDefFoundError: android/media/AudioTrack
at anywheresoftware.b4a.audio.Beeper.Initialize2(Beeper.java:54)
at anywheresoftware.b4a.audio.Beeper.Initialize(Beeper.java:37)
at phil.timeclock.b4xmainpage._initialize(b4xmainpage.java:2089)
at phil.timeclock.b4xpagesmanager._initialize(b4xpagesmanager.java:112)
at phil.timeclock.main._appstart(main.java:104)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:629)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:237)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 

Phil Thompson

Member
Licensed User
Longtime User
OOPS!
I intended to add text above the preceding error text.
This was generated when I added the audio library and followed the instruction of use for B4J

Audio library was updated and it now supports generating "beep" sounds.

B4X:

Dim b As Beeper
b.Initialize(300, 500) '300 milliseconds, 500 hz
b.Beep
Once the object is initialized you can reuse it and play it multiple times.
Documentation: http://www.b4x.com/android/help/audio.html

Installation instructions:
- Download the attached file.
- Copy both files to the internal libraries folder: C:\Program Files\Anywhere Software\Basic4android\Libraries
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0
Top