Audio data test method and system, intelligent terminal and storage medium
By determining the target encoding type of audio data and selecting the corresponding decoding function for decoding processing, the problem that only one type of audio data in the prior art can be processed, and accurate testing of data of multiple types of encoding formats is achieved.
Patent Information
- Application Number
- CN202411893010.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-12-20
AI Technical Summary
Existing audio data testing schemes can only process audio data in one encoding format type. If multiple encoding format types are encountered, it may cause errors in the testing process and affect the accuracy of the test.
By obtaining the audio data to be tested, determining its target voice encoding type, and selecting a matching decoding function from the preset decoding processing function library, decoding the audio data, obtaining the decoded audio data, and then performing audio tests to obtain the test results.
This method can ensure the accuracy of audio decoding, avoid errors in the testing process, thereby improving the accuracy of audio data testing, and can process audio data in multiple encoding format types.
Smart Images

Figure CN119724239A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to an audio data testing method, system, intelligent terminal and storage medium. Background Art
[0002] With the development of science and technology, in order to meet the needs of different users or different scenarios, the processing methods for various data are becoming more and more diverse. For example, it is necessary to test the collected audio data to determine whether the function of the audio data collection device is intact, or to determine whether the audio data collection device can complete the data collection work in the current scenario.
[0003] In the related art, an audio data test scheme is usually set in an audio data test device, and audio data testing is performed based on the audio data test device. The problem with the related art is that the audio data test scheme can only test audio data of one coding format type during the processing process, for example, it can only process audio data of one coding format type, which is sub-band coding. If audio data of multiple coding formats appear during the processing process, it may cause errors in the test process, which is not conducive to improving the accuracy of audio data testing.
[0004] Therefore, relevant technologies still need to be improved and developed. Summary of the invention
[0005] The main purpose of the present application is to provide an audio data testing method, system, intelligent terminal and storage medium, aiming to solve the technical problem that the audio data testing scheme in the related technology can only test audio data of one encoding format type during the processing process. If audio data of multiple encoding format types appear during the processing process, it may cause errors in the testing process, which is not conducive to improving the accuracy of audio data testing.
[0006] In order to achieve the above object, the first aspect of the present application provides an audio data testing method, wherein the audio data testing method comprises:
[0007] Get the audio data to be tested;
[0008] According to the audio data to be tested, determining a target speech coding type corresponding to the audio data to be tested from a plurality of preset speech coding types;
[0009] According to the target speech coding type, determining a target decoding function matching the target speech coding type from a preset decoding processing function library, wherein the preset decoding processing function library includes a plurality of decoding functions matching the speech coding types one by one;
[0010] Decoding the audio data to be tested according to the target decoding function to obtain decoded audio data;
[0011] An audio test is performed on the decoded audio data and a test result corresponding to the audio data to be tested is obtained.
[0012] Optionally, the above-mentioned obtaining the audio data to be tested includes:
[0013] Acquire original encoded audio data transmitted by the audio acquisition device based on Bluetooth communication, wherein the original encoded audio data is obtained after the audio acquisition device compresses and preprocesses the collected original audio data, and the preprocessing operation includes adding a timestamp and / or adding a data frame index;
[0014] According to the above preprocessing operation, the above original encoded audio data is restored to obtain the above audio data to be tested, wherein the above restoration process includes deleting the timestamp and / or deleting the data frame index.
[0015] Optionally, the step of determining the 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 includes:
[0016] Extracting a plurality of target data frames from the audio data to be tested according to a preset number of data frames;
[0017] According to the preset target number of bytes per frame, bytes are extracted from the starting position of each of the target data frames to obtain the bytes to be compared corresponding to each of the target data frames;
[0018] According to the bytes to be compared corresponding to each of the target data frames, a target speech coding type corresponding to the audio data to be tested is determined from a plurality of preset speech coding types.
[0019] Optionally, the above-mentioned preset multiple speech coding types include adaptive differential pulse coding, subband coding and OPUS.
[0020] Optionally, the preset target number of bytes per frame is 4;
[0021] The above-mentioned determining the target speech coding type corresponding to the above-mentioned audio data to be tested from a plurality of preset speech coding types according to the above-mentioned bytes to be compared includes:
[0022] If only the fourth byte of the bytes to be compared corresponding to the target data frames are completely identical, adaptive differential pulse coding is used as the target speech coding type;
[0023] If the first three bytes from the first byte of the bytes to be compared corresponding to the target data frames are exactly the same, sub-band coding is used as the target speech coding type;
[0024] If, among the bytes to be compared corresponding to the above target data frames, only the first byte is completely identical, OPUS is used as the above target speech coding type.
[0025] Optionally, the above method further includes:
[0026] If the preset multiple voice coding types do not include a type corresponding to the audio data to be tested, then unknown coding format adaptation prompt information is output.
[0027] Optionally, the step of performing an audio test on the decoded audio data and obtaining a test result corresponding to the audio data to be tested includes:
[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 obtain a test result corresponding to the audio data to be tested returned by the audio analyzer.
[0029] A second aspect of the present application provides an audio data testing system, wherein the audio data testing system comprises:
[0030] A data acquisition module, used to acquire audio data to be tested;
[0031] A coding type determination module, used 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;
[0032] A decoding function determination module, used to determine a target decoding function matching 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 includes a plurality of decoding functions matching the speech coding types one by one;
[0033] An audio decoding module, used for decoding the audio data to be tested according to the target decoding function to obtain decoded audio data;
[0034] The data testing module is used to perform an audio test on the decoded audio data and obtain a test result corresponding to the audio data to be tested.
[0035] The third aspect of the present application provides a smart terminal, which includes a memory, a processor, and an audio data test program stored in the memory and executable on the processor. When the audio data test program is executed by the processor, any step of the audio data test method is implemented.
[0036] A fourth aspect of the present application provides a computer-readable storage medium, on which an audio data testing program is stored. When the audio data testing program is executed by a processor, any step of the audio data testing method is implemented.
[0037] As can be seen from the above, in the present application scheme, audio data to be tested is obtained; based on the above audio data to be tested, a target voice coding type corresponding to the above audio data to be tested is determined from a plurality of preset voice coding types; based on the above target voice coding type, a target decoding function matching the above target voice coding type is determined from a preset decoding processing function library, wherein the above preset decoding processing function library includes a plurality of decoding functions that match the above voice coding types one by one; the above audio data to be tested is decoded according to the above target decoding function to obtain decoded audio data; an audio test is performed on the above decoded audio data and a test result corresponding to the above 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 first determined, 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, thereby completing the audio decoding process and then performing the audio test. In this way, the accuracy of the audio decoding is ensured, thereby avoiding errors in the test process, which is conducive to improving the accuracy of the audio data test. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0040] Figure 1 It is a flowchart of an audio data testing method provided in an embodiment of the present application;
[0041] Figure 2 It is a schematic diagram of the components of an audio data testing system provided by an embodiment of the present application;
[0042] Figure 3 It is a specific flow chart of an audio data testing method provided in an embodiment of the present application;
[0043] Figure 4 This is a schematic diagram of a specific process for determining a target speech coding type provided by an embodiment of the present application;
[0044] Figure 5 It is a schematic diagram of component modules of another audio data testing system provided in an embodiment of the present application;
[0045] Figure 6 It is a block diagram of the internal structure principle of a smart terminal provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0047] It should be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.
[0048] It should also be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, the singular forms "a", "an" and "the" are intended to include plural forms unless the context clearly indicates otherwise.
[0049] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0050] As used in this specification and the appended claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to being classified into," depending on the context. Similarly, the phrase "if it is determined" or "if classified into [described condition or event]" may be interpreted as meaning "upon determination" or "in response to determining" or "upon classification into [described condition or event]" or "in response to being classified into [described condition or event]," depending on the context.
[0051] The following is a clear and complete description of the technical solutions in the embodiments of the present application in conjunction with the drawings of the embodiments of the present application. Obviously, the described embodiments are only 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.
[0052] In the following description, many specific details are set forth to facilitate a full understanding of the present application, but the present application may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present application. Therefore, the present application is not limited to the specific embodiments disclosed below.
[0053] At present, in order to meet the needs of users or different scenarios, various data processing methods are becoming more and more diverse. For example, the collected audio data needs to be tested to determine whether the function of the audio data collection device is intact, or to determine whether the audio data collection device can complete the data collection work in the current scenario.
[0054] However, the audio data testing solution can only test audio data of one encoding format type during the processing process. If audio data of multiple encoding formats appear during the processing, it may cause errors in the testing process, which is not conducive to improving the accuracy of audio data testing.
[0055] In a specific application scenario, users collect and upload audio data based on a Bluetooth remote control, and then perform audio analysis based on an audio analysis device. Currently, when detecting the voice of a remote control based on an automated test device for a Bluetooth remote control, there may be the following problems: using a Bluetooth adapter for decoding, which results in high performance loss and can usually only adapt to one voice decoding method; using a PC host computer for voice decoding, but it is impossible to customize the adjustment parameters and is not compatible with multiple voice decoding methods. New voice decoding software needs to be redeveloped every time different encoded voice data is encountered.
[0056] In order to solve at least one of the above-mentioned technical problems, in the solution of the present application, audio data to be tested is obtained; based on the above-mentioned audio data to be tested, a target voice coding type corresponding to the above-mentioned audio data to be tested is determined from a plurality of preset voice coding types; based on the above-mentioned target voice coding type, a target decoding function matching the above-mentioned target voice coding type is determined from a preset decoding processing function library, wherein the above-mentioned preset decoding processing function library includes a plurality of decoding functions that match the above-mentioned voice coding types one by one; the above-mentioned audio data to be tested is decoded and processed according to the above-mentioned target decoding function to obtain decoded audio data; an audio test is performed on the above-mentioned decoded audio data and a test result corresponding to the above-mentioned audio data to be tested is obtained.
[0057] 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 first determined, 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, thereby completing the audio decoding process and then performing the audio test. In this way, the accuracy of the audio decoding is ensured, thereby avoiding errors in the test process, which is conducive to improving the accuracy of the audio data test.
[0058] like Figure 1 As shown, the embodiment of the present application provides an audio data testing method. Specifically, the method includes 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 collected, or collected by other equipment and then transmitted, which is not specifically limited here.
[0061] In the embodiment of the present application, the above-mentioned obtaining of the audio data to be tested includes:
[0062] Acquire original encoded audio data transmitted by the audio acquisition device based on Bluetooth communication, wherein the original encoded audio data is obtained after the audio acquisition device compresses and preprocesses the collected original audio data, and the preprocessing operation includes adding a timestamp and / or adding a data frame index;
[0063] According to the above preprocessing operation, the above original encoded audio data is restored to obtain the above audio data to be tested, wherein the above restoration process includes deleting the timestamp and / or deleting the data frame index.
[0064] The audio acquisition device may be a Bluetooth remote controller with an audio acquisition function, or other devices with an audio acquisition function, which are not specifically limited here. It should be noted that in the embodiment of the present application, the audio acquisition device performs data transmission based on Bluetooth communication. In actual application, the audio acquisition device may also perform data transmission based on other communication methods, which are not specifically limited here.
[0065] The above-mentioned preprocessing operations include one or more operations such as adding a timestamp and adding a data frame index. When performing the restoration process, one or more operations such as deleting the timestamp and deleting the data frame index can be performed. It should be noted that the specific processing method corresponding to the restoration process is determined according to the specific operation corresponding to the preprocessing operation. For example, if the operations of adding a timestamp and adding a data frame index are performed during the preprocessing operation, the corresponding deletion of the timestamp and the deletion of the data frame index are performed during the restoration process. Among them, 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 the preset audio processing software.
[0066] Step S200: 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.
[0067] In the embodiment of the present application, a plurality of speech coding types that can be processed are pre-set, and for the audio data to be tested, a target speech coding type corresponding to the test audio data is determined from the pre-set plurality of speech coding types.
[0068] Specifically, the above-mentioned determining the target speech coding type corresponding to the above-mentioned audio data to be tested from a plurality of preset speech coding types according to the above-mentioned audio data to be tested includes:
[0069] Extracting a plurality of target data frames from the audio data to be tested according to a preset number of data frames;
[0070] According to the preset target number of bytes per frame, bytes are extracted from the starting position of each of the target data frames to obtain the bytes to be compared corresponding to each of the target data frames;
[0071] According to the bytes to be compared corresponding to each of the target data frames, a target speech coding type corresponding to the audio data to be tested is determined from a plurality of preset speech coding types.
[0072] Specifically, the above-mentioned preset multiple speech coding types include adaptive differential pulse code modulation (ADPCM), subband coding (SBC) and OPUS.
[0073] Among them, ADPCM is a digital coding technology for audio signals. SBC is a coding method based on signal spectrum, which decomposes the signal into components of different frequency bands to remove signal correlation, and then samples, quantizes, and encodes the components separately to obtain a set of unrelated codewords that are combined together for transmission. OPUS is a lossy sound coding format that can contain sound and voice in a single format and is suitable for low-latency instant sound transmission on the network.
[0074] It should be noted that the above three speech coding types are preset in this embodiment. In actual use, other speech coding types may also be included, which are not specifically limited here.
[0075] Further, the preset target number of bytes per frame is 4; the target speech coding type corresponding to the audio data to be tested is determined from a plurality of preset speech coding types according to the bytes to be compared, including:
[0076] If only the fourth byte of the bytes to be compared corresponding to the target data frames are completely identical, adaptive differential pulse coding is used as the target speech coding type;
[0077] If the first three bytes from the first byte of the bytes to be compared corresponding to the target data frames are exactly the same, sub-band coding is used as the target speech coding type;
[0078] If, among the bytes to be compared corresponding to the above target data frames, only the first byte is completely identical, OPUS is used as the above target speech coding type.
[0079] It should be noted that the above method also includes:
[0080] If the preset multiple voice coding types do not include a type corresponding to the audio data to be tested, then unknown coding format adaptation prompt information is output.
[0081] Among them, the above-mentioned preset target number of bytes per frame can be pre-set and adjusted according to actual needs. In the embodiment of the present application, it is preferably 4, so as to reduce the data processing volume and improve data processing efficiency on the basis of achieving accurate judgment, but it is not a specific limitation.
[0082] Step S300, according to the target speech coding type, determining a target decoding function matching the target speech coding type from a preset decoding processing function library, wherein the preset decoding processing function library includes a plurality of decoding functions matching the speech coding types one by one.
[0083] The above decoding function is used to decode the data of the corresponding speech coding type to obtain decoded audio data.
[0084] It should be noted that in an embodiment of the present application, the target parameters corresponding to the target coding type are obtained based on the above-mentioned bytes to be compared and the above-mentioned target speech coding type. The above-mentioned target parameters are parameters that need to be used by the target decoding function during use and are used to control the processing process of the target decoding function.
[0085] Step S400: decoding the audio data to be tested according to the target decoding function to obtain decoded audio data.
[0086] Specifically, in this embodiment, the target decoding function is called, and based on the target parameters, the audio data to be tested is decoded to obtain decoded audio data. In this embodiment of the application, the decoded audio data is original pulse code modulation (PCM) audio data.
[0087] Step S500: Perform an audio test on the decoded audio data and obtain a test result corresponding to the audio data to be tested.
[0088] Specifically, the step of performing an audio test on the decoded audio data and obtaining a test result corresponding to the audio data to be tested includes:
[0089] 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 obtain a test result corresponding to the audio data to be tested returned by the audio analyzer.
[0090] As can be seen from the above, in the audio data testing method provided in the embodiment of the present application, the audio data to be tested is obtained; based on the above audio data to be tested, the target voice coding type corresponding to the above audio data to be tested is determined from a plurality of preset voice coding types; based on the above target voice coding type, a target decoding function matching the above target voice coding type is determined from a preset decoding processing function library, wherein the above preset decoding processing function library includes a plurality of decoding functions that match the above voice coding types one by one; the above audio data to be tested is decoded according to the above target decoding function to obtain decoded audio data; an audio test is performed on the above decoded audio data and a test result corresponding to the above audio data to be tested is obtained.
[0091] 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 first determined, 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, thereby completing the audio decoding process and then performing the audio test. In this way, the accuracy of the audio decoding is ensured, thereby avoiding errors in the test process, which is conducive to improving the accuracy of the audio data test.
[0092] In the embodiment of the present application, the above audio data testing method is also described in detail based on a specific application scenario. Specifically, the above audio data testing method is applied to an audio data testing system. Figure 2 is a schematic diagram of the components of an audio data test system provided in an embodiment of the present application, such as Figure 2 As shown, the above-mentioned audio data test system includes a Bluetooth remote control and a Bluetooth remote control automated detection device (i.e., an audio test device), and the above-mentioned Bluetooth remote control automated detection device includes a PC host computer, a Bluetooth adapter, and an audio analyzer (i.e., an audio analysis device). The above-mentioned PC host computer is used to communicate and process data with the Bluetooth adapter and audio analyzer connected to the PC. In an application scenario, the software configured in the above-mentioned 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 is connected to the Bluetooth adapter, and the two parties communicate through the Universal Serial Bus (USB) to serial port protocol. The PC host is also connected to the audio analyzer, and the two parties communicate through the USB protocol. The Bluetooth remote control is connected to the Bluetooth adapter, and the two parties communicate through the Bluetooth Low Energy (BLE) protocol. Among them, the above-mentioned Bluetooth remote control is used for audio data collection, preprocessing and uploading.
[0094] In an embodiment of the present application, three common remote control voice encoding methods are adapted in the above-mentioned PC host computer: ADPCM, SBC and OPUS (actual versions: ADPCM-IMA, SBC1.4 and OPUS1.2.1). Specifically, the above-mentioned PC host computer is a window executable program developed based on QT6.8.0 version, which mainly includes a serial communication component and an audio decoding component. The above three voice encoding methods 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). Copy the source files of the three voice encodings to the PC host computer source file directory. Set the include path and add a header file containing the decoding interface in the main program code.
[0095] In addition to adapting to voice coding, in the embodiment of the present application, a decoder with adjustable parameters is also configured in the PC host computer, and the decoder decodes the audio data based on a decoding function. Specifically, for the above three types of voice coding, three decoding functions are configured.
[0096] For the ADPCM mode, the corresponding decoding function is: voidadpcm_decode(ADPCM_STATE_ts*state, unsigned char*input, intnumSamples, short*output). If you want to decode any voice data compressed by ADPCM coding, you only need to adjust numSamples (number of samples) to adapt. The data frame format generated by ADPCM coding is shown in Table 1 below.
[0097] Table 1
[0098] member length describe PREDICT 2 bytes Low byte first, algorithm parameters PREDICTIDX 1 byte Step table index, algorithm parameters LENGTH 1 byte Number of bytes in ADPCMDATA ADPCMDATA LENGTH ADPCM Data
[0099] For the SBC mode, the corresponding decoding functions are: int sbc_init(sbc_t*sbc,unsigned longflags) and ssize_tsbc_decode(sbc_t*sbc,const void*input,size_tinput_len,void*output,size_toutput_len,size_t*written). If you want to decode any voice data compressed by SBC encoding, you need to modify the parameters in the structure sbc_t*sbc in the initialization function sbc_init(). The parameters are shown in Table 2 below.
[0100] Table 2
[0101]
[0102] Furthermore, the data frame format finally encoded by SBC is shown in Table 3 below.
[0103] Table 3
[0104]
[0105]
[0106] Further, in the embodiment of the present application, for the OPUS mode, the corresponding decoding functions used are: intopus_decoder_init(OpusDecoder*st, opus_int32Fs, intchannels) and intopus_decode(OpusDecoder*st, constunsignedchar*data, opus_int32len, opus_int16*pcm, intframe_size, intdecode_fec). If you want to be able to decode any voice data compressed by OPUS coding, you need to modify all the parameters in the initialization function opus_decoder_init(), and the parameters included are shown in Table 4 below.
[0107] Table 4
[0108]
[0109] The data frame format generated by OPUS final encoding is shown in Table 5 below.
[0110] Table 5
[0111]
[0112] Figure 3 is a specific flow chart of an audio data testing method provided in an embodiment of the present application, such as Figure 3 As shown, in the embodiment of the present application, the Bluetooth remote control is connected and paired with the Bluetooth adapter, and the PC host computer sends a command to the Bluetooth adapter to enable the Bluetooth remote control. Specifically, the notify attribute of the Bluetooth remote control is enabled so that the Bluetooth remote control uploads the collected audio. The Bluetooth remote control sends audio data, and the Bluetooth adapter receives the audio data and transparently transmits it to the PC host computer.
[0113] It should be noted that if the remote control processes the compressed audio data, such as adding headers and footers, adding time stamps, etc., the adapter needs to reverse the processing after receiving the audio data and input the original compressed audio data to the host computer, such as deleting the headers and footers, restoring the time stamp, etc. If the remote control does not process the compressed audio data, the adapter can directly input the received data to the host computer.
[0114] After receiving the encoded audio data, the host computer will automatically identify the type of voice encoding. Figure 4 1 is a schematic diagram of a specific flow chart for determining a target speech coding type provided by an embodiment of the present application. Figure 4 As shown, the host computer first stores all the acquired audio data (which can be the encoded audio data uploaded by the dongle) into the cache queue. The first 4 bytes of 5 frames of data are extracted from the beginning of the queue in sequence for comparison to determine the differences and similarities that these 4 bytes of the 5 frames of data meet. There are four specific situations.
[0115] The first one is that only the 4th byte of these 5 frames of data are the same, and the current encoding method is determined to be ADPCM. According to Table 1, the parameter represented by the 4th byte is the encoded data length, and the ADPCM compression ratio is 1:4, so multiplying the encoded data length by 4 can get numSamples (number of samples), which is the parameter required by the ADPCM format (i.e., the target parameter). The host computer records this parameter as parameter A.
[0116] The second type is that the three bytes starting from the first byte of these 5 frames of data are all the same, and the current encoding method is judged to be SBC. According to Table 3, the parameters represented by the second and third bytes are the parameters required by the SBC format (i.e., the target parameters), and the host computer records the parameters as parameter B.
[0117] The third type is that only the first bytes of these 5 frames of data are the same. It is judged that the current encoding method is OPUS. According to Table 5, the parameter represented by the first byte is the parameter required by the OPUS format (i.e., the target parameter), and the host computer records the parameter as parameter C.
[0118] The fourth type is that none of the above three situations are met, and it is judged that it is not one of the three preset encoding methods, and it is prompted that the unknown encoding format needs to be adapted.
[0119] Finally, the host computer processes the received original encoded compressed audio data through the decoding function of the corresponding parameters, and outputs it as original PCM audio data (i.e. decoded audio data), which is then input into the audio analyzer for spectrum analysis, distortion detection, etc. After the analysis is completed, the audio analyzer will return the test results to the PC host computer, ending the audio test.
[0120] In a specific application scenario, a Bluetooth remote control A uses SBC encoding for voice data compression, and now the Bluetooth remote control audio test equipment is to be used for testing.
[0121] The first step is to pair the remote control with the Bluetooth adapter.
[0122] In the second step, click to start the test, then press the voice button on the remote control and play the test audio. At this time, the host computer will start to continuously receive the compressed audio data.
[0123] Step 3: After the test audio is played, release the voice button on the remote control and wait for the audio to be received.
[0124] In the fourth step, the host computer automatically determines the audio coding format and decodes it synchronously, and inputs the decoded raw data into the audio analyzer.
[0125] Step 5: The audio analyzer returns the test results and the test is completed.
[0126] Next, you need to test another Bluetooth remote control B that uses OPUS encoding. At this time, just repeat the above steps without switching software or hardware.
[0127] In this way, when faced with a scenario where there are audio data of multiple voice coding types, there is no need to switch different devices for data processing, and accurate processing and testing of audio data of different voice coding types can be achieved, which simplifies the audio test preparation work for remote controls using different voice coding, improves test efficiency, and lowers the learning threshold.
[0128] Specifically, the audio data testing method provided in the embodiment of the present application is compatible with multiple voice encoding methods for the Bluetooth remote control audio testing scenario, realizes decoding compatible with multiple voice encoding methods, and can dynamically adjust the target parameters in the decoding process according to actual data requirements. The remote control is connected using a Bluetooth adapter and the adapter transmits compressed voice data to the PC host computer. The PC host computer is adapted to three voice decoding libraries and can be customized to adjust parameters, which enhances the compatibility of Bluetooth voice detection of the device and reduces the time required to switch decoding methods, and also improves the processing accuracy when processing data of different voice encoding types.
[0129] like Figure 5 As shown in , corresponding to the above-mentioned audio data testing method, the embodiment of the present application further provides an audio data testing system, and the above-mentioned audio data testing system includes:
[0130] The data acquisition module 510 is used to acquire the audio data to be tested;
[0131] The coding type determination module 520 is used to determine the 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] A decoding function determination module 530 is used to determine a target decoding function matching 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 includes a plurality of decoding functions matching the speech coding types one by one;
[0133] The audio decoding module 540 is used to decode the audio data to be tested according to the target decoding function to obtain decoded audio data;
[0134] The data testing module 550 is used to perform an audio test on the decoded audio data and obtain a test 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 first determined, 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, thereby completing the audio decoding process and then performing the audio test. In this way, the accuracy of the audio decoding is ensured, thereby avoiding errors in the test process, which is conducive to improving the accuracy of the audio data test.
[0136] It should be noted that the specific structure and implementation of the above-mentioned audio data testing system and its various modules or units can refer to the corresponding description in the above-mentioned method embodiment, and will not be repeated here.
[0137] It should be noted that the division method of the various modules of the above-mentioned audio data testing system is not unique and is not specifically limited here.
[0138] Based on the above embodiments, the present application also provides a smart terminal, whose principle block diagram can be as follows: Figure 6 As shown. The above-mentioned intelligent terminal includes a processor, a memory, a network interface and a display screen connected through a system bus. Among them, the processor of the intelligent terminal is used to provide computing and control capabilities. The memory of the intelligent terminal includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and an audio data test program. The internal memory provides an environment for the operation of the operating system and the audio data test program in the non-volatile storage medium. The network interface of the intelligent terminal is used to communicate with an external terminal through a network connection. When the audio data test program is executed by the processor, the steps of any one of the above-mentioned audio data test methods are implemented. 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 will understand that Figure 6 The principle block diagram shown in the figure is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the smart terminal to which the solution of the present application is applied. The specific smart terminal may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0140] In one embodiment, a smart terminal is provided, which includes a memory, a processor, and an audio data test program stored in the memory and executable on the processor. When the audio data test program is executed by the processor, the steps of any one of the audio data test methods provided in the embodiments of the present application are implemented.
[0141] An embodiment of the present application also provides a computer-readable storage medium, on which an audio data testing program is stored. When the audio data testing program is executed by a processor, the steps of any one of the audio data testing methods provided in the embodiment of the present application are implemented.
[0142] It should be understood that the serial numbers of the steps in the above embodiments do not imply a sequence of execution. The execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0143] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the above-mentioned device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned device can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0144] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0145] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this 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 system / terminal device embodiments described above are only schematic, for example, the division of the above modules or units is only a logical function division, and in actual implementation, other division methods can be used, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0147] If the above-mentioned integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The above-mentioned computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the above-mentioned computer program includes computer program code, and the above-mentioned computer program code can be in source code form, object code form, executable file or some intermediate form. The above-mentioned computer-readable medium may include: any entity or device capable of carrying the above-mentioned computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, electric signal and software distribution medium. It should be noted that the content contained in the above-mentioned computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction.
[0148] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. An audio data testing method, characterized in that: The method comprises: Get the audio data to be tested; Determining, according to the audio data to be tested, a target speech coding type corresponding to the audio data to be tested from a plurality of preset speech coding types; According to the target speech coding type, determining a target decoding function matching the target speech coding type from a preset decoding processing function library, wherein the preset decoding processing function library includes a plurality of decoding functions matching the speech coding types one by one; Decoding the audio data to be tested according to the target decoding function to obtain decoded audio data; An audio test is performed on the decoded audio data and a test result corresponding to the audio data to be tested is obtained.
2. The audio data testing method according to claim 1, characterized in that: The step of obtaining the audio data to be tested includes: Acquire original encoded audio data transmitted by an audio acquisition device based on Bluetooth communication, wherein the original encoded audio data is obtained after the audio acquisition device compresses and preprocesses the collected original audio data, and the preprocessing operation includes adding a timestamp and / or adding a data frame index; According to the preprocessing operation, the original encoded audio data is restored to obtain the audio data to be tested, wherein the restoration process includes deleting a timestamp and / or deleting a data frame index.
3. The audio data testing method according to claim 1, characterized in that: The step of determining, according to the audio data to be tested, a target speech coding type corresponding to the audio data to be tested from a plurality of preset speech coding types comprises: Extracting a plurality of target data frames from the audio data to be tested according to a preset number of data frames; According to the preset target number of bytes per frame, bytes are extracted from the starting position of each target data frame to obtain the bytes to be compared corresponding to each target data frame; According to the bytes to be compared corresponding to each of the target data frames, a target speech coding type corresponding to the audio data to be tested is determined from a plurality of preset speech coding types.
4. The audio data testing method according to claim 3, characterized in that: The preset multiple speech coding types include adaptive differential pulse coding, subband coding and OPUS.
5. The audio data testing method according to claim 4, characterized in that: The preset target number of bytes per frame is 4; The step of determining, according to the bytes to be compared, a target speech coding type corresponding to the audio data to be tested from a plurality of preset speech coding types comprises: If, among the bytes to be compared corresponding to the target data frames, only the fourth byte is completely identical, adaptive differential pulse coding is used as the target speech coding type; If the first three bytes from the first byte of the bytes to be compared corresponding to the target data frames are exactly the same, sub-band coding is used as the target speech coding type; If, among the bytes to be compared corresponding to the target data frames, only the first byte is completely identical, OPUS is used as the target speech coding type.
6. The audio data testing method according to claim 1, characterized in that: The method further comprises: If the preset multiple speech coding types do not include a type corresponding to the audio data to be tested, then unknown coding format adaptation prompt information is output.
7. The audio data testing method according to any one of claims 1 to 6, characterized in that: The performing an audio test on the decoded audio data and obtaining a test result corresponding to the audio data to be tested includes: 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 obtain a test result corresponding to the audio data to be tested returned by the audio analyzer.
8. An audio data testing system, characterized in that: The system comprises: A data acquisition module, used to acquire audio data to be tested; A coding type determination module, used 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; A decoding function determination module, used to determine a target decoding function matching 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 includes a plurality of decoding functions matching the speech coding types one by one; An audio decoding module, used for decoding the audio data to be tested according to the target decoding function to obtain decoded audio data; The data testing module is used to perform an audio test on the decoded audio data and obtain a test result corresponding to the audio data to be tested.
9. An intelligent terminal, characterized in that: The intelligent terminal includes a memory, a processor, and an audio data test program stored in the memory and executable on the processor. When the audio data test program is executed by the processor, the steps of the audio data test method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores an audio data testing program, and when the audio data testing program is executed by a processor, the steps of the audio data testing method according to any one of claims 1 to 7 are implemented.
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
Apparatus for testing audio quality of an electronic device
US20110013779A1
Method of detecting a predetermined frequency band in an audio data signal, detection device and computer program corresponding thereto
US20150179190A1