It (partly) wraps this Github project. Don't let the name fool you - it is a visualizer driven by input from the device's microphone.
Posting:
1. B4A libraries
2. The Java source code - change it to your liking
3. B4A project demonstrating it.
Sample Code:
VoiceRecordingVisualizer
Author: Github: Takayuki Yorikane, Wrapped by: Johan Schoeman
Version: 1
Posting:
1. B4A libraries
2. The Java source code - change it to your liking
3. B4A project demonstrating it.
Sample Code:
B4X:
#Region Project Attributes
#ApplicationLabel: b4aVoiceRecordingVisualizer
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: landscape
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private vrv1 As VisualizerView
Private b1 As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("main")
vrv1.Color = Colors.ARGB(100, 0, 0, 150)
vrv1.Visible = True
vrv1.NumberOfColumns = 100
vrv1.RenderColor = Colors.red
vrv1.RenderType = 1 'can oly be 1 = bar or 2 = pixel
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
vrv1.releaseRecorder
End Sub
Sub b1_Click
vrv1.toggleRecording
End Sub
VoiceRecordingVisualizer
Author: Github: Takayuki Yorikane, Wrapped by: Johan Schoeman
Version: 1
Fields:- visualizerView As Int[]
- visualizerView_numColumns As Int
- visualizerView_renderColor As Int
- visualizerView_renderRange As Int
- visualizerView_renderType As Int
- VisualizerView
Fields:- ba As BA
- BringToFront
- DesignerCreateView (base As PanelWrapper, lw As LabelWrapper, props As Map)
- Initialize (EventName As String)
- Invalidate
- Invalidate2 (arg0 As Rect)
- Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
- IsInitialized As Boolean
- RemoveView
- RequestFocus As Boolean
- SendToBack
- SetBackgroundImage (arg0 As Bitmap)
- SetColorAnimated (arg0 As Int, arg1 As Int, arg2 As Int)
- SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
- SetLayoutAnimated (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int, arg4 As Int)
- SetVisibleAnimated (arg0 As Int, arg1 As Boolean)
- addListener2
- onCalculateVolume (volume As Int)
- releaseRecorder
- toggleRecording
- Background As Drawable
- Color As Int [write only]
- Enabled As Boolean
- Height As Int
- Left As Int
- NumberOfColumns As Int [write only]
Set the number of columns for the visualizer - RenderColor As Int [write only]
Set the render color of the visualizer - RenderType As Int [write only]
Set the render type
1 = Bar Graph
2 = Pixel
It will default to Bar if an invalid value is passed - Tag As Object
- Top As Int
- Visible As Boolean
- Width As Int