Skip to content

Troubleshooting Audio on Mobile SDK

ciscoRankush edited this page Aug 21, 2024 · 2 revisions

Capturing Audio Dump: Troubleshooting Audio on Mobile SDKs

Troubleshooting audio issues within mobile applications that leverage the Webex Mobile SDK can be greatly aided by the use of audio dump files. These files provide developers with valuable information about the audio streams during calls or meetings, which can be analyzed to identify and resolve audio-related problems.

Overview

The Webex Mobile SDK (version 3.13.0 and above) includes a suite of APIs that allow developers to record, manage, and retrieve audio dump files. These files can be used to diagnose audio quality issues, such as echoes, noise, or interruptions that users might experience during a Webex call or meeting.

Key APIs for Audio Troubleshooting

Here is an outline of the primary APIs available in the Webex Mobile SDK for troubleshooting audio issues:

isRecordingAudioDump()

  • Description: Check if the audio dump is currently being recorded for an ongoing call or meeting.
  • Return Type: Boolean
  • Usage:
    var isRecording = call?.isRecordingAudioDump()

canStartRecordingAudioDump(CompletionHandler<RecordAudioDumpResult>)

  • Description: Check if the audio dump can be started for an ongoing call or meeting.
  • completionHandler: Closure to be executed with the result of the operation. If result is successful, audio dump recording can begin; otherwise, an Error is provided.
  • Usage:
    call?.canStartRecordingAudioDump {
            if (it.isSuccessful) {
                Log.d(tag, "canStartRecordingAudioDump successful")
            } else {
                Log.d(tag, "canStartRecordingAudioDump error: ${it.error?.errorMessage}")
            }
        }
  • Possible Failure Reasons:
    • notAHost: You have to be a host in case of a meeting
    • noActiveCall: No active call for the user
    • internalError: Internal error

startRecordingAudioDump(Context,CompletionHandler<RecordAudioDumpResult>)

  • Description: Start recording the audio dump for an ongoing call or meeting.
  • Context: Context to get the path from filesystem to store the audio dump files.
  • completionHandler: Closure to be executed when the operation is completed. If result is successful, recording started successfully; otherwise, an Error is provided.
  • Usage:
    call?.startRecordingAudioDump(context) {
            if (it.isSuccessful) {
                Log.d(tag, "startRecordingAudioDump successful")
            } else {
                Log.d(tag, "startRecordingAudioDump error: ${it.error?.errorMessage}")
            }
        }
  • Possible Failure Reasons:
    • alreadyRecording: No audio recording in progress to be stopped
    • dumpFolderCreationFailed: Error creating AudioDump directory
    • noActiveCall: No active call for the user
    • internalError: Internal error

stopRecordingAudioDump(CompletionHandler<RecordAudioDumpResult>)

  • Description: Stop recording the audio dump.
  • completionHandler: Closure to be executed when the operation is completed. If result is successful, recording stopped successfully; otherwise, an Error is provided.
  • Usage:
    call?.stopRecordingAudioDump() {
            if (it.isSuccessful) {
                Log.d(tag, "stopRecordingAudioDump successful")
            } else {
                Log.d(tag, "stopRecordingAudioDump error: ${it.error?.errorMessage}")
            }
        }
  • Possible Failure Reasons:
    • alreadyNotRecording: No audio recording in progress to be stopped
    • noActiveCall: No active call for the user
    • internalError: Internal error

getlogFileUri(includelastRunLog:Boolean)

  • Description: Retrieve a URI of the zipped log files, which now also include the recorded audio dump files.
  • includelastRunLog : if last running logs to be retrieved. Default value is false
  • Return Type: A Uri containing log files in form of a zip
  • Usage:
    var zippedFileUriContaingAudioDump = webex.getlogFileUri(true)

Precondition for Audio Dump APIs

Before using the audio dump APIs, ensure that the user is on an active call or meeting. The APIs are designed to work in the context of a live session. Additional Precondition: Host Requirement

For recording audio dump for a meeting, you need to be the host.

How to Use the APIs for Audio Troubleshooting

  1. Check Recording Eligibility: Before starting a new audio dump recording, call canStartRecordingAudioDump(completionHandler) to ensure it's possible to record.
  2. Determine Recording Status: Use isRecordingAudioDump() to check if audio recording is already in progress.
  3. Start Recording: If eligible, use startRecordingAudioDump(context, completionHandler) to begin recording the audio dump.
  4. Manage Existing Recordings: Before every recording, the previous recording is cleared. At a time, only one recording is saved in the logs folder.
  5. Stop Recording: When the troubleshooting session is complete, call stopRecordingAudioDump(completionHandler) to halt the recording.
  6. Retrieve Logs: Use getlogFileUri() to get the Uri for the zipped log files, which includes the audio dump files for analysis.
  7. Multiple Recordings: You can record multiple times in a single call. However, note that recording for more time will increase the size of the logs.

Conclusion

The audio dump feature in the Webex Mobile SDK is a powerful tool for developers to diagnose and troubleshoot audio-related issues. By leveraging these APIs, developers can gain valuable insights into audio streams during calls or meetings, helping to identify and resolve problems such as echoes, noise, or interruptions. The requirement to be a host for recording, the management of existing recordings, and the ability to perform multiple recordings in a single call are key considerations for effective use of this feature.

Clone this wiki locally