Android Question Record audio of phone calls, save on file, and play audio file

amorosik

Expert
Licensed User
I would like to make android apps to record phone call audio both outgoing and incoming calls
How to make a resident program that records the audio of phone calls, saves them on individual files, and allows you to reproduce them for listening?
 

Jmu5667

Well-Known Member
Licensed User
Longtime User
I would like to make android apps to record phone call audio both outgoing and incoming calls
How to make a resident program that records the audio of phone calls, saves them on individual files, and allows you to reproduce them for listening?
I am not sure if that is possble anymore.
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
Eh ho capito, l'amatissimo Aranzulla ne sa una piu' del diablo
Ma se volessi farmela damme' a colpi di codice?
I meant that apparently it's still possible; how, unfortunately I don't know.
Intendevo dire che a quanto pare è ancora possibile; come, purtroppo non lo so.

Maybe I'll drink a coffee and try to find out.
Magari bevo un caffè (ancora da fare) e cercherò di informarmi.
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
Maybe I'll drink a coffee and try to find out.
Magari bevo un caffè (ancora da fare) e cercherò di informarmi.
I haven't looked at the source and I'm pretty sure it will contain a lot of bugs, non-existent libraries and methods (that's how Perplexity's big AI works 😁 :confused:), but it might be a starting point.
by Perplexity:
Sub Process_Globals
    Dim recorder As MediaRecorder
End Sub

Sub Globals
    ' Dichiarazione dei controlli UI
End Sub

Sub Activity_Create(FirstTime As Boolean)
    ' Inizializzazione dell'oggetto MediaRecorder
    recorder.Initialize("recorder")
End Sub

Sub Activity_Resume
    ' Richiesta dei permessi necessari per la registrazione audio
    If Not(Starter.rp.Check(Starter.rp.PERMISSION_RECORD_AUDIO)) Then
        Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_RECORD_AUDIO)
    Else
        StartRecording()
    End If
End Sub

Sub Activity_Pause (UserClosed As Boolean)
    ' Interruzione della registrazione audio
    StopRecording()
End Sub

Sub StartRecording
    ' Impostazione delle opzioni di registrazione
    recorder.SetAudioSource(recorder.AS_VOICE_CALL)
    recorder.SetOutputFormat(recorder.OutputFormat.MPEG_4)
    recorder.SetAudioEncoder(recorder.AudioEncoder.AAC)
    recorder.SetOutputFile(File.DirRootExternal, "phone_call_recording.mp4")
 
    ' Avvio della registrazione
    recorder.Prepare()
    recorder.Start()
End Sub

Sub StopRecording
    ' Interruzione della registrazione
    recorder.Stop()
    recorder.Release()
End Sub

[Perplexity]
Si noti che la registrazione delle telefonate può essere soggetta a restrizioni legali e normative. Assicurarsi di rispettare le leggi e le normative locali prima di utilizzare questa funzionalità.
Please note that recording phone calls may be subject to legal and regulatory restrictions. Make sure you comply with local laws and regulations before using this feature.

P.S.
Unknown type: mediarecorder - Are you missing a library reference?

I'm afraid you should attempt somersaults with inline Java.
https://developer.android.com/reference/android/media/MediaRecorder


P.P.S.

Audio library:

1691639094657.png
 
Last edited:
Upvote 0
Top