Microphone time delay test method and device, equipment, storage medium and product
By using the ADB command window control device to perform microphone delay testing, the problems of high testing costs, low efficiency and low accuracy in the prior art are solved, and more efficient and more accurate testing is achieved.
Patent Information
- Application Number
- CN202411460192.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2025-02-14
AI Technical Summary
Existing microphone delay testing methods rely on expensive professional equipment, resulting in high testing costs, low efficiency and low accuracy.
Through the ADB command window, enter the recording command to the device to be tested, control the device to play the preset audio and record it synchronously, compare the recorded audio with the preset audio to determine the microphone delay.
Reliance on expensive hardware devices is reduced, testing costs are reduced, and testing efficiency and accuracy are improved.
Smart Images

Figure CN119450333A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electronic product testing, and in particular to a microphone delay testing method, device, equipment, storage medium and product. Background Art
[0002] With the development of speech recognition technology and intelligent voice devices, the delay problem of microphone recording has gradually become one of the key factors affecting device performance. Especially in devices with voice wake-up and voice interaction functions such as tablets and smart speakers, the recording delay of the microphone will directly affect the response speed of the device and the user experience. Therefore, testing and optimizing the microphone recording delay is crucial to ensure the accuracy and real-time performance of speech recognition devices. Existing microphone delay test methods usually rely on professional audio test equipment. For example, using equipment such as acoustic analyzers and signal generators, the delay of audio signals can be accurately measured. However, the procurement and maintenance costs of such professional equipment are high, and the complexity of the equipment increases the difficulty of testing. In addition, outsourcing the test to a professional testing organization not only increases the cost, but may also extend the test cycle and reduce the test efficiency. Therefore, how to reduce the test cost and improve the test efficiency and accuracy has become an urgent problem to be solved. Summary of the invention
[0003] The main purpose of this application is to provide a microphone delay test method, device, equipment, storage medium and product, aiming to solve the technical problem of how to reduce test costs and improve test efficiency and accuracy.
[0004] To achieve the above object, the present application provides a microphone delay testing method, the method comprising:
[0005] Based on the ADB command window, input the recording command to the device to be tested;
[0006] According to the recording command, the device under test is controlled to play a preset audio, and the device under test is controlled to record synchronously to obtain recorded audio;
[0007] Comparing the recorded audio with the preset audio;
[0008] According to the comparison result, the microphone delay of the device to be tested is determined.
[0009] In one embodiment, before the step of inputting a recording command to the device to be tested based on the ADB command window, the method further includes:
[0010] Obtain the number of speakers, the number of microphones, and the sampling rate of the device to be tested;
[0011] The recording command is generated based on the number of speakers, the number of microphones, and the sampling rate.
[0012] In one embodiment, before the step of controlling the device under test to play preset audio according to the recording command and controlling the device under test to record synchronously to obtain the recorded audio, the step further includes:
[0013] An audio recording tool and a volume adjustment tool are configured in the device to be tested.
[0014] In one embodiment, the step of controlling the device under test to play preset audio according to the recording command and controlling the device under test to record synchronously to obtain the recorded audio includes:
[0015] According to the recording command, controlling the speaker of the device to be tested to play the preset audio;
[0016] When the preset audio is played, based on the audio recording tool, the microphone of the device under test is controlled to record the audio to obtain the recorded audio.
[0017] In one embodiment, before the step of controlling the speaker of the device under test to play the preset audio according to the recording command, the method further includes:
[0018] Based on the volume adjustment tool, the audio parameters of the device to be tested are adjusted, and the audio parameters include volume, audio channel and sampling rate.
[0019] In one embodiment, the step of comparing the recorded audio with the preset audio includes:
[0020] Based on the ADB command window, the recorded audio and the preset audio are imported into a preset audio analysis tool to obtain a playback waveform graph and a recording waveform graph;
[0021] Taking the peak point or mutation point in the playback waveform as the playback point;
[0022] The corresponding peak point or the corresponding mutation point in the recording waveform is used as the recording point;
[0023] Based on the timeline of the preset audio analysis tool, the playback point is compared with the recording point.
[0024] In addition, to achieve the above-mentioned purpose, the present application also proposes a microphone delay test device, the microphone delay test device comprising:
[0025] The command module is used to input recording commands to the device under test based on the ADB command window;
[0026] A playback and recording module, used to control the device under test to play preset audio according to the recording command, and control the device under test to record synchronously to obtain recorded audio;
[0027] A comparison module, used for comparing the recorded audio with the preset audio;
[0028] The target module is used to determine the microphone delay of the device to be tested according to the comparison result.
[0029] In addition, to achieve the above-mentioned objectives, the present application also proposes a microphone delay testing device, which includes: a memory, a processor, and a microphone delay testing program stored in the memory and executable on the processor, wherein the microphone delay testing program is configured to implement the steps of the microphone delay testing method described above.
[0030] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, on which a microphone delay test program is stored. When the microphone delay test program is executed by a processor, the steps of the microphone delay test method described above are implemented.
[0031] In addition, to achieve the above-mentioned purpose, the present application also proposes a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of the microphone delay testing method described above are implemented.
[0032] This application is based on the ADB command window, inputting a recording command to the device to be tested; according to the recording command, controlling the device to be tested to play the preset audio, and controlling the device to be tested to record synchronously to obtain the recorded audio; comparing the recorded audio with the preset audio; and determining the microphone delay of the device to be tested based on the comparison result. This application realizes the automatic control of the device by using ADB commands, reduces the dependence on expensive hardware equipment, and reduces the testing cost. At the same time, the synchronous control of the recording and playback process The automated test steps improve the test efficiency, and through comparative analysis, the high accuracy of the microphone delay test is ensured, reducing the test cost and improving the test efficiency and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 This is a flow chart of the first embodiment of the microphone delay testing method of the present application;
[0034] Figure 2 This is a schematic diagram of a sub-process in the second embodiment of the microphone delay testing method of the present application;
[0035] Figure 3 This is a schematic diagram of a sub-process in the third embodiment of the microphone delay testing method of the present application;
[0036] Figure 4 This is a schematic diagram showing the comparison between the audio collected by the audio analysis tool and the audio recorded by the microphone in one embodiment of the present application;
[0037] Figure 5 This is a schematic diagram of the module structure of the microphone delay test device according to an embodiment of the present application;
[0038] Figure 6 Schematic diagram of the device structure of the hardware operating environment involved in the microphone delay testing method in the embodiment of the present application.
[0039] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0040] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0041] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0042] It should be noted that with the development of speech recognition technology and intelligent voice devices, the delay problem of microphone recording has gradually become one of the key factors affecting device performance. Especially in devices with voice wake-up and voice interaction functions such as tablets and smart speakers, the recording delay of the microphone will directly affect the response speed of the device and the user experience. Therefore, testing and optimizing the microphone recording delay is crucial to ensure the accuracy and real-time performance of speech recognition devices. Existing microphone delay test methods usually rely on professional audio test equipment. For example, using equipment such as acoustic analyzers and signal generators, the delay of audio signals can be accurately measured. However, the procurement and maintenance costs of such professional equipment are high, and the complexity of the equipment increases the difficulty of testing. In addition, outsourcing the test to a professional testing organization not only increases the cost, but may also extend the test cycle and reduce the test efficiency. Therefore, how to reduce the test cost and improve the test efficiency and accuracy has become an urgent problem to be solved.
[0043] The main solution of this application is: based on the ADB command window, input the recording command to the device to be tested; according to the recording command, control the device to be tested to play the preset audio, and control the device to be tested to record synchronously to obtain the recorded audio; compare the recorded audio with the preset audio; according to the comparison result, determine the microphone delay of the device to be tested.
[0044] This application uses ADB commands to achieve automatic control of the device, reducing the reliance on expensive hardware devices and reducing testing costs. At the same time, the synchronous control of the recording and playback process improves the test efficiency, and through comparative analysis, it ensures the high accuracy of the microphone delay test, reduces the test cost, and improves the test efficiency and accuracy.
[0045] It should be noted that the execution subject of the method of this embodiment can be a computing service device with data processing, network communication and program running functions, or it can be the above-mentioned microphone delay test device with the same or similar functions. This embodiment and the following embodiments will be described by taking the microphone delay test device as an example.
[0046] Based on this, the first embodiment of the microphone delay test method of the present application is proposed, please refer to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the microphone delay testing method of the present application.
[0047] In this embodiment, the method includes the following steps:
[0048] S1: Based on the ADB command window, input the recording command to the device to be tested;
[0049] It should be noted that ADB (Android Debug Bridge) is a debugging tool for connecting Android devices to computers. The ADB command window refers to a command line tool running on a computer, which is used to send commands to the connected Android device for debugging and control, including file transfer, log viewing, program installation, uninstallation, etc. In this step, the ADB command window is used to send a recording command to the device under test. The recording command is an instruction sent through the ADB tool to control the microphone of the Android device to start recording. The specific recording command will be set according to parameters such as the device configuration, number of microphones, and sampling rate. The device under test refers to an electronic device with voice recognition or voice interaction functions, including smart speakers, tablets, smart phones, etc. These devices have microphones and speakers for testing their recording functions and latency.
[0050] Specifically, an ADB connection is established between the computer and the device to be tested. The ADB connection is usually implemented through a USB cable or a wireless network connection. The user opens the ADB command window on the computer and enters a specific ADB command to connect to the device to be tested. The device to be tested needs to be in debug mode, allowing it to receive and execute instructions issued from the ADB command window. At this point, the user can send a recording command to the device through the command line tool to tell the device to start the microphone for recording.
[0051] Furthermore, according to the audio hardware configuration of the device, the user enters a specific recording command in the ADB command window. The recording command usually includes parameters such as the save path of the recording file, the sampling rate, the number of channels, etc. Through this command, the device will start to capture the microphone signal and perform the recording operation.
[0052] Through ADB commands, remote control of devices can be achieved, thus simplifying test operations. Compared with traditional manually controlled recording devices, the use of ADB commands can directly control the audio function of the device to be tested through a computer. This not only improves the convenience of operation, but also reduces human operation errors, thereby ensuring the accuracy and repeatability of the test process. In addition, recording audio through the ADB command window can be seamlessly integrated with other automated test processes. For example, recording commands can be embedded in automated test scripts to facilitate batch testing of large quantities of devices, thereby further improving test efficiency. In this way, multiple devices can be tested and controlled remotely without physically operating each device, greatly reducing test costs and improving the flexibility of the test process.
[0053] S2: According to the recording command, the device under test is controlled to play a preset audio, and the device under test is controlled to record synchronously to obtain recorded audio;
[0054] It should be noted that preset audio refers to a predetermined audio signal, usually a standardized test audio file (such as a 1kHz sine wave), which is used to test the audio signal source played by the device. Synchronous recording means that the device records the audio through the microphone while playing the preset audio. Synchronization is very important because the synchronization of playback and recording operations can ensure accurate measurement of audio latency. Recording audio means that the device records the captured audio signal through the microphone while playing the preset audio, and the final generated audio file is used for subsequent analysis.
[0055] Specifically, send a recording command to the device under test through the ADB command window to start the recording function of the device. The recording command specifies the recording parameters, including sampling rate, recording channel, bit rate, and path for saving files. After the command is issued, the device's microphone is ready to capture the received audio signal. At the same time, during the execution of the recording command, the device starts playing the preset audio. The preset audio is usually a 1kHz sine wave, or other standardized audio signal, played through the device's speaker.
[0056] Furthermore, while playing the preset audio, the device's microphone starts recording synchronously to capture the audio signal emitted by the device's speaker. The recording operation and the playback operation are performed synchronously, and the device will record the external sound of the played audio into the audio file through the microphone. After the recording is completed, the generated recorded audio file will be stored in the device's storage space and can be exported to the computer for analysis through the ADB command. In the audio analysis tool, the delay of the recorded audio can be calculated by comparing the recorded audio with the preset audio, thereby determining the delay of the device's microphone.
[0057] Through the automated control of synchronized recording and playback, testers do not need to rely on manual synchronized recording and playback, but can automatically achieve self-playing and self-recording of device audio through software. This synchronization can effectively reduce the errors caused by human factors and ensure that the delay between recording and playback is only determined by the hardware performance and processing power of the device itself, so that the microphone delay can be accurately measured. In addition, this synchronous operation also improves the efficiency of the test. Traditional testing methods may require multiple devices or external hardware assistance to control the playback and recording of audio respectively, while this step implements this process through the built-in functions of the device, avoiding dependence on external devices and simplifying the operation process. At the same time, since recording and playback are performed on the same device, this also makes the test results more consistent and repeatable, thereby improving the reliability and accuracy of the test.
[0058] S3: comparing the recorded audio with the preset audio;
[0059] It should be noted that comparison here refers to comparing the recorded audio with the preset audio through an audio analysis tool to find out the time difference between the two, thereby determining the microphone delay of the device.
[0060] Specifically, export the audio file (recorded audio) recorded by the ADB command, and import it together with the preset audio (i.e. the audio signal played by the device) into an audio analysis tool, such as Audacity, Matlab, etc. In the audio analysis tool, display the two audio files in the form of waveforms. At this time, the waveforms of the preset audio and the recorded audio should have similar shapes, because the recorded audio is the result of the device's sampling of the preset audio.
[0061] Furthermore, observe and compare the key waveform feature points of the two audios. Usually, these key points can be peaks, troughs, or the starting position of the audio signal. For example, in the case of a 1kHz sine wave, the first peak can be selected as the marker point. Through the timeline function of the tool, the time difference (i.e. delay) between the recorded audio and the preset audio can be accurately measured. This time difference is the delay after the microphone collects the signal, transmits it to the device for internal processing and finally records it.
[0062] By comparing the recorded audio with the preset audio, the recording delay of the microphone can be accurately calculated. Compared with the traditional manual observation method, the audio analysis tool is used here to automatically process the waveform, which can accurately measure the time difference at the frame level, avoid human operation errors, and greatly improve the measurement accuracy. Since the comparison of audio waveforms can capture subtle delay differences, this method is suitable for high-precision delay testing, ensuring the accuracy of the test results. In addition, by comparing the recorded audio with the preset audio, this method can also quickly determine the performance of the device in actual application scenarios. The microphone delay directly affects the device's response speed to voice commands, so this test method can not only help manufacturers evaluate whether the technical specifications of the device meet the requirements, but also provide data support for device optimization. This automated analysis method based on audio waveform comparison simplifies the test process, reduces the complexity and cost of test equipment, and improves test efficiency.
[0063] S4: Determine the microphone delay of the device to be tested according to the comparison result;
[0064] It should be noted that the comparison result refers to the time difference between the recorded audio and the preset audio calculated by comparing the time axis of the two through the audio analysis tool. Microphone latency refers to the time delay from the microphone receiving the external audio signal to the device completing the signal processing and recording. It includes the comprehensive delay of multiple links such as audio signal acquisition, transmission and processing.
[0065] Specifically, the waveforms of the recorded audio and the preset audio are compared through the audio analysis tool. Use the marking function of the tool to select corresponding waveform feature points (such as the peak, trough or starting point of the audio) in the recorded audio and the preset audio respectively. By analyzing the time axis of the software, the time difference between the recorded audio and the preset audio can be accurately calculated.
[0066] Furthermore, once the time difference is determined, the microphone delay of the device can be determined. This time difference represents the delay time required for the microphone to receive the preset audio signal emitted by the speaker, process and record the signal, and finally generate the audio file. Usually this delay is expressed in milliseconds (ms). For example, if the start time of the preset audio is 0 seconds, and the start time of the recorded audio is 0.02 seconds, it can be determined that the microphone delay of the device is 20 milliseconds (ms).
[0067] Through precise waveform comparison and analysis, the microphone delay can be effectively and accurately determined. By comparing the waveforms, the time difference obtained can reflect the actual performance of the device during recording, ensuring that the measurement results have high accuracy. In addition, the accuracy of this method is much higher than traditional visual or manual measurement. Through this automated delay calculation method, the microphone delay results of the test device can be quickly obtained and can be applied to the testing of different devices in batches. This method can also be used in different test scenarios, such as performance verification of voice assistant devices, smart speakers, etc. Since delay is one of the key indicators of voice device performance, this step can provide accurate data support for the research and development and optimization of the device, which helps manufacturers optimize software and hardware based on delay data and improve the user experience of the device. In addition, accurate measurement of microphone delay can also help manufacturers better formulate product standards to ensure that the products meet market and user needs. Through accurate delay measurement, developers can more effectively adjust the device's algorithm and audio processing system to reduce delay, improve product response speed and user satisfaction.
[0068] This embodiment is based on the ADB command window, and inputs a recording command to the device to be tested; according to the recording command, the device to be tested is controlled to play the preset audio, and the device to be tested is controlled to record synchronously to obtain the recorded audio; the recorded audio is compared with the preset audio; according to the comparison result, the microphone delay of the device to be tested is determined. This embodiment realizes the automatic control of the device by using ADB commands, reduces the dependence on expensive hardware equipment, and reduces the testing cost. At the same time, the synchronous control of the recording and playback process The automated test steps improve the test efficiency, and through the comparative analysis method, the high accuracy of the microphone delay test is ensured, which reduces the test cost and improves the test efficiency and accuracy.
[0069] Based on the above first embodiment, a second embodiment of the microphone delay test method of the present application is proposed. Figure 2 , Figure 2 This is a schematic diagram of a sub-process in the second embodiment of the microphone delay testing method of the present application.
[0070] like Figure 2 As shown, in this embodiment, before step S1, the following steps are also included:
[0071] S1a: Obtain the number of speakers, the number of microphones and the sampling rate of the device to be tested;
[0072] S1b: Generate the recording command based on the number of speakers, the number of microphones and the sampling rate.
[0073] It should be noted that the number of speakers refers to the number of loudspeakers (or speakers) configured in the device to be tested. Different devices may be configured with different numbers of speakers (for example, a smart speaker may have multiple speakers to achieve stereo playback), and the number of speakers directly affects the channel configuration of the audio output. The number of microphones refers to the number of microphones configured in the device to be tested. Multiple microphones can be used for more accurate sound pickup, especially in devices with voice recognition capabilities. The number of microphones has a direct impact on the channel configuration of the recording. The sampling rate refers to the number of audio samples collected per second, usually expressed in Hertz (Hz), such as 44.1kHz or 48kHz. The sampling rate determines the quality of the recording. The higher the sampling rate, the higher the accuracy of the recording and the richer the sound details captured.
[0074] Specifically, before preparing for the microphone delay test, obtain the audio hardware parameters of the device to be tested. These parameters usually include the number of speakers, the number of microphones, and the sampling rate supported by the device. This information can be obtained through the device's system configuration file or through ADB command query. The specific command can be adb shell dumpsysmedia.audio_flinger, which can be used to view the detailed information of the device's audio hardware and extract the number of speakers and microphones and the sampling rate of the device.
[0075] Further, based on these acquired parameters, a recording command suitable for the device is generated. The number of microphones needs to be specified in the recording command to ensure that all microphone channels are used during recording. If the device has multiple speakers and microphones, it may be necessary to set the recording to stereo or multi-channel mode. In addition, the sampling rate parameter of the command needs to be set according to the sampling rate of the device to ensure that the recorded audio meets the capabilities of the device.
[0076] By obtaining the audio hardware configuration parameters of the device, a recording command that matches the actual configuration of the device can be generated, which ensures the accuracy and reliability of the test. Compared with hard-coded fixed recording commands, dynamically generating recording commands based on the actual hardware of the device can more flexibly adapt to the configuration of different devices. Regardless of whether the device has a single microphone or multiple microphones, or different sampling rate settings, this step can ensure the adaptability of the test process. In addition, by accurately setting the sampling rate and number of channels, the recording results are ensured to have high sound quality and accuracy, avoiding test errors caused by improper parameter settings. This recording control method based on the actual configuration of the device greatly improves the accuracy of the test, and can also adapt to devices of different types and specifications, thereby ensuring the universality and efficiency of the test.
[0077] Based on the first embodiment above, in this embodiment, before step S2, the following is further included:
[0078] S2a: configuring an audio recording tool and a volume adjustment tool in the device to be tested.
[0079] It should be noted that the audio recording tool refers to a tool used to perform recording operations in the device under test. In Android devices, the commonly used audio recording tool is tinycap, which can record audio through the command line, specify parameters such as file storage path, sampling rate, number of channels, etc., and is suitable for capturing sound through a microphone and saving it as an audio file. The volume adjustment tool refers to a tool used to adjust the audio output and input of a device, usually used to adjust the volume of speakers and microphones. In Android devices, the commonly used volume adjustment tool is tinymix. Through tinymix, you can adjust the device's audio input and output channels, microphone gain, speaker output volume and other parameters to ensure the quality of audio playback and recording.
[0080] Specifically, configure the audio recording tool in the device to be tested. Common recording tools such as tinycap need to be deployed to the device in advance to ensure that the device has the ability to record. Usually, the recording tool can be uploaded to the device's file system through the ADB command, and then the executable permission is configured on the device.
[0081] Furthermore, configure the volume adjustment tool Tinymix. Tinymix can control the audio hardware parameters of the device, including the volume output of the speaker and the gain of the microphone. Through Tinymix, the speaker playback volume and microphone recording gain can be accurately adjusted according to the actual configuration of the device to be tested to ensure that the recording and playback of the audio signal reach the appropriate volume level. Use the adb shell Tinymix command to dynamically adjust these parameters.
[0082] Tools such as TinyCap and TinyMix allow you to flexibly control recording and volume parameters. The volume adjustment tool ensures that the volume settings for recording and playback are just right, avoiding distortion or weak signals caused by too high or too low recording volumes. This is essential to ensure the accuracy of test results. The TinyMix tool allows you to adjust the output volume of the speaker and the gain of the microphone so that the recorded audio signal maintains the appropriate strength inside the device, avoiding external interference or volume imbalance. Good audio signal conditioning helps to obtain high-quality audio recording results, making subsequent delay calculations more accurate. After configuring the recording tool and volume adjustment tool, you can control audio recording and playback through automated scripts. This greatly improves the level of test automation, reduces the possibility of manual intervention, and provides convenient conditions for batch testing or remote testing. The configuration of the audio recording tool and volume adjustment tool ensures that the device can effectively perform audio playback and recording, thus providing a solid foundation for microphone delay testing.
[0083] This embodiment is based on the ADB command window, and inputs a recording command to the device to be tested; according to the recording command, the device to be tested is controlled to play the preset audio, and the device to be tested is controlled to record synchronously to obtain the recorded audio; the recorded audio is compared with the preset audio; according to the comparison result, the microphone delay of the device to be tested is determined. This embodiment realizes the automatic control of the device by using ADB commands, reduces the dependence on expensive hardware equipment, and reduces the testing cost. At the same time, the synchronous control of the recording and playback process The automated test steps improve the test efficiency, and through the comparative analysis method, the high accuracy of the microphone delay test is ensured, which reduces the test cost and improves the test efficiency and accuracy.
[0084] Based on the above second embodiment, a third embodiment of the microphone delay test method of the present application is proposed. Figure 3 , Figure 3 This is a schematic diagram of a sub-process in the third embodiment of the microphone delay testing method of the present application.
[0085] In this embodiment, step S2 includes:
[0086] S21: According to the recording command, controlling the speaker of the device under test to play the preset audio;
[0087] S22: When the preset audio is playing, based on the audio recording tool, the microphone of the device under test is controlled to record the audio to obtain the recorded audio.
[0088] It should be noted that recorded audio refers to the audio signal recorded after the microphone receives the preset audio played by the speaker, which is usually saved in a file format for subsequent delay analysis.
[0089] Specifically, a recording command is sent to the device under test through an ADB command. This command controls the device to enter the recording preparation state and specifies recording parameters, such as sampling rate, number of channels, and file save path. After receiving the command, the device under test will prepare the microphone and start recording synchronously while waiting for the audio to be played. At this point, the device's microphone has not started recording yet and is only in the preparation state.
[0090] Furthermore, the speaker of the device under test is controlled to play preset audio through the same ADB command window. The preset audio is usually a standard signal, such as a 1kHz sine wave, and the speaker will send the signal through the built-in playback function of the device. During the playback process, the device's audio recording tool (such as tinycap) starts to capture the audio signal received by the microphone and saves the recording result as an audio file. The recording process is synchronized with the playback process to ensure that the audio recorded by the recording device corresponds to the audio played in time. After the recording is completed, the device will save the recorded audio file to the specified path for subsequent analysis.
[0091] By remotely controlling the speaker and microphone of the device through ADB commands, self-broadcasting and self-recording can be achieved in the test without the need for additional external devices. This method not only greatly simplifies the test process, but also reduces the dependence on hardware devices, thereby effectively reducing the test cost. By synchronously controlling the recording and playback operations of the speaker and microphone, it is ensured that the recorded audio signal accurately reflects the time delay of the audio processing inside the device. Since audio playback and recording are performed on the same device, external interference such as communication delay between devices is reduced, and the actual delay of the device can be more accurately reflected. This self-broadcasting and self-recording method, combined with the precise control of the audio recording tool, can ensure the high accuracy of the microphone delay test results and improve the test efficiency. In addition, this method provides a high degree of repeatability and automation, and testers can use automated scripts to control multiple devices for batch testing. The recorded audio files can be used for subsequent delay calculation and analysis, helping developers and testers to quickly locate the performance bottlenecks of the device and make corresponding optimizations.
[0092] Based on the above second embodiment, in this embodiment, before step S21, the following is further included:
[0093] S21a: Based on the volume adjustment tool, adjust the audio parameters of the device to be tested, where the audio parameters include volume, audio channel, and sampling rate.
[0094] It should be noted that audio parameters refer to settings related to the processing and transmission of audio signals, including volume, audio channels (such as mono or stereo), and sampling rate (audio sampling frequency, usually in Hertz).
[0095] Specifically, start the volume adjustment tool tinymix through the ADB command, and use its functions to adjust the volume, channel, and sampling rate of the device under test. Tinymix allows direct control of the device's audio hardware, and these parameters can be changed through simple commands. Enter adb shell tinymix in the command line, and then use the relevant commands to view the current audio parameters of the device and make corresponding adjustments according to the test needs.
[0096] Furthermore, TinyMix can be used to control the microphone recording gain and speaker playback volume. Depending on the hardware configuration of the device to be tested, TinyMix allows users to switch between mono and stereo modes. The sampling rate determines the level of detail of the recorded audio. Users can set different sampling rates through TinyMix.
[0097] By adjusting audio parameters based on the volume adjustment tool TinyMix, you can finely control the recording and playback process of the device, thereby improving the accuracy of the test and the quality of the audio signal. Different devices may have different audio hardware configurations, so by dynamically adjusting the volume, channel and sampling rate through TinyMix, the device can adapt to various audio environments and ensure that the audio parameters meet the requirements during the test. This flexible adjustment method enables testers to adjust parameters in real time according to the different configurations of the device to ensure the reliability of the test results. By properly adjusting the volume of the speaker and the gain of the microphone, it can be ensured that the recorded audio signal will not be distorted due to excessive volume, nor will it be effectively captured due to too low volume. Appropriate volume settings can provide clear and accurate audio signals, thereby improving the accuracy of microphone delay tests. Through accurate channel and sampling rate configuration, it can be ensured that the recorded and played audio signals have a high-quality data foundation. Higher sampling rates provide richer audio details, which are suitable for delay test scenarios that require high precision; and multi-channel recording can capture more comprehensive audio information, especially for devices with multiple microphones. This step not only enhances the controllability of the test process, but also greatly improves the accuracy and effectiveness of the test results, helping testers to quickly locate the audio performance problems of the device and optimize them.
[0098] Based on the above second embodiment, in this embodiment, step S3 includes:
[0099] S31: Based on the ADB command window, import the recorded audio and the preset audio into a preset audio analysis tool to obtain a playback waveform graph and a recording waveform graph;
[0100] S32: taking a peak point or a mutation point in the playback waveform as a playback point;
[0101] S33: taking the corresponding peak point or the corresponding mutation point in the recording waveform as a recording point;
[0102] S34: Based on the timeline of the preset audio analysis tool, the playback point is compared with the recording point.
[0103] It should be noted that the preset audio analysis tools refer to software tools used to analyze audio files, such as Audacity, Adobe Audition or Matlab. These tools can display the waveform of the audio, mark the peak points or mutation points of the audio, and calculate the time difference between audio signals. The playback waveform refers to the waveform of the preset audio, that is, the representation of the audio signal played by the speaker on the timeline. The recording waveform refers to the representation of the audio signal recorded by the microphone on the timeline, and is a waveform generated by the audio file recorded by the recording tool. The peak point refers to the maximum value point of the audio signal in the waveform, which is usually used to mark the important features of the audio signal and to calculate the time difference. The mutation point refers to the point where the signal suddenly changes in the waveform, which is often used to mark the boundary of the audio signal, similar to the sudden rise or fall of the audio signal.
[0104] Specifically, export the recorded audio in the device to be tested to the computer through the ADB command. Copy the recorded WAV file from the device to the local computer. While exporting the recorded audio, you also need to prepare the original file of the preset audio, which is the same as the audio played by the device as a comparison benchmark. Import the recorded audio and the preset audio into an audio analysis tool (such as Audacity) respectively. The audio analysis tool will display each audio file as a waveform graph, which shows the change of the amplitude of the audio signal over time. First, check the waveform graph of the preset audio, find its peak point or mutation point (such as the first peak), and mark it as the playback point. The playback point is the key moment when the speaker sends an audio signal, which is used to calculate the delay.
[0105] Furthermore, check the waveform of the recorded audio to find the peak point or mutation point corresponding to the preset audio. Usually, the waveform of the recorded audio will have a certain time delay compared to the preset audio, so on the waveform, the peak point or mutation point of the recorded audio will appear at a later time position. Mark this point as the recording point, indicating the key moment of the signal captured by the microphone. Based on the timeline function of the audio analysis tool, calculate the time difference between the playback point and the recording point. This time difference is the recording delay of the microphone, which reflects the delay time from the audio signal being emitted from the speaker to the microphone receiving the signal.
[0106] By comparing the peak point or mutation point in the playback waveform with the recording waveform, the microphone recording delay of the device can be accurately calculated. The accurate comparison of the waveform by the audio analysis tool can effectively avoid the error caused by manual estimation, greatly improving the accuracy of delay measurement. This automated analysis process can more intuitively display the changes of the audio signal on the time axis, helping testers to accurately locate the delay of the audio signal in recording and playback. In addition, by using the time axis function of the audio analysis tool, the changes of the audio signal can be compared with millisecond accuracy. This high-precision analysis method can help R&D personnel better evaluate the performance of the device and provide data support for optimizing the audio processing algorithm. The automation feature of this step also supports batch testing and analysis, improves test efficiency and reduces the possibility of manual intervention, thereby ensuring the consistency and reliability of the results. Through this step, the microphone delay can be accurately measured and quantified, providing a scientific basis for the performance evaluation and optimization of the device, while simplifying the test process and improving efficiency.
[0107] This embodiment is based on the ADB command window, and inputs a recording command to the device to be tested; according to the recording command, the device to be tested is controlled to play the preset audio, and the device to be tested is controlled to record synchronously to obtain the recorded audio; the recorded audio is compared with the preset audio; according to the comparison result, the microphone delay of the device to be tested is determined. This embodiment realizes the automatic control of the device by using ADB commands, reduces the dependence on expensive hardware equipment, and reduces the testing cost. At the same time, the synchronous control of the recording and playback process The automated test steps improve the test efficiency, and through the comparative analysis method, the high accuracy of the microphone delay test is ensured, which reduces the test cost and improves the test efficiency and accuracy.
[0108] For example, see Figure 4 , Figure 4 This is a schematic diagram of the comparison between the audio collected by the audio analysis tool and the audio recorded by the microphone in one embodiment of the present application. Figure 4 As shown, first pre-set two files, tinycap and tinymix, in the system software of the test machine, configure the tinycap recording command according to the number of speakers and microphones and the sampling rate of the test machine, enter the corresponding recording command in the adb command window, and play 1kHz sine wave audio on the test machine to let the test machine play and record itself. After recording, export the corresponding audio file, open it in the audio analysis tool audacity, compare the speaker recollection and microphone recording audio, and calculate the microphone recording delay based on the time difference.
[0109] The present application also provides a microphone delay test device, please refer to Figure 5 , Figure 5This is a schematic diagram of the module structure of the microphone delay test device according to an embodiment of the present application, and the microphone delay test device includes:
[0110] The command module 501 is used to input a recording command to the device to be tested based on the ADB command window;
[0111] The playing and recording module 502 is used to control the device under test to play the preset audio according to the recording command, and control the device under test to record synchronously to obtain the recorded audio;
[0112] A comparison module 503, used to compare the recorded audio with the preset audio;
[0113] The target module 504 is used to determine the microphone delay of the device to be tested according to the comparison result.
[0114] The microphone delay test device provided in the embodiment of the present application adopts the microphone delay test method in the above embodiment, which can solve the technical problem of how to reduce the test cost and improve the test efficiency and accuracy. Compared with the prior art, the beneficial effects of the microphone delay test device provided in the embodiment of the present application are the same as the beneficial effects of the microphone delay test method provided in the above embodiment, and the other technical features in the microphone delay test device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0115] The present application provides a microphone delay testing device, which includes: at least one processor; and a memory that is communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the microphone delay testing method in the above-mentioned embodiment.
[0116] Reference below Figure 6 , which shows a schematic diagram of the structure of a microphone delay test device suitable for implementing the embodiment of the present application. The microphone delay test device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The microphone delay testing device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0117] like Figure 6 As shown, the microphone delay test device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the microphone delay test device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the microphone delay test device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a microphone delay test device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided instead.
[0118] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0119] The microphone delay test device provided by the present application adopts the microphone delay test method in the above embodiment, which can solve the technical problem of how to reduce the test cost and improve the test efficiency and accuracy. Compared with the prior art, the beneficial effects of the microphone delay test device provided by the present application are the same as the beneficial effects of the microphone delay test method provided by the above embodiment, and the other technical features in the microphone delay test device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0120] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0121] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0122] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the microphone delay testing method in the above-mentioned embodiment.
[0123] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above. The computer-readable storage medium may be included in the microphone delay test device; or may exist independently without being assembled into the microphone delay test device.
[0124] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the microphone delay test device, the microphone delay test device: based on the ADB command window, inputs a recording command to the device to be tested; according to the recording command, controls the device to be tested to play a preset audio, and controls the device to be tested to record synchronously to obtain a recorded audio; compares the recorded audio with the preset audio; and determines the microphone delay of the device to be tested according to the comparison result. The computer program code for performing the operation of the present application can be written in one or more programming languages or a combination thereof, and the programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" language or similar programming languages. The program code can be executed completely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or it can be connected to an external computer (for example, through the Internet using an Internet service provider).
[0125] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0126] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0127] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned microphone delay test method, and can solve the technical problem of how to reduce test costs and improve test efficiency and accuracy. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the microphone delay test method provided in the above-mentioned embodiment, and will not be repeated here.
[0128] An embodiment of the present application provides a computer program product, including a computer program, which implements the steps of the microphone delay testing method as described above when the computer program is executed by a processor.
[0129] The computer program product provided in this application can solve the technical problem of how to reduce test costs and improve test efficiency and accuracy. Compared with the prior art, the beneficial effects of the computer program product provided in the embodiment of this application are the same as the beneficial effects of the microphone delay test method provided in the above embodiment, which will not be repeated here.
[0130] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent processing scope of the present application.
Claims
1. A microphone delay test method, characterized in that: The method comprises: Based on the ADB command window, input the recording command to the device to be tested; According to the recording command, the device under test is controlled to play a preset audio, and the device under test is controlled to record synchronously to obtain recorded audio; Comparing the recorded audio with the preset audio; According to the comparison result, the microphone delay of the device to be tested is determined.
2. The method according to claim 1, characterized in that Before the step of inputting a recording command to the device to be tested based on the ADB command window, the method further includes: Obtain the number of speakers, the number of microphones, and the sampling rate of the device to be tested; The recording command is generated based on the number of speakers, the number of microphones, and the sampling rate.
3. The method according to claim 1, characterized in that Before the step of controlling the device under test to play preset audio according to the recording command and controlling the device under test to record synchronously to obtain the recorded audio, the method further includes: An audio recording tool and a volume adjustment tool are configured in the device to be tested.
4. The method according to claim 3, characterized in that The step of controlling the device under test to play preset audio according to the recording command and controlling the device under test to record synchronously to obtain the recorded audio comprises: According to the recording command, controlling the speaker of the device to be tested to play the preset audio; When the preset audio is played, based on the audio recording tool, the microphone of the device under test is controlled to record the audio to obtain the recorded audio.
5. The method according to claim 4, characterized in that Before the step of controlling the speaker of the device to be tested to play the preset audio according to the recording command, the method further includes: Based on the volume adjustment tool, the audio parameters of the device under test are adjusted, and the audio parameters include volume, audio channel and sampling rate.
6. The method according to claim 1, characterized in that The step of comparing the recorded audio with the preset audio includes: Based on the ADB command window, the recorded audio and the preset audio are imported into a preset audio analysis tool to obtain a playback waveform graph and a recording waveform graph; Taking the peak point or mutation point in the playback waveform as the playback point; The corresponding peak point or the corresponding mutation point in the recording waveform is used as the recording point; Based on the timeline of the preset audio analysis tool, the playback point is compared with the recording point.
7. A microphone delay test device, characterized in that: The device comprises: The command module is used to input recording commands to the device under test based on the ADB command window; A playback and recording module, used to control the device under test to play preset audio according to the recording command, and control the device under test to record synchronously to obtain recorded audio; A comparison module, used for comparing the recorded audio with the preset audio; The target module is used to determine the microphone delay of the device to be tested according to the comparison result.
8. A computer device, characterized in that: The device comprises: a memory, a processor, and a microphone delay test program stored in the memory and executable on the processor, wherein the microphone delay test program is configured to implement the steps of the microphone delay test method according to any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium stores a microphone delay test program, and when the microphone delay test program is executed by the processor, the steps of the microphone delay test method according to any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the microphone delay testing method according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Method and measurement device
US20260172767A1