A method and device for generating recording files of capability platform based on AMR-WB coding
By dividing and transcoding AMR-WB encoded voice stream data on the capability platform to generate binaural recording files, the problem of inability to record and large resource usage of AMR-WB encoded voice communication is solved, and efficient voice recording and processing is achieved.
Patent Information
- Application Number
- CN202211065275.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-01
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2042-09-01
AI Technical Summary
The capability platform cannot record audio in AMR-WB coded voice communication, and AMR-WB coded takes up a large amount of system resources, affecting business development.
Obtain the AMR-WB encoded voice stream data of the voice call, divide it into the calling side and the called side voice streams, perform silence compensation and transcoding, generate a recording file in PCMS16LE format, and write it frame by frame in time sequence Import, add a dual-channel header, and synthesize the target dual-channel recording file.
The synchronous recording of AMR-WB coding voice calls has been realized, the occupation of system resources is reduced, the system processing efficiency is improved, and the processing mechanism of the recording link is optimized.
Smart Images

Figure CN115460186B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of communication technology, and specifically relates to a method and device for generating a recording file on a capability platform based on AMR-WB coding. Background Art
[0002] With the development of the fifth generation of communication technology, the application of voice over Internet Protocol (VoIP) technology based on IP is becoming more and more widespread. VoIP voice calls use the Internet Protocol (IP) to achieve voice calls and multimedia conferences, and need to communicate through a capability platform. It has the characteristics of high efficiency and low cost.
[0003] However, due to the early construction of the capability platform, it only supports the basic PCMA encoding mode and cannot support the AMR-WB encoding mode, which makes it impossible to continue the AMR-WB encoded voice communication, let alone record, which seriously affects the development of the platform business. At the same time, the capability platform has high concurrent real-time requirements for voice channels, and the AMR-WB codec is relatively complex and the transcoding occupies and consumes a lot of system resources such as the CPU. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a method and device for generating recording files of a capability platform based on AMR-WB encoding, which can solve the problem in the related art that AMR-WB encoded voice communication of the capability platform cannot be recorded and consumes a large amount of system resources.
[0005] In order to solve the above technical problems, this application is implemented as follows:
[0006] In a first aspect, the present application provides a method for generating a recording file on a capability platform based on AMR-WB encoding, the method comprising:
[0007] Acquire AMR-WB encoded voice stream data of the voice call, and send the voice stream data to the capability platform;
[0008] The capability platform divides the voice stream data into a calling side voice stream and a called side voice stream, marks the calling side voice stream and the called side voice stream and places them on a preset network disk;
[0009] Performing silence compensation on the calling side voice stream and the called side voice stream respectively, and transcoding to generate two first recording files in PCMS16LE format;
[0010] Adding a file header to each of the first recording files according to the sampling rate to generate a second recording file, wherein the second recording file is a pure audio file;
[0011] The two second recording files are written frame by frame in time sequence and a dual-channel header is added to synthesize a target dual-channel recording file.
[0012] Further, the voice stream data is divided into a calling side voice stream and a called side voice stream on the capability platform, and the calling side voice stream and the called side voice stream are marked and placed on a preset network disk, including:
[0013] Dividing the voice stream data into a calling side voice stream and a called side voice stream on the capability platform;
[0014] Divide the calling side voice stream and the called side voice stream into multiple data frames according to a frame data of 20ms;
[0015] Writing the multiple data frames into two RTP audio files respectively;
[0016] The user number information is extracted to add a customer tag to the two RTP audio files, and the customer tag is used as the file name to place the two RTP audio files in a preset network disk, and the capacity of the preset network disk can be flexibly expanded.
[0017] Furthermore, after dividing the calling side voice stream and the called side voice stream into multiple data frames according to a frame of 20 ms, the method further includes:
[0018] Identifying the multiple data frames;
[0019] The method of performing silence compensation on the calling side voice stream and the called side voice stream respectively and transcoding to generate a first recording file in PCMS16LE format is specifically as follows:
[0020] In the case where the data frame is a comfort noise frame, obtaining a duration of the comfort noise frame, and performing PCMS16LE format encoding and padding on the comfort noise frame according to the duration to form a first transcoded frame;
[0021] In the case where the data frame is a voice data frame, decoding the voice data frame into a PCMS16LE format to form a second transcoded frame;
[0022] The first transcoded frame and the second transcoded frame are synthesized into the first recording file.
[0023] Furthermore, after dividing the calling side voice stream and the called side voice stream into multiple data frames with a frame length of 20 ms, the method further includes recording a timestamp of each data frame;
[0024] The step of writing the two second recording files frame by frame in time sequence and adding a dual-channel header to generate a target dual-channel recording file is specifically as follows:
[0025] The two second recording files are written frame by frame according to the timestamp and a dual-channel header is added to synthesize a target dual-channel recording file.
[0026] Furthermore, the step of adding a file header to each of the first recording files according to the sampling rate to generate a second recording file, wherein the second recording file is a pure audio file, is specifically:
[0027] A 44-byte wav file header is added to the first recording file according to the sampling rate to generate a second recording file, and the second recording file is a file in wav format.
[0028] In a second aspect, the present application provides a device for generating a recording file of a capability platform based on AMR-WB encoding, the device comprising:
[0029] A voice stream data acquisition module, used to acquire the AMR-WB encoded voice stream data of the voice call, and send the voice stream data to the capability platform;
[0030] A division marking module, used for dividing the voice stream data into a calling side voice stream and a called side voice stream on the capability platform, marking the calling side voice stream and the called side voice stream and placing them in a preset network disk;
[0031] A transcoding module, used for performing silence compensation on the calling side voice stream and the called side voice stream respectively, and transcoding to generate two first recording files in PCMS16LE format;
[0032] An audio generation module, used for adding a file header to each of the first recording files according to a sampling rate to generate a second recording file, wherein the second recording file is a pure audio file;
[0033] The dual-channel synthesis module is used to write the two second recording files frame by frame in time sequence and add a dual-channel header to synthesize a target dual-channel recording file.
[0034] Furthermore, the division marking module includes:
[0035] A division submodule, used for dividing the voice stream data into a calling side voice stream and a called side voice stream on the capability platform;
[0036] A cutting submodule, used for dividing the calling side voice stream and the called side voice stream into multiple data frames according to a frame data of 20ms;
[0037] An audio writing submodule, used for writing the multiple data frames into two RTP audio files respectively;
[0038] The marking submodule is used to extract the user number information to mark the two RTP audio files with a customer tag, and use the customer tag as the file name to place the two RTP audio files in a preset network disk, and the capacity of the preset network disk can be flexibly expanded.
[0039] Furthermore, the division marking module also includes:
[0040] An identification submodule, used for identifying the multiple data frames;
[0041] The transcoding module comprises:
[0042] A filling submodule, configured to obtain the duration of the comfort noise frame when the data frame is a comfort noise frame, and perform PCMS16LE format encoding and filling on the comfort noise frame according to the duration to form a first transcoded frame;
[0043] A decoding submodule, for decoding the voice data frame into a PCMS16LE format to form a second transcoded frame when the data frame is a voice data frame;
[0044] A synthesis submodule is used to synthesize the first transcoded frame and the second transcoded frame into the first recording file.
[0045] Furthermore, the division marking module also includes:
[0046] The timestamp recording submodule is used to record the timestamp of each of the data frames.
[0047] Furthermore, the audio generation module is specifically used for:
[0048] A 44-byte wav file header is added to the first recording file according to the sampling rate to generate a second recording file, and the second recording file is a file in wav format.
[0049] The capability platform recording file generation method based on AMR-WB encoding provided in the present application, after the capability platform obtains the AMR-WB encoded voice stream data of the voice call, the voice stream data is divided into the calling side voice stream and the called side voice stream, the calling side voice stream and the called side voice stream are marked and placed in the preset network disk; the calling side voice stream and the called side voice stream are respectively silence compensated, and transcoded to generate two first recording files in PCMS16LE format; each of the first recording files is added with a file header according to the sampling rate to generate a second recording file, and the second recording file is a pure audio file; the two second recording files are written frame by frame in time sequence and a dual-channel header is added to synthesize a target dual-channel recording file. The recording file generation scheme proposed in the present application, on the one hand, can realize synchronous recording of AMR-WB encoded VoIP voice calls by transcoding, and on the other hand, by separately processing the voice streams on the calling side and the called side and directly filling the comfort noise frame, it can greatly reduce the occupation of system resources and improve the system processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 This is a flow chart of a method for generating a recording file on a capability platform based on AMR-WB encoding provided in an embodiment of the present application;
[0051] Figure 2 It is a schematic diagram of a method and device for generating a recording file on a capability platform based on AMR-WB encoding provided in an embodiment of the present application.
[0052] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical scheme and advantages of the present invention clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0054] First, the special terms mentioned in the embodiments of the present application are explained.
[0055] PCMA encoding: an audio technology that compresses PCM audio data according to A-law;
[0056] AMR-WB (adaptive multirate wideband) coding: The sampling frequency is 16kHz. It is a wideband speech coding standard adopted by both the International Organization for Standardization ITU-T and 3GPP, also known as the G722.2 standard. AMR-WB provides a speech bandwidth range of 50 to 7000Hz. Users can subjectively feel that the speech is more natural, comfortable and easy to distinguish than before.
[0057] SIP (Session initialization Protocol): a multimedia communication protocol developed by IETF (Internet Engineering Task Force). It is a text-based application layer control protocol used to create, modify and release sessions of one or more participants. SIP is an IP voice session control protocol originating from the Internet. It is flexible, easy to implement and easy to expand.
[0058] RTP (Real-time Transport Protocol) file: used to transmit real-time audio data in the network, it encapsulates various audio data frames. The RTP file in this article refers to the capability platform directly recording and saving the RTP data stream of both parties of the call, without any additional work of stripping frame headers and decoding, which greatly improves the concurrency capability of the front end and reduces CPU consumption.
[0059] Call-id: is a globally unique identifier. The SIP request and response messages in a call are unique.
[0060] Comfort noise: Used to create background noise for telephone communications when there is a brief silence during a call.
[0061] Softswitch: An entity that implements the "call control" function of a traditional program-controlled switch. However, the traditional "call control" function is combined with the business. Different businesses require different call control functions, while softswitch is independent of the business. This requires that the call control function provided by the softswitch is the basic call control for various businesses.
[0062] In conjunction with the accompanying drawings, a method for generating a recording file on a capability platform based on AMR-WB encoding provided by an embodiment of the present application is described in detail below through specific embodiments and application scenarios.
[0063] Embodiment 1
[0064] Reference Figure 1, showing the process of a method for generating a recording file on a capability platform based on AMR-WB encoding provided in an embodiment of the present application.
[0065] The present application provides a method for generating a recording file on a capability platform based on AMR-WB encoding, comprising:
[0066] S101: Acquire AMR-WB encoded voice stream data of a voice call, and send the voice stream data to a capability platform;
[0067] Understandably, in any VoIP call, the caller and the called party will use SIP signaling to negotiate AMR-WB encoding for a two-way voice call based on the service characteristics of both parties and the media processing capabilities of their respective terminals, obtain voice stream data during the call, and send the voice stream data of both parties to the soft switch recording processing module of the capability platform. The capability platform is provided by mobile Internet operators.
[0068] S102: dividing the voice stream data into a calling side voice stream and a called side voice stream on the capability platform, marking the calling side voice stream and the called side voice stream and placing them in a preset network disk;
[0069] The soft switch recording module of the capability platform determines the 0x80 feature value field and the payload type frame type of the RTP audio frame header according to the results of the media negotiation between the calling side and the called side.
[0070] If it is an AMR-WB encoded audio frame, the voice stream data is divided into two files, the calling side voice stream and the called side voice stream. In this way, the calling side voice stream and the called side voice stream can be processed simultaneously in multiple channels during processing, which can improve the processing efficiency of audio data.
[0071] Extract user number information from the FROM and To fields of the SIP signaling, add customer tags to the calling number, called number, and Call-id to form a file name, name the first recording file on the calling side and the first recording file on the called side respectively, and use "amrwb" as the extension. For example, the file on the calling side obtained in the above steps is named "Calling 13xx.amrwb", and the file on the called side is named "Called 15xx.amrwb". In this way, the two RTP audio files can be marked with user tags respectively, which can avoid confusion in the files during subsequent processing and help improve processing efficiency.
[0072] After marking the two RTP audio files with the user information of the calling side and the called side, the audio files need to be placed on the specified network disk path. The network disk path can be a cloud network disk path provided by the capability platform, and the memory of the network disk can be elastically expanded, so that the network disk memory can be elastically increased or decreased according to the size of the audio file, which can not only ensure the stable storage of audio files, but also avoid unreasonable occupation of storage space, thereby improving the utilization of system resources.
[0073] S103: Performing silence compensation on the calling side voice stream and the called side voice stream respectively, and transcoding to generate two first recording files in PCMS16LE format;
[0074] Optionally, after the voice stream data is divided into the calling side voice stream and the called side voice stream, the calling side voice stream and the called side voice stream are respectively divided into multiple data frames according to a certain length, and then the multiple data frames are written into two RTP audio files in chronological order. An optional method is to write the calling side voice stream and the called side voice stream into two RTP audio files respectively at a frame rate of 20ms. Of course, in actual use, other intervals can also be used to cut the data frames, such as cutting the audio data stream at a frame rate of 10ms, 30ms or 50ms. It should be noted that when cutting the audio data stream, it is necessary to cache and record the timestamp of each current frame so that the subsequent synthesis can be performed in the order of the timestamps.
[0075] After the data frame is cut, the type of the data frame can be identified. The back-end AMR-WB recording transcoding service module loads the two RTP recording files of the caller and the called party that have been recorded, and removes the RTP header according to the RTP specification to perform AMR-WB audio processing. Each time an audio frame is processed, the first byte of each frame is read first, or 1 to 4 bytes are taken to determine the current frame type.
[0076] If the frame type is identified as a comfort noise frame, the previous frame timestamp is taken out of the cache and the timestamp of the current frame is used for difference calculation to obtain the silence duration. There is no need to transcode the frame, and the silence duration is directly used for PCMS16LE format encoding and filling, and then written into the uncompressed raw format file in sequence. It can be understood that when a short silence occurs during a call, it is used to generate background noise for telephone communication, which is called comfort noise. After the call voice data stream is divided into the calling side data stream and the called side data stream, in the audio data file of the calling side data stream, there is a comfort noise frame generated when the called side user speaks. After the data frame is cut, when the frame is determined to be a comfort noise frame through the frame header field, the duration of the frame is determined and filled with PCMS16LE format encoding of the same duration; similarly, in the audio data file of the called side data stream, there is a comfort noise frame generated when the calling side user speaks. After the data frame is cut, when the frame is determined to be a comfort noise frame through the frame header field, the duration of the frame is determined and filled with PCMS16LE format encoding of the same duration, and the first transcoded frame is formed after filling. In this way, after identifying the comfort noise frame, the data frame is processed by direct format encoding, which can greatly reduce the occupation of system resources and improve the processing efficiency of audio conversion.
[0077] If the frame type is identified as a voice data frame, the frame length corresponding to the current frame is obtained according to the AMR-WB standard, and then the frame length minus 1 to 4 lengths of data are read (minus 1 to 4 is minus the byte length read to determine the frame type), and a complete AMR-WB frame is obtained. The read AMR-WB frame is input into the decoding module, decoded into PCMS16LE format and written into the PCMS16LE file to form the second transcoded frame.
[0078] After the first transcoded frame and the second transcoded frame are formed, the first transcoded frame and the second transcoded frame are synthesized in the order of the timestamps to respectively synthesize the first recording file of the calling side and the first recording file of the called side.
[0079] S104: adding a file header to each of the first recording files according to the sampling rate to generate a second recording file, where the second recording file is a pure audio file;
[0080] A 44-byte wav file header is added to the first recording file according to the sampling rate to generate a second recording file, wherein the second recording file is a file in wav format.
[0081] Specifically, after transcoding is completed, the first recording file is a file in the PCMS16LE uncompressed format. A 44-byte wav file header can be added to the first recording file according to the sampling rate and other attributes, and the first recording file is converted into a 16k16bit L16-encoded second recording file. The second recording file is a wav file, which is a pure audio file that can be played and processed.
[0082] It can be understood that, since the calling side and the called side both generate their own first recording files, second recording files of the calling side and the called side are generated accordingly after the conversion.
[0083] S105: writing the two second recording files frame by frame in time sequence and adding a dual-channel header to synthesize a target dual-channel recording file.
[0084] The two second recording files are written frame by frame according to the timestamp and a dual-channel header is added to synthesize a target dual-channel recording file.
[0085] SOX (Sound exchange, an audio processing tool) can be used to write the second recording files of the calling side and the called side frame by frame in time sequence according to the voice stream of the calling side and the called side, and add a wav dual-channel header to form a dual-channel file. In this way, the obtained recording file can separate the voice of the calling and called without adding additional workload, and can be used for subsequent direct two-way voice detection and value-added service processing.
[0086] The capability platform recording file generation method based on AMR-WB encoding provided in the present application, after the capability platform obtains the AMR-WB encoded voice stream data of the voice call, the voice stream data is divided into the calling side voice stream and the called side voice stream, the calling side voice stream and the called side voice stream are marked and placed in the preset network disk; the calling side voice stream and the called side voice stream are respectively silence compensated, and transcoded to generate two first recording files in PCMS16LE format; each of the first recording files is added with a file header according to the sampling rate to generate a second recording file, and the second recording file is a pure audio file; the two second recording files are written frame by frame in time sequence and a dual-channel header is added to synthesize a target dual-channel recording file. The recording file generation scheme proposed in the present application, on the one hand, can realize synchronous recording of AMR-WB encoded VoIP voice calls by transcoding, and on the other hand, by separately processing the voice streams on the calling side and the called side and directly filling the comfort noise frame, it can greatly reduce the occupation of system resources and improve the system processing efficiency.
[0087] The recording file generation method provided in the embodiment of the present application greatly reduces the dependence on platform performance, optimizes the processing mechanism of AMR-WB coding comfort noise, simplifies the complexity of transcoding work and improves the processing speed. In addition, the front end of the capability platform records the native RTP voice stream that does not require decoding and processing. The system consumes low consumption and has high speed, which improves the high concurrency of the capability platform; the RTP file recorded by the soft switch at the front end of the capability platform is transmitted to the back-end transcoding processing service module in the form of a network disk, which has the advantages of high reliability and elastic capacity expansion.
[0088] In a second aspect, the present application provides a device 20 for generating a recording file of a capability platform based on AMR-WB encoding, the device comprising:
[0089] The voice stream data acquisition module 201 is used to acquire the AMR-WB encoded voice stream data of the voice call and send the voice stream data to the capability platform;
[0090] A division marking module 202, configured to divide the voice stream data into a calling side voice stream and a called side voice stream on the capability platform, mark the calling side voice stream and the called side voice stream and place them in a preset network disk;
[0091] The transcoding module 203 is used to perform silence compensation on the calling side voice stream and the called side voice stream respectively, and transcode to generate two first recording files in PCMS16LE format;
[0092] The audio generation module 204 is used to add a file header to each of the first recording files according to the sampling rate to generate a second recording file, wherein the second recording file is a pure audio file; specifically, the first recording file is added with a 44-byte wav file header according to the sampling rate to generate the second recording file, wherein the second recording file is a file in wav format;
[0093] The dual-channel synthesis module 205 is used to write the two second recording files frame by frame in time sequence and add a dual-channel header to synthesize a target dual-channel recording file.
[0094] The division marking module 202 includes:
[0095] A division submodule 2021, configured to divide the voice stream data into a calling side voice stream and a called side voice stream on the capability platform;
[0096] The cutting submodule 2022 is used to divide the calling side voice stream and the called side voice stream into multiple data frames according to a frame of 20ms;
[0097] The audio writing submodule 2023 is used to write the multiple data frames into two RTP audio files respectively;
[0098] The marking submodule 2024 is used to extract the user number information to add a customer mark to the two RTP audio files, and use the customer mark as the file name to place the two RTP audio files in a preset network disk. The capacity of the preset network disk can be flexibly expanded.
[0099] An identification submodule 2025, configured to identify the multiple data frames;
[0100] The timestamp recording submodule 2026 is used to record the timestamp of each of the data frames.
[0101] The transcoding module 203 includes:
[0102] The padding submodule 2031 is used for obtaining the duration of the comfort noise frame when the data frame is a comfort noise frame, and performing PCMS16LE format encoding and padding on the comfort noise frame according to the duration to form a first transcoded frame;
[0103] The decoding submodule 2032 is used for decoding the voice data frame into a PCMS16LE format to form a second transcoded frame when the data frame is a voice data frame;
[0104] The synthesis submodule 2033 is used to synthesize the first transcoded frame and the second transcoded frame into the first recording file.
[0105] The capability platform recording file generation device 20 based on AMR-WB encoding provided in the embodiment of the present application can implement the various processes implemented in the above-mentioned capability platform recording file generation method based on AMR-WB encoding embodiment. To avoid repetition, they are not described here.
[0106] The capability platform recording file generation device based on AMR-WB encoding provided in the present application, by setting a voice stream data acquisition module 201, a division marking module 202, a transcoding module 203, an audio generation module 204, and a dual-channel synthesis module 205, after the capability platform obtains the AMR-WB encoded voice stream data of the voice call, the voice stream data is divided into a calling side voice stream and a called side voice stream, and the calling side voice stream and the called side voice stream are marked and placed in a preset network disk; the calling side voice stream and the called side voice stream are respectively silence compensated, and transcoded to generate two first recording files in PCMS16LE format; each of the first recording files is added with a file header according to the sampling rate to generate a second recording file, and the second recording file is a pure audio file; the two second recording files are written frame by frame in a time sequence and a dual-channel header is added to synthesize a target dual-channel recording file. The recording file generation solution proposed in this application can, on the one hand, realize synchronous recording of AMR-WB encoded VoIP voice calls through transcoding, and on the other hand, by separately processing the voice streams on the calling side and the called side and directly filling the comfort noise frame, it can greatly reduce the system resource usage and improve the system processing efficiency.
[0107] The capability platform recording file generation device 20 based on AMR-WB encoding provided in the present application can optimize the processing mechanism of AMR-WB encoding comfort noise in the recording link. The front-end soft switch of the capability platform directly records the native RTP voice stream without decoding processing, which can reduce the platform system resource consumption. The front-end RTP recording and the back-end transcoding service are seamlessly connected through the network disk medium, and have the characteristics of high reliability and high flexibility.
[0108] The virtual device in the embodiment of the present application may be a device, or a component, an integrated circuit, or a chip in a terminal.
[0109] The present invention may be a method, an apparatus, a system and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present invention.
[0110] Computer readable storage medium can be a tangible device that can keep and store instructions used by instruction execution device. Computer readable storage medium can be, for example, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device or any suitable combination thereof. More specific examples (non-exhaustive list) of computer readable storage medium include: portable computer disk, hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disk read-only memory (CD-ROM), digital versatile disk (DVD), memory stick, floppy disk, mechanical encoding device, for example, a punch card or a convex structure in a groove on which instructions are stored, and any suitable combination thereof. Computer readable storage medium used here is not interpreted as instantaneous signal itself, such as radio waves or other free propagating electromagnetic waves, electromagnetic waves propagated by waveguide or other transmission media (for example, light pulses by optical fiber cables), or electrical signals transmitted by wires.
[0111] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0112] The computer program instructions for performing the operation of the present invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present invention.
[0113] Various aspects of the present invention are described herein with reference to the flow charts and / or block diagrams of the methods, devices (systems) and computer program products according to embodiments of the present invention. It should be understood that each box of the flow chart and / or block diagram and the combination of each box in the flow chart and / or block diagram can be implemented by computer-readable program instructions.
[0114] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0115] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0116] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present invention. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0117] Note that, unless otherwise directly stated, all features disclosed in this specification (including any attached claims, abstracts and drawings) may be replaced by alternative features for achieving the same, equivalent or similar purposes. Therefore, unless otherwise explicitly stated, each feature disclosed is only an example of a group of equivalent or similar features. Where used, further, preferably, further and more preferably are simple beginnings for elaborating another embodiment based on the aforementioned embodiment, and the content of the further, preferably, further or more preferably followed by the combination with the aforementioned embodiment constitutes a complete construction of another embodiment. Several further, preferably, further or more preferably settings following the same embodiment can be arbitrarily combined to form another embodiment.
[0118] It should be understood by those skilled in the art that the embodiments of the present invention described above and shown in the accompanying drawings are only examples and do not limit the present invention. The purpose of the present invention has been fully and effectively achieved. The functional and structural principles of the present invention have been demonstrated and explained in the embodiments, and the embodiments of the present invention may be deformed or modified in any way without departing from the principles.
[0119] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present disclosure, rather than to limit them. Although the present disclosure has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present disclosure.
[0120] The above description is only an embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of the claims of the present invention.
Claims
1. A method for generating a recording file of a capability platform based on AMR-WB encoding, characterized in that: The method comprises: Acquire AMR-WB encoded voice stream data of the voice call, and send the voice stream data to the capability platform; The capability platform divides the voice stream data into a calling side voice stream and a called side voice stream, marks the calling side voice stream and the called side voice stream and places them on a preset network disk; Performing silence compensation on the calling side voice stream and the called side voice stream respectively, and transcoding to generate two first recording files in PCMS16LE format; Adding a file header to each of the first recording files according to the sampling rate to generate a second recording file, wherein the second recording file is a pure audio file; The two second recording files are written frame by frame in time sequence and a dual-channel header is added to synthesize a target dual-channel recording file.
2. The method for generating a recording file according to claim 1, characterized in that: The step of dividing the voice stream data into a calling side voice stream and a called side voice stream on the capability platform, marking the calling side voice stream and the called side voice stream and placing them in a preset network disk comprises: Dividing the voice stream data into a calling side voice stream and a called side voice stream on the capability platform; Divide the calling side voice stream and the called side voice stream into multiple data frames according to a frame data of 20ms; Writing the multiple data frames into two RTP audio files respectively; The user number information is extracted to add a customer tag to the two RTP audio files, and the customer tag is used as the file name to place the two RTP audio files in a preset network disk, and the capacity of the preset network disk can be flexibly expanded.
3. The method for generating a recording file according to claim 2, characterized in that: After dividing the calling side voice stream and the called side voice stream into multiple data frames according to a frame data of 20 ms, the method further includes: Identifying the multiple data frames; The method of performing silence compensation on the calling side voice stream and the called side voice stream respectively and transcoding to generate two first recording files in PCMS16LE format is specifically as follows: In the case where the data frame is a comfort noise frame, obtaining a duration of the comfort noise frame, and performing PCMS16LE format encoding and padding on the comfort noise frame according to the duration to form a first transcoded frame; In the case where the data frame is a voice data frame, decoding the voice data frame into a PCMS16LE format to form a second transcoded frame; The first transcoded frame and the second transcoded frame are synthesized into the first recording file.
4. The method for generating a recording file according to claim 2, characterized in that: After dividing the calling side voice stream and the called side voice stream into multiple data frames according to a frame data of 20ms, the method further includes recording a timestamp of each of the data frames; The step of writing the two second recording files frame by frame in time sequence and adding a dual-channel header to generate a target dual-channel recording file is specifically as follows: The two second recording files are written frame by frame according to the timestamp and a dual-channel header is added to synthesize a target dual-channel recording file.
5. The method for generating a recording file according to claim 1, characterized in that: The step of adding a file header to each of the first recording files according to the sampling rate to generate a second recording file, wherein the second recording file is a pure audio file, is specifically: A 44-byte wav file header is added to the first recording file according to the sampling rate to generate a second recording file, and the second recording file is a file in wav format.
6. A device for generating recording files of a capability platform based on AMR-WB coding, characterized in that: The device comprises: A voice stream data acquisition module, used to acquire the AMR-WB encoded voice stream data of the voice call, and send the voice stream data to the capability platform; A division marking module, used for dividing the voice stream data into a calling side voice stream and a called side voice stream on the capability platform, marking the calling side voice stream and the called side voice stream and placing them in a preset network disk; A transcoding module, used for performing silence compensation on the calling side voice stream and the called side voice stream respectively, and transcoding to generate two first recording files in PCMS16LE format; An audio generation module, used for adding a file header to each of the first recording files according to a sampling rate to generate a second recording file, wherein the second recording file is a pure audio file; The dual-channel synthesis module is used to write the two second recording files frame by frame in time sequence and add a dual-channel header to synthesize a target dual-channel recording file.
7. The recording file generating device according to claim 6, characterized in that: The partition marking module comprises: A division submodule, used for dividing the voice stream data into a calling side voice stream and a called side voice stream on the capability platform; A cutting submodule, used for dividing the calling side voice stream and the called side voice stream into multiple data frames according to a frame data of 20ms; An audio writing submodule, used for writing the multiple data frames into two RTP audio files respectively; The marking submodule is used to extract the user number information to mark the two RTP audio files with a customer tag, and use the customer tag as the file name to place the two RTP audio files in a preset network disk, and the capacity of the preset network disk can be flexibly expanded.
8. The recording file generating device according to claim 7, characterized in that: The division marking module also includes: An identification submodule, used for identifying the multiple data frames; The transcoding module comprises: A filling submodule, configured to obtain the duration of the comfort noise frame when the data frame is a comfort noise frame, and perform PCMS16LE format encoding and filling on the comfort noise frame according to the duration to form a first transcoded frame; A decoding submodule, for decoding the voice data frame into a PCMS16LE format to form a second transcoded frame when the data frame is a voice data frame; A synthesis submodule is used to synthesize the first transcoded frame and the second transcoded frame into the first recording file.
9. The recording file generating device according to claim 7, characterized in that: The division marking module also includes: The timestamp recording submodule is used to record the timestamp of each data frame.
10. The recording file generating device according to claim 6, characterized in that: The audio generation module is specifically used for: A 44-byte wav file header is added to the first recording file according to the sampling rate to generate a second recording file, and the second recording file is a file in wav format.
Citation Information
Patent Citations
Call recording method and system
CN110536000A
Communication assistant service implementation method and system and computer storage medium
CN113014728A