共用方式為


通話錄音概觀

通話錄製可讓您記錄 Azure 通訊服務 中可用的多個通話案例,方法是提供一組 API 來啟動、停止、暫停和繼續錄製。 無論是 PSTN、WebRTC 或 SIP 呼叫,都可以從伺服器端商務邏輯存取這些 API。 此外,使用者動作可以告知伺服器應用程式開始錄製,以觸發錄製。

視您的業務需求而定,您可以在各種 Azure 通訊服務通話實作中使用通話錄音。

例如,您可以錄製 1 對 1 或 1 對 N 音訊和視訊通話:

顯示正在記錄呼叫的圖表。

您也可以使用通話錄製來記錄由通話自動化管理的複雜 PSTN 或 VoIP 輸入和輸出通話工作流程。

無論您如何建立通話,通話錄製都可讓您在內建的暫存記憶體上產生儲存 24 小時的混合或未合併媒體檔案。 您可以擷取檔案、將其移至您自己的 Azure Blob 存放區自備 儲存體,或您選擇的記憶體解決方案。 通話錄音支援所有 Azure 通訊服務資料區域。

顯示通話錄製架構的圖表。

支援業務需求的通話錄音

通話錄音支援多種媒體輸出和內容類型,可滿足您的業務需求和使用案例。 您可以在某些情況下使用混音格式,例如保存記錄、會議記錄、指導和訓練,甚至是合規性和遵從性。 或者,您可以使用原音音訊格式來處理品質保證使用案例,或更複雜的情節,例如進階分析或 AI (人工智慧) 複雜的通話後處理。

影片

管道類型 內容格式 解決方法 取樣率 位元速率 資料速率 輸出 描述
混合 mp4 1920x1080,16 FPS (每秒畫面格數) 16 kHz 1 Mbps 7.5 MB/分鐘* 單一檔案,單聲道 預設 3x3 (最活躍的說話者) 並排安排以及顯示名稱支援的混合視訊

音訊

管道類型 內容格式 取樣率 位元速率 資料速率 輸出 描述
混合 mp3 16 kHz 48 KBps 0.36 MB/分鐘* 單一檔案,單聲道 所有參與者的混音
混合 wav 16 kHz 256 kbps 1.92 MB/分鐘 單一檔案,單聲道 所有參與者的混音
原音 wav 16 kHz 256 kbps 每個頻道 1.92 MB/分鐘* 單一檔案,最多 5 個 wav 聲道 原音,每個聲道一個參與者,最多五個聲道

[*注意]Mp3 和 Mp4 格式會使用造成可變比特率的遺失壓縮;因此,上述數據表中的數據速率值會反映理論最大值。 WAV 格式未壓縮且位元速率固定,因此資料速率計算確實正確。

使用通話錄音 API 來完全掌控錄製內容

您可以使用通話錄製 API 透過內部商業規則觸發程式來管理錄製,例如建立群組通話和錄製交談的應用程式。 此外,使用者動作可以告知伺服器應用程式開始錄製,以觸發錄製。 通話錄音 API 只使用 serverCallId 來起始錄製。 若要了解如何取得 serverCallId,請參閱通話錄音快速入門recordingId錄製開始時會傳回 ,然後可用於暫停和繼續等後續作業。

作業 操作對象 註解
開始錄製 serverCallId 傳回 recordingId
取得錄製狀態 recordingId 傳回 RecordingStateResult
暫停錄製 recordingId 暫停和繼續通話錄音可讓您略過錄製通話或會議的一部分,並繼續錄製到單一檔案。
繼續錄製 recordingId 繼續已暫停的錄製作業。 收錄的內容與暫停之前的內容放在相同檔案中。
停止錄製 recordingId 停止錄製,並起始最終媒體處理以提供檔案下載。

事件方格通知

通話錄音使用 Azure 事件方格,為您提供媒體和中繼資料相關的通知。

注意

Azure 通訊服務為錄製內容提供短期媒體儲存體。 錄製可供下載 24 小時。 24 小時之後,就無法再使用錄音。

當錄製準備好進行擷取時,就會發佈事件方格通知 Microsoft.Communication.RecordingFileStatusUpdated ,通常是錄製程式完成幾分鐘后,例如會議結束或錄製停止。 錄製事件通知包括 contentLocationmetadataLocation,用於擷取錄製的媒體和中繼資料錄製檔案。

通知結構描述參考

{
    "id": string, // Unique guid for event
    "topic": string, // /subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}
    "subject": string, // /recording/call/{call-id}/serverCallId/{serverCallId}/recordingId/{recordingId}
    "data": {
        "recordingStorageInfo": {
            "recordingChunks": [
                {
                    "documentId": string, // Document id for retrieving from storage
                    "index": int, // Index providing ordering for this chunk in the entire recording
                    "endReason": string, // Reason for chunk ending: "SessionEnded", "ChunkMaximumSizeExceeded”, etc.
                    "metadataLocation": <string>,  // url of the metadata for this chunk
                    "contentLocation": <string>,   // url of the mp4, mp3, or wav for this chunk
                    "deleteLocation": <string>     // url of the mp4, mp3, or wav to delete this chunk
                }
            ]
        },
        "recordingStartTime": string, // ISO 8601 date time for the start of the recording
        "recordingDurationMs": int, // Duration of recording in milliseconds
        "sessionEndReason": string // Reason for call ending: "CallEnded", "InitiatorLeft", etc.
    },
    "eventType": string, // "Microsoft.Communication.RecordingFileStatusUpdated"
    "dataVersion": string, // "1.0"
    "metadataVersion": string, // "1"
    "eventTime": string // ISO 8601 date time for when the event was created
}

中繼資料結構描述參考

{
  "resourceId": <string>,           // stable resource id of the Azure Communication Services resource recording
  "callId": <string>,               // id of the call
  "chunkDocumentId": <string>,      // object identifier for the chunk this metadata corresponds to
  "chunkIndex": <number>,           // index of this chunk with respect to all chunks in the recording
  "chunkStartTime": <string>,       // ISO 8601 datetime for the start time of the chunk this metadata corresponds to
  "chunkDuration": <number>,        // [Chunk duration has a maximum of 4 hours] duration of the chunk this metadata corresponds to in milliseconds
  "pauseResumeIntervals": [
              "startTime": <string>,          // ISO 8601 datetime for the time at which the recording was paused
              "duration": <number>            // duration of the pause in the recording in milliseconds
                          ],
  "recordingInfo": {
               "contentType": <string>,        // content type of recording, e.g. audio/audioVideo
               "channelType": <string>,        // channel type of recording, e.g. mixed/unmixed
               "format": <string>,             // format of the recording, e.g. mp4/mp3/wav
               "audioConfiguration": {
                   "sampleRate": <number>,       // sample rate for audio recording
                   "bitRate": <number>,          // bitrate for audio recording
                   "channels": <number>          // number of audio channels in output recording
                                     }
                    },
  "participants": [
    {
      "participantId": <string>,    // participant identifier of a participant captured in the recording
      "channel": <number>           // channel the participant was assigned to if the recording is unmixed
    }
  ]
}

法規和隱私權顧慮

許多國家/地區和州都有適用於通話錄音的法律和法規。 PSTN、語音和視訊通話通常要求使用者同意錄製其通訊。 您有責任遵守法律使用通話錄音功能。 貴用戶必須根據適用於各參與者的法律,就錄製通訊取得當事人的同意。

個人資料維護的相關法規要求能夠匯出使用者資料。 為了支援這些需求,錄製元資料檔案會包含 participantId 數位中每個呼叫參與者的 participants 。 您可以交叉參考 participants 陣列中的 Azure 通訊服務使用者身分識別與內部使用者身分識別,以識別通話中的參與者。

下一步

以下是您感興趣的一些文章: