Audio data testing method and system, intelligent terminal and storage medium
By determining the target speech encoding type of the audio data and selecting the corresponding decoding function for decoding, the problem that existing technologies can only handle a single encoding format is solved, and the accuracy of testing audio data with multiple encoding formats is realized.
Patent Information
- Application Number
- CN202411893010.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2044-12-20
AI Technical Summary
Existing audio data testing solutions can only handle audio data of one encoding format, which leads to errors in the testing process when faced with audio data of multiple encoding formats, affecting the accuracy of the test.
By acquiring the audio data to be tested, determining its corresponding target speech encoding type, selecting a matching target decoding function from a preset decoding processing function library, decoding the audio data, and finally conducting audio testing to obtain test results.
It ensures the accuracy of audio decoding, avoids errors in the testing process, improves the accuracy of audio data testing, and can handle audio data in multiple encoding formats.
Smart Images

Figure CN119724239B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, and particularly relates to an audio data testing method and system, an intelligent terminal and a storage medium. BACKGROUND
[0002] With the development of science and technology, in order to adapt to the needs of different users or different scenes, the processing methods for various data are becoming more and more rich. For example, the collected audio data needs to be tested to determine whether the function of the audio data acquisition device is perfect, or whether the audio data acquisition device can complete the data acquisition work in the current scene.
[0003] In the related art, an audio data testing scheme is usually set in an audio data testing device, and audio data testing is performed based on the audio data testing device. The problem of the related art is that the audio data testing scheme can only test audio data of one encoding format type in the processing process, for example, only audio data of one encoding format type of subband encoding can be processed. If multiple encoding format types of audio data appear in the processing process, the test process may be wrong, which is not conducive to improving the accuracy of audio data testing.
[0004] Therefore, the related art still needs to be improved and developed. SUMMARY
[0005] The main purpose of the present application is to provide an audio data testing method and system, an intelligent terminal and a storage medium, which aims to solve the technical problem that the audio data testing scheme in the related art can only test audio data of one encoding format type in the processing process, and if multiple encoding format types of audio data appear in the processing process, the test process may be wrong, which is not conducive to improving the accuracy of audio data testing.
[0006] In order to achieve the above purpose, the first aspect of the present application provides an audio data testing method, wherein the audio data testing method comprises:
[0007] obtaining audio data to be tested;
[0008] determining a target speech coding type corresponding to the audio data to be tested from a plurality of preset speech coding types according to the audio data to be tested;
[0009] determining a target decoding function matched with the target speech coding type from a preset decoding processing function library according to the target speech coding type, wherein the preset decoding processing function library comprises a plurality of decoding functions matched one by one with the speech coding types;
[0010] According to the above target decoding function, the above to-be-tested audio data is decoded to obtain decoded audio data;
[0011] The decoded audio data is subjected to audio testing to obtain a test result corresponding to the to-be-tested audio data.
[0012] Optionally, the to-be-tested audio data is obtained by:
[0013] The original encoded audio data transmitted by the audio acquisition device based on Bluetooth communication is obtained, wherein the original encoded audio data is obtained by compressing and preprocessing the original audio data collected by the audio acquisition device, and the preprocessing includes adding a timestamp and / or adding a data frame index.
[0014] According to the preprocessing, the original encoded audio data is restored to obtain the to-be-tested audio data, wherein the restoration includes deleting the timestamp and / or deleting the data frame index.
[0015] Optionally, the target speech coding type corresponding to the to-be-tested audio data is determined from a plurality of preset speech coding types according to the to-be-tested audio data, including:
[0016] According to a preset data frame number, a plurality of target data frames are extracted from the to-be-tested audio data.
[0017] According to a preset number of target bytes per frame, bytes are extracted from the starting position of each target data frame to obtain to-be-compared bytes corresponding to each target data frame.
[0018] According to the to-be-compared bytes corresponding to each target data frame, the target speech coding type corresponding to the to-be-tested audio data is determined from a plurality of preset speech coding types.
[0019] Optionally, the plurality of preset speech coding types include adaptive differential pulse coding, subband coding, and OPUS.
[0020] Optionally, the preset number of target bytes per frame is 4.
[0021] The target speech coding type corresponding to the to-be-tested audio data is determined from a plurality of preset speech coding types according to the to-be-compared bytes, including:
[0022] If only the fourth byte in the to-be-compared bytes corresponding to each target data frame is completely identical, the adaptive differential pulse coding is taken as the target speech coding type.
[0023] If the first three bytes of the to-be-compared bytes corresponding to each of the target data frames are completely identical, the subband coding is taken as the target speech coding type.
[0024] If only the first byte of the to-be-compared bytes corresponding to each of the target data frames is completely identical, the OPUS is taken as the target speech coding type.
[0025] Optionally, the method further comprises:
[0026] If there is no type corresponding to the to-be-tested audio data in the plurality of preset speech coding types, an unknown coding format adaptation prompt information is output.
[0027] Optionally, the audio testing on the decoded audio data and the obtaining of the test result corresponding to the to-be-tested audio data comprise:
[0028] The decoded audio data is input into an audio analyzer to trigger the audio analyzer to perform spectrum analysis and / or distortion detection on the decoded audio data, and the test result corresponding to the to-be-tested audio data returned by the audio analyzer is obtained.
[0029] The second aspect of the application provides an audio data testing system, wherein the audio data testing system comprises:
[0030] A data acquisition module is configured to acquire to-be-tested audio data.
[0031] A coding type determination module is configured to determine, according to the to-be-tested audio data, a target speech coding type corresponding to the to-be-tested audio data from a plurality of preset speech coding types.
[0032] A decoding function determination module is configured to determine, according to the target speech coding type, a target decoding function matched with the target speech coding type from a preset decoding processing function library, wherein the preset decoding processing function library comprises a plurality of decoding functions matched one-to-one with the speech coding types.
[0033] An audio decoding module is configured to perform decoding processing on the to-be-tested audio data according to the target decoding function, and obtain decoded audio data.
[0034] A data testing module is configured to perform audio testing on the decoded audio data and obtain a test result corresponding to the to-be-tested audio data.
[0035] The third aspect of the present application provides an intelligent terminal, the intelligent terminal comprising a memory, a processor, and an audio data testing program stored in the memory and executable on the processor, wherein the audio data testing program implements the steps of any one of the audio data testing methods when executed by the processor.
[0036] The fourth aspect of the present application provides a computer readable storage medium, wherein the computer readable storage medium stores an audio data testing program, and the audio data testing program implements the steps of any one of the audio data testing methods when executed by a processor.
[0037] As can be seen, in the present application, the audio data to be tested is obtained, the target speech coding type corresponding to the audio data to be tested is determined from a plurality of preset speech coding types, the target decoding function matched with the target speech coding type is determined from a preset decoding processing function library according to the target speech coding type, wherein the preset decoding processing function library comprises a plurality of decoding functions matched one-to-one with the speech coding types, the audio data to be tested is decoded according to the target decoding function, and the decoded audio data is obtained, the decoded audio data is subjected to audio testing, and the test result corresponding to the audio data to be tested is obtained.
[0038] Compared with the prior art, in the scheme corresponding to the audio data testing method provided by the present application, the target speech coding type corresponding to the audio data to be tested is determined first, and then the corresponding target decoding function is determined. Specifically, a plurality of decoding functions are provided in the preset decoding processing function library, and a corresponding target decoding function can be selected according to the target speech coding type, so as to complete the audio decoding process and then perform audio testing. In this way, the accuracy of audio decoding is ensured, so as to avoid errors in the testing process and improve the accuracy of audio data testing. BRIEF DESCRIPTION OF DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiments or prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0040] Figure 1 is a flowchart of an audio data testing method provided by an embodiment of the present application;
[0041] Figure 2 is a schematic diagram of the component modules of an audio data testing system provided by an embodiment of the present application;
[0042] Figure 3 is a specific flowchart diagram of an audio data testing method provided by an embodiment of the present application;
[0043] Figure 4 is a specific flowchart diagram of determining a target speech coding type provided by an embodiment of the present application;
[0044] Figure 5 is a component module diagram of another audio data testing system provided by an embodiment of the present application;
[0045] Figure 6 is an internal structure principle block diagram of a smart terminal provided by an embodiment of the present application. DETAILED DESCRIPTION
[0046] In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular sequences of steps, techniques, etc., in order to provide a thorough understanding of the present embodiments. However, it will be apparent to one skilled in the art that the present embodiments can be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known methods, devices, and circuits are omitted so as not to obscure the description of the present embodiments.
[0047] It is to be understood that the terminology “includes,” “has,” “holds,” “contains,” “comprises,” “comprised of,” “comprising,” or variants thereof does not exclude the presence of additional features, integers, steps, operations, elements, and / or groups thereof but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, and / or groups thereof.
[0048] It is also to be understood that the terminology and phraseology used herein is solely used for the purpose of description and not of limitation. As used in this specification and the appended claims, the singular “a,” “an,” and “the” encompass the plural reference unless the context clearly indicates otherwise.
[0049] It is further to be understood that the term “and / or” as used herein encompasses all possible combinations of one or more of the associated listed items and all possible combinations of the items.
[0050] As used in this specification and the appended claims, the term “if’ can be construed to mean “when” or “once” or “in response to determining” or “in response to ascertaining,” depending on the context. Similarly, the phrase “if it is determined” or “if it is ascertained” can be construed to mean “once it is determined” or “in response to the determination” or “once it is ascertained” or “in response to the ascertaining,” depending on the context.
[0051] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings of the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.
[0052] In the following description, a large number of specific details are set forth in order to facilitate a thorough understanding of the present application, but the present application can also be implemented in other manners different from those described herein, and those skilled in the art can make similar generalizations without departing from the spirit and scope of the present application, and therefore the present application is not limited to the specific embodiments disclosed below.
[0053] At present, in order to adapt to the needs of users or different scenarios, the processing methods for various data are becoming more and more rich. For example, the collected audio data needs to be tested to determine whether the function of the audio data acquisition device is perfect, or whether the audio data acquisition device can complete the data acquisition work in the current scenario.
[0054] However, the audio data test scheme can only test audio data of one encoding format type in the processing process. If multiple encoding format types of audio data appear in the processing process, the test process may be wrong, which is not conducive to improving the accuracy of audio data test.
[0055] In a specific application scenario, a user collects and uploads audio data based on a Bluetooth remote controller, so as to perform audio analysis based on an audio analysis device. At present, when the remote controller voice is detected by a Bluetooth remote controller automatic test device, the following problems may exist: a Bluetooth adapter is used for decoding work, which has large performance loss and can usually only adapt to one voice decoding mode; a PC host computer is used for voice decoding work, but cannot customize parameters, cannot be compatible with multiple voice decoding modes, and needs to develop new voice decoding software every time different encoded voice data is encountered.
[0056] In order to solve at least one of the above technical problems, in the present application, the audio data to be tested is obtained; the target voice encoding type corresponding to the audio data to be tested is determined from a plurality of preset voice encoding types according to the audio data to be tested; the target decoding function matched with the target voice encoding type is determined from a preset decoding processing function library according to the target voice encoding type, wherein the preset decoding processing function library includes a plurality of decoding functions matched one by one with the voice encoding types; the audio data to be tested is decoded and processed according to the target decoding function, to obtain decoded audio data; and the decoded audio data is subjected to audio test to obtain a test result corresponding to the audio data to be tested.
[0057] Compared with the prior art, the scheme corresponding to the audio data testing method provided in the application first determines the target speech coding type corresponding to the audio data to be tested, and then determines the corresponding target decoding function. Specifically, a plurality of decoding functions are set in the preset decoding processing function library, and a corresponding target decoding function can be selected according to the target speech coding type, so as to complete the audio decoding process and then perform audio testing. In this way, the accuracy of audio decoding is ensured, so as to avoid errors in the testing process and improve the accuracy of audio data testing.
[0058] As shown in Figure 1 The application embodiment provides an audio data testing method, and specifically, the above method comprises the following steps:
[0059] Step S100, obtaining audio data to be tested.
[0060] The audio data to be tested is data that needs to be tested. The audio data to be tested can be obtained by collection or transmission after being collected by other devices, and is not limited here.
[0061] In the application embodiment, the obtaining of the audio data to be tested comprises:
[0062] Obtaining original encoded audio data transmitted by an audio collection device based on Bluetooth communication, wherein the original encoded audio data is obtained by performing compression and preprocessing operations on collected original audio data by the audio collection device, and the preprocessing operations comprise adding a timestamp and / or adding a data frame index.
[0063] According to the preprocessing operations, the original encoded audio data is restored to obtain the audio data to be tested, wherein the restoration processing comprises deleting the timestamp and / or deleting the data frame index.
[0064] The audio collection device can be a Bluetooth remote controller with audio collection function, or other devices with audio collection function, and is not limited here. It should be noted that in the application embodiment, the audio collection device transmits data based on Bluetooth communication, and in actual application, the audio collection device can also transmit data based on other communication modes, and is not limited here.
[0065] The preprocessing operation includes one or more of adding a timestamp, adding a data frame index, etc. When performing the restoration processing, one or more of deleting a timestamp, deleting a data frame index, etc. can be performed. It should be noted that the specific processing mode corresponding to the restoration processing is determined according to the specific operation corresponding to the preprocessing operation. For example, when the preprocessing operation is performed, the operations of adding a timestamp and adding a data frame index are performed. When the restoration processing is performed, the corresponding operations of deleting a timestamp and deleting a data frame index are performed. When adding a data frame index, a corresponding index is added to each frame of the corresponding audio data, so as to find the corresponding data frame. When adding a timestamp, a timestamp can be added to the corresponding audio data based on a preset audio processing software.
[0066] In step S200, the target speech coding type corresponding to the to-be-tested audio data is determined from the plurality of preset speech coding types according to the to-be-tested audio data.
[0067] In the embodiment of the present application, a plurality of processable speech coding types are preset. The target speech coding type corresponding to the to-be-tested audio data is determined from the plurality of preset speech coding types.
[0068] Specifically, the target speech coding type corresponding to the to-be-tested audio data is determined from the plurality of preset speech coding types according to the to-be-tested audio data, including:
[0069] According to the preset data frame number, a plurality of target data frames are extracted from the to-be-tested audio data;
[0070] According to the preset number of target bytes per frame, bytes are extracted from the starting position of each target data frame to obtain the to-be-compared bytes corresponding to each target data frame;
[0071] The target speech coding type corresponding to the to-be-tested audio data is determined from the plurality of preset speech coding types according to the to-be-compared bytes corresponding to each target data frame.
[0072] Specifically, the plurality of preset speech coding types include adaptive differential pulse code modulation (ADPCM), subband coding (SBC), and OPUS.
[0073] Among them, ADPCM is an audio signal digitization encoding technology. SBC is a signal spectrum-based encoding method, that is, the signal is decomposed into different frequency band components to remove signal correlation, and then the components are sampled, quantized and encoded respectively, so as to obtain a group of independent code words which are combined and transmitted together. OPUS is a lossy sound encoding format that can contain sound and voice in a single format and is suitable for low-latency real-time sound transmission on the network.
[0074] It should be noted that the above three voice encoding types are preset in the embodiment, and other voice encoding types can also be included in actual use, which is not limited here.
[0075] Further, the preset target byte number of each frame is 4; and the target voice encoding type corresponding to the audio data to be tested is determined from the preset plurality of voice encoding types according to the comparison bytes, comprising:
[0076] If only the fourth byte in the comparison bytes corresponding to each target data frame is completely identical, then adaptive differential pulse coding is taken as the target voice encoding type;
[0077] If the first three bytes from the first byte in the comparison bytes corresponding to each target data frame are completely identical, then subband coding is taken as the target voice encoding type;
[0078] If only the first byte in the comparison bytes corresponding to each target data frame is completely identical, then OPUS is taken as the target voice encoding type.
[0079] It should be noted that the above method further comprises:
[0080] If there is no type corresponding to the audio data to be tested in the preset plurality of voice encoding types, then an unknown encoding format adaptation prompt information is output.
[0081] Among them, the preset target byte number of each frame can be pre-set and adjusted according to actual needs, which is preferably 4 in the embodiment of the application, so as to reduce the data processing amount and improve the data processing efficiency on the basis of realizing accurate judgment, but not as a specific limitation.
[0082] Step S300, determining a target decoding function matched with the target voice encoding type from a preset decoding processing function library according to the target voice encoding type, wherein the preset decoding processing function library comprises a plurality of decoding functions matched one by one with the voice encoding types.
[0083] Among them, the decoding function is used for decoding processing of data corresponding to the voice encoding type, so as to obtain decoded audio data.
[0084] It should be noted that, in the embodiment of the present application, the target parameter corresponding to the target coding type is obtained based on the above-mentioned to-be-compared byte and the above-mentioned target speech coding type. The target parameter is a parameter required by the target decoding function in use, and is used to control the processing process of the target decoding function.
[0085] In step S400, the to-be-tested audio data is decoded by using the above-mentioned target decoding function, and decoded audio data is obtained.
[0086] Specifically, in the embodiment, the to-be-tested audio data is decoded by using the above-mentioned target decoding function based on the above-mentioned target parameter, so as to obtain the decoded audio data. In the embodiment of the present application, the decoded audio data is original pulse code modulation (PCM) audio data.
[0087] In step S500, the decoded audio data is subjected to audio testing, and a test result corresponding to the to-be-tested audio data is obtained.
[0088] Specifically, the audio testing of the decoded audio data and the obtaining of the test result corresponding to the to-be-tested audio data include:
[0089] The decoded audio data is input into an audio analyzer, so as to trigger the audio analyzer to perform spectrum analysis and / or distortion detection on the decoded audio data, and obtain the test result corresponding to the to-be-tested audio data returned by the audio analyzer.
[0090] As can be seen from the above, in the audio data testing method provided by the embodiment of the present application, the to-be-tested audio data is obtained; the target speech coding type corresponding to the to-be-tested audio data is determined from a plurality of preset speech coding types according to the to-be-tested audio data; the target decoding function matched with the target speech coding type is determined from a preset decoding processing function library according to the target speech coding type, wherein the preset decoding processing function library includes a plurality of decoding functions matched one by one with the speech coding types; the to-be-tested audio data is decoded by using the target decoding function, and decoded audio data is obtained; and the decoded audio data is subjected to audio testing, and a test result corresponding to the to-be-tested audio data is obtained.
[0091] Compared with the prior art, the scheme corresponding to the audio data test method provided in the application first determines the target speech coding type corresponding to the to-be-tested audio data, and then determines the corresponding target decoding function. Specifically, a plurality of decoding functions are set in the preset decoding processing function library, a corresponding target decoding function can be selected according to the target speech coding type, so as to complete the audio decoding process and then perform audio testing. In this way, the accuracy of audio decoding is ensured, so as to avoid errors in the testing process and improve the accuracy of audio data testing.
[0092] In the embodiments of the application, the audio data test method is also described in detail based on a specific application scenario. Specifically, the audio data test method is applied to an audio data test system, Figure 2 is a component module schematic diagram of an audio data test system provided in the embodiments of the application, as Figure 2 shown, the audio data test system includes a Bluetooth remote controller and a Bluetooth remote controller automatic detection device (i.e., an audio test device), and the Bluetooth remote controller automatic detection device includes a PC host computer, a Bluetooth adapter and an audio analyzer (i.e., an audio analysis device). The PC host computer is used for data communication and data processing between the Bluetooth adapter and the audio analyzer connected with the PC. In one application scenario, the software configured in the PC host computer includes QT6.8.0 or above, and gcc-arm-none-eabi-10-2020-q4-major-win32 or above.
[0093] Specifically, the PC host computer is connected with the Bluetooth adapter, and the two parties communicate through the universal serial bus (USB, Universal Serial Bus) to serial port protocol. The PC host computer is also connected with the audio analyzer, and the two parties communicate through the USB protocol. The Bluetooth remote controller is connected with the Bluetooth adapter, and the two parties communicate through the Bluetooth low power consumption (BLE, Bluetooth Low Energy) protocol. The Bluetooth remote controller is used for audio data acquisition, preprocessing and uploading.
[0094] In the embodiment of the present application, the PC host computer is adapted to three common remote controller voice encoding modes: ADPCM, SBC and OPUS (actual versions: ADPCM-IMA, SBC1.4 and OPUS1.2.1). Specifically, the PC host computer is a window executable program developed based on QT6.8.0 version, mainly including a serial communication component and an audio decoding component. The three voice encoding modes are implemented based on C language and rely on the compilation tool gcc (the actual version used is gcc-arm-none-eabi-10-2020-q4-major). The source files of the three voice encoding modes are copied to the source file directory of the PC host computer. The include path is set, and the header file containing the decoding interface is added to the main program code.
[0095] In addition to adapting voice encoding, in the embodiment of the present application, a parameter-adjustable decoder is also configured in the PC host computer, which decodes audio data based on a decoding function. Specifically, for the three voice encoding types, three decoding functions are configured.
[0096] For the ADPCM mode, the decoding function used is: void adpcm_decode(ADPCM_STATE_ts*state, unsigned char*input, int numSamples, short*output). If it is desired to decode any voice data compressed by ADPCM encoding, only the numSamples (number of samples) needs to be adjusted to adapt to the data frame format generated by ADPCM encoding, as shown in Table 1.
[0097] Table 1
[0098] Member Length Description PREDICT 2 bytes Low byte first, algorithm parameter PREDICT IDX 1 byte Step table index, algorithm parameter LENGTH 1 byte Number of bytes of ADPCMDATA ADPCMDATA LENGTH ADPCM data
[0099] For the SBC mode, the decoding functions used are: int sbc_init(sbc_t*sbc, unsigned long flags) and ssize_t sbc_decode(sbc_t*sbc, const void*input, size_t input_len, void*output, size_t output_len, size_t*written). If it is desired to decode any voice data compressed by SBC encoding, the parameters in the structure sbc_t*sbc in the initialization function sbc_init() need to be modified, including the parameters shown in Table 2.
[0100] Table 2
[0101]
[0102] Further, the SBC finally encoded generated data frame format is shown in Table 3.
[0103] Table 3
[0104]
[0105]
[0106] Further, in the embodiment of the application, for the OPUS mode, the corresponding decoding function used is: intopus_decoder_init(OpusDecoder*st,opus_int32Fs,intchannels) and intopus_decode(OpusDecoder*st,const unsigned char*data,opus_int32len,opus_int16*pcm,intframe_size,intdecode_fec). If it is desired to decode any voice data compressed by OPUS, it is necessary to modify all parameters in the initialization functionopus_decoder_init(), including the parameters shown in Table 4.
[0107] Table 4
[0108]
[0109] The OPUS finally encoded generated data frame format is shown in Table 5.
[0110] Table 5
[0111]
[0112] Figure 3 is a specific flowchart of an audio data testing method provided by the embodiment of the application, as shown in Figure 3 The Bluetooth remote controller is connected with the Bluetooth adapter and paired, the PC host sends a command to the Bluetooth adapter to enable the Bluetooth remote controller, specifically, the notify attribute of the Bluetooth remote controller is enabled, so that the Bluetooth remote controller uploads after collecting audio. The Bluetooth remote controller sends audio data, the Bluetooth adapter receives the audio data and transmits it to the PC host.
[0113] It should be noted that if the remote control has processed the encoded compressed audio data, such as adding header and trailer, increasing time identifier, etc., the dongle needs to reverse process the received audio data before inputting the original encoded compressed audio data to the host computer, such as deleting the header and trailer, restoring the time identifier, etc. If the remote control has not processed the encoded compressed audio data, the dongle can directly input the received data to the host computer.
[0114] After the host computer receives the encoded audio data, it automatically identifies the corresponding type of speech coding, Figure 4 is a specific flowchart provided by the embodiment of the application for determining the target speech coding type. As shown in Figure 4 The host computer first stores all the acquired audio data (which can be the encoded audio data received from the dongle) in a cache queue. The first four bytes of 5 frames of data are extracted from the start of the queue in turn for mutual comparison, and the similarities and differences of the four bytes of the 5 frames of data are determined. There are four specific cases.
[0115] First, only the fourth byte of the 5 frames of data is the same, and it is determined that the current coding mode is ADPCM. According to Table 1, the parameter represented by the fourth byte is the length of the encoded data, and the compression ratio of ADPCM is 1:4. Therefore, the length of the encoded data multiplied by 4 can obtain numSamples (the number of samples), which is the parameter required for the ADPCM format (i.e., the target parameter). The host computer records the parameter as parameter A.
[0116] Second, the first three bytes of the 5 frames of data are the same, and it is determined that the current coding mode is SBC. According to Table 3, the parameters represented by the second and third bytes are the parameters required for the SBC format (i.e., the target parameter), and the host computer records the parameter as parameter B.
[0117] Third, only the first byte of the 5 frames of data is the same, and it is determined that the current coding mode is OPUS. According to Table 5, the parameter represented by the first byte is the parameter required for the OPUS format (i.e., the target parameter), and the host computer records the parameter as parameter C.
[0118] Fourth, none of the above three cases is satisfied, and it is determined that it is not the three preset coding modes, and it is prompted that the unknown coding format needs to be adapted.
[0119] Finally, the host computer processes the received original encoded compressed audio data through the decoding function corresponding to the parameter, and outputs the original PCM audio data (i.e., the decoded audio data), which is then input to the audio analyzer for frequency spectrum analysis, distortion detection, etc. After the analysis is completed, the audio analyzer returns the test results to the PC host computer, and the audio test is ended.
[0120] In a specific application scenario, a Bluetooth remote controller A uses SBC encoding for voice data compression, and now the Bluetooth remote controller audio test equipment is used for testing.
[0121] Firstly, the remote controller is paired with the Bluetooth adapter.
[0122] Secondly, the start test button is clicked, then the voice button of the remote controller is pressed and the test audio is played, at this time the host computer continuously receives the compressed audio data.
[0123] Thirdly, after the test audio is played, the voice button of the remote controller is released, and the audio receiving is waited.
[0124] Fourthly, the host computer automatically judges the audio encoding format and synchronously decodes, and the original data obtained by decoding is input into the audio analyzer.
[0125] Fifthly, the audio analyzer returns the test result, and the test is completed.
[0126] Then another Bluetooth remote controller B using OPUS encoding needs to be tested, at this time the above operations are repeated, without the need to switch software or hardware.
[0127] In this way, in the presence of multiple voice encoding types of audio data, different devices do not need to be switched for data processing, and accurate processing and testing of audio data of different voice encoding types can be realized, which simplifies the audio test preparation work of remote controllers using different voice encodings, improves the test efficiency, and reduces the learning threshold.
[0128] Specifically, the audio data test method provided by the embodiment of the application is compatible with multiple voice encoding modes for Bluetooth remote controller audio test scenarios, realizes decoding of multiple voice encoding modes, and can dynamically adjust target parameters in the decoding process according to actual data requirements. The Bluetooth adapter is connected to the remote controller, and the compressed voice data is transmitted from the adapter to the PC host computer. Three voice decoding libraries are adapted in the PC host computer and can be customized, which enhances the compatibility of the Bluetooth voice detection of the device and reduces the time required for switching the decoding mode, and also improves the processing accuracy when processing data of different voice encoding types.
[0129] As shown in Figure 5 Corresponding to the above-mentioned audio data test method, the embodiment of the application further provides an audio data test system, which comprises:
[0130] The data acquisition module 510 is configured to acquire the audio data to be tested.
[0131] The coding type determination module 520 is configured to determine a target speech coding type corresponding to the audio data to be tested from a plurality of preset speech coding types according to the audio data to be tested.
[0132] The decoding function determination module 530 is configured to determine a target decoding function matched with the target speech coding type from a preset decoding processing function library according to the target speech coding type, wherein the preset decoding processing function library comprises a plurality of decoding functions matched with the speech coding types one by one.
[0133] The audio decoding module 540 is configured to perform decoding processing on the audio data to be tested according to the target decoding function to obtain decoded audio data.
[0134] The data testing module 550 is configured to perform audio testing on the decoded audio data and obtain a testing result corresponding to the audio data to be tested.
[0135] In this way, the target speech coding type corresponding to the audio data to be tested is determined first, and then the target decoding function is determined. Specifically, a plurality of decoding functions are set in the preset decoding processing function library, and a target decoding function corresponding to the target speech coding type can be selected, so that the audio decoding process is completed, and then the audio testing is performed. In this way, the accuracy of audio decoding is ensured, so that the testing process is prevented from being wrong, and the accuracy of audio data testing is improved.
[0136] It should be noted that the specific structure and implementation manner of the audio data testing system and each module or unit thereof can refer to the corresponding description in the above method embodiments, which will not be described here.
[0137] It should be noted that the division manner of each module of the audio data testing system is not unique, and will not be specifically limited here.
[0138] Based on the above embodiments, the present application further provides an intelligent terminal, and a principle block diagram thereof can be as shown in Figure 6 The intelligent terminal comprises a processor, a memory, a network interface and a display screen connected through a system bus. The processor of the intelligent terminal is configured to provide calculation and control capabilities. The memory of the intelligent terminal comprises a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and an audio data testing program. The internal memory provides an environment for the operating system and the audio data testing program in the non-volatile storage medium. The network interface of the intelligent terminal is configured to communicate with an external terminal through a network connection. The audio data testing program is executed by the processor to implement the steps of any one of the above audio data testing methods. The display screen of the intelligent terminal can be a liquid crystal display screen or an electronic ink display screen.
[0139] Those skilled in the art can understand that Figure 6 The principle block diagram shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the intelligent terminal to which the scheme of the present application is applied. The specific intelligent terminal can include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.
[0140] In an embodiment, an intelligent terminal is provided, which includes a memory, a processor, and an audio data testing program stored in the memory and executable on the processor. The audio data testing program, when executed by the processor, implements the steps of any of the audio data testing methods provided in the embodiments of the present application.
[0141] The embodiments of the present application also provide a computer readable storage medium, which stores an audio data testing program. The audio data testing program, when executed by a processor, implements the steps of any of the audio data testing methods provided in the embodiments of the present application.
[0142] It should be understood that the sequence numbers of the steps in the above embodiments do not mean the execution sequence, and the execution sequence of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0143] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional units and modules is taken as an example for illustration. In actual application, the above functions can be completed by different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiments can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit. In addition, the specific names of each functional unit and module are only for easy distinction, and do not limit the protection scope of the present application. The specific working process of the units and modules in the device can refer to the corresponding process in the foregoing method embodiments, which will not be repeated here.
[0144] In the above embodiments, the description of each embodiment has its own emphasis, and the parts not described or recorded in detail in a certain embodiment can be referred to the related description of other embodiments.
[0145] Those skilled in the art can understand that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized in electronic hardware or a combination of computer software and electronic hardware. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different ways to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0146] In the embodiments provided in the present application, it should be understood that the disclosed system / terminal device and method can be implemented in other ways. For example, the above-described system / terminal device embodiments are only schematic, for example, the division of the above modules or units is only a logical function division, and an actual implementation can be different, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0147] The integrated modules / units described above, if realized in the form of software function units and sold or used as independent products, can be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the above-described embodiment methods can also be completed by computer programs instructing related hardware, and the above computer programs can be stored in a computer readable storage medium. The computer programs are executed by the processor, and the steps of the above various method embodiments can be implemented. The computer programs include computer program codes, which can be in the form of source code, object code, executable files or some intermediate forms. The computer readable medium can include any entity or device capable of carrying the above computer program codes, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, electrical signal and software distribution medium, etc. It should be noted that the computer readable storage medium contains content which can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction.
[0148] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand; it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements, which do not deviate from the spirit and scope of the technical solutions of the present application, should be included in the protection scope of the present application.
Claims
1. An audio data testing method, characterized by, The method comprises: acquiring to-be-tested audio data; determining a target speech coding type corresponding to the to-be-tested audio data from a plurality of preset speech coding types according to the to-be-tested audio data, wherein the plurality of preset speech coding types comprise adaptive differential pulse coding, subband coding and OPUS; determining a target decoding function matched with the target speech coding type from a preset decoding processing function library according to the target speech coding type, wherein the preset decoding processing function library comprises a plurality of decoding functions matched one-to-one with the speech coding types; performing decoding processing on the to-be-tested audio data according to the target decoding function to obtain decoded audio data; performing audio testing on the decoded audio data and obtaining a test result corresponding to the to-be-tested audio data; the determining of the target speech coding type corresponding to the to-be-tested audio data from the plurality of preset speech coding types according to the to-be-tested audio data comprises: extracting a plurality of target data frames from the to-be-tested audio data according to a preset data frame number; extracting bytes from a starting position of each target data frame according to a preset number of target bytes per frame to obtain to-be-compared bytes corresponding to each target data frame, wherein the preset number of target bytes per frame is 4; if only the fourth byte in the to-be-compared bytes corresponding to each target data frame is completely same, then adaptive differential pulse coding is taken as the target speech coding type; if the first three bytes from the first byte in the to-be-compared bytes corresponding to each target data frame are completely same, then subband coding is taken as the target speech coding type; if only the first byte in the to-be-compared bytes corresponding to each target data frame is completely same, then OPUS is taken as the target speech coding type.
2. The audio data testing method of claim 1, wherein, the acquiring of the to-be-tested audio data comprises: acquiring original encoded audio data transmitted based on Bluetooth communication by an audio acquisition device, wherein the original encoded audio data is obtained after original audio data collected by the audio acquisition device is compressed and preprocessed, and the preprocessing operation comprises adding a timestamp and / or adding a data frame index; performing restoration processing on the original encoded audio data according to the preprocessing operation to obtain the to-be-tested audio data, wherein the restoration processing comprises deleting the timestamp and / or deleting the data frame index.
3. The audio data testing method of claim 1, wherein, The method further comprises: if there is no type corresponding to the to-be-tested audio data in the plurality of preset speech coding types, then outputting an unknown coding format adaptation prompt information.
4. The audio data testing method according to any one of claims 1 to 3, characterized in that, the performing of audio testing on the decoded audio data and the obtaining of a test result corresponding to the to-be-tested audio data comprises: inputting the decoded audio data into an audio analyzer to trigger the audio analyzer to perform spectrum analysis and / or distortion detection on the decoded audio data, and obtaining a test result corresponding to the to-be-tested audio data returned by the audio analyzer.
5. An audio data test system, characterized by The system comprises: a data acquisition module configured to acquire to-be-tested audio data; The encoding type determining module is configured to determine a target speech encoding type corresponding to the audio data to be tested from a plurality of preset speech encoding types according to the audio data to be tested, wherein the plurality of preset speech encoding types include adaptive differential pulse coding, sub-band coding and OPUS. The decoding function determining module is configured to determine a target decoding function matched with the target speech encoding type from a preset decoding processing function library according to the target speech encoding type, wherein the preset decoding processing function library includes a plurality of decoding functions matched one-to-one with the speech encoding types. The audio decoding module is configured to perform decoding processing on the audio data to be tested according to the target decoding function to obtain decoded audio data. The data testing module is configured to perform audio testing on the decoded audio data and obtain a test result corresponding to the audio data to be tested. The encoding type determining module is specifically configured to extract a plurality of target data frames from the audio data to be tested according to a preset data frame number. The target data frames are extracted according to a preset target byte number per frame, and a comparison byte corresponding to each target data frame is obtained by byte extraction from a starting position of each target data frame, wherein the preset target byte number per frame is 4. If only the fourth byte in the comparison byte corresponding to each target data frame is completely identical, adaptive differential pulse coding is taken as the target speech encoding type; if the first three bytes from the first byte in the comparison byte corresponding to each target data frame are completely identical, sub-band coding is taken as the target speech encoding type; and if only the first byte in the comparison byte corresponding to each target data frame is completely identical, OPUS is taken as the target speech encoding type.
6. A smart terminal, characterized by The intelligent terminal includes a memory, a processor, and an audio data testing program stored in the memory and executable on the processor, and the audio data testing program, when executed by the processor, implements the steps of the audio data testing method of any one of claims 1 to 4.
7. A computer readable storage medium characterized in that, The computer readable storage medium stores an audio data testing program, and the audio data testing program, when executed by the processor, implements the steps of the audio data testing method of any one of claims 1 to 4.
Citation Information
Patent Citations
Audio encoding and decoding method and device, medium and electronic equipment
CN115831132A
Audio coding method and device, storage medium and computer equipment
CN116580716A