B4A Library AndroidRecording - Voice / Sound recording with Visualizer

Johan Schoeman

Expert
Licensed User
Longtime User
none

If you want can try directly the applicazion.
thank
Does the original project in post #1 work? The sound file should be created and stored in the "root" folder of your device. I seem to remember that is how the original Java Lib was set up.
 

Johan Schoeman

Expert
Licensed User
Longtime User
From the Java lib

B4X:
    public static boolean checkExternalStorageAvailable() {
        String state = Environment.getExternalStorageState();
        if (Environment.MEDIA_MOUNTED.equals(state)) {
            return true;
        }
        else {
            return false;
        }
    }
    
    public static String getFileName(boolean isAudio) {
        String storageDir = Environment.getExternalStorageDirectory().getAbsolutePath();
        return String.format("%s/%s", storageDir, (isAudio) ? AUDIO_FILE_NAME : VIDEO_FILE_NAME);
    }
 

Roberto P.

Well-Known Member
Licensed User
Longtime User
Hi Johan

Yes, the original example work, but save the file in the root. Can you help me to change the directory where the file is saved?

thank
 

hatzisn

Expert
Licensed User
Longtime User
Hi everyone,

can somebody inform me on how to deal with github? I found this page in stackoverflow:

https://stackoverflow.com/questions/4644351/android-music-track-visualization


that creates a visual output for a playing sound file in the device and I do not know what to do with it and how can I manipulate it.
It is obvious that my knowledge in this is totally sub-zero... Can someone more advanced inform me and give me some advice (also where
to look for the code) ?

Thanks in advance...


Edit - Found it - Duuuh? - src...
 

Johan Schoeman

Expert
Licensed User
Longtime User
Hi Johan

Yes, the original example work, but save the file in the root. Can you help me to change the directory where the file is saved?

thank
Try with the attached lib files (V1.01). You will have to use the normal B4A "File" code to create the folder, etc.


B4X:
    ar1.VisualizerColor = Colors.Yellow
    ar1.VisualizerBarWidth = 2.0
    ar1.DrawBarsFromTop = False
    ar1.VisualizerDivisions = 2
    DateTime.DateFormat = "yyMMddHHmmss"
    Dim filename As String = File.Combine(File.DirRootExternal & "/Myfolder", "myRecording" & DateTime.Date(DateTime.Now)) & ".wav"
    ar1.RecordingFileName = filename
 

Attachments

  • AndroidRecording.xml
    10.7 KB · Views: 329
  • AndroidRecording.jar
    32.5 KB · Views: 336
Cookies are required to use this site. You must accept them to continue using the site. Learn more…