iOS Code Snippet Play Beep Sound

B4X:
Sub PlayBeep
    Dim NativeMe As NativeObject = Me
    NativeMe.RunMethod("beep", Null)
End Sub

#If ObjC
#import <AVFoundation/AVAudioPlayer.h>
- (void) beep {
  AudioServicesPlaySystemSound(1302);
}
#End If

You can change the value of 1302 above to other sound ID.

List of SystemSoundIDs
https://github.com/TUNER88/iOSSystemSoundsLibrary
 

highflyer

Member
Licensed User
Longtime User
B4X:
Sub PlayBeep
    Dim NativeMe As NativeObject = Me
    NativeMe.RunMethod("beep", Null)
End Sub

#If ObjC
#import <AVFoundation/AVAudioPlayer.h>
- (void) beep {
  AudioServicesPlaySystemSound(1302);
}
#End If

You can change the value of 1302 above to other sound ID.

List of SystemSoundIDs
https://github.com/TUNER88/iOSSystemSoundsLibrary


Trying to compile using the remote build server the following error is generated:

Error: ** BUILD FAILED **
The following build commands failed:
CompileC build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/armv7/b4i_main.o B4iProject/b4i_main.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
 
Top