Audio synchronization method and device for multiple loudspeakers, electronic equipment and storage medium
By acquiring and analyzing the speaker's audio signal and microphone collection signal, dynamically adjusting the speaker delay, the problem of poor synchronization of the built-in speaker and wireless speaker is solved, and stable audio synchronization in a dynamic environment is achieved.
Patent Information
- Application Number
- CN202510708553.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-28
- Publication Date
- 2025-08-08
AI Technical Summary
In the prior art, the delay between the built-in speakers and wireless speakers of smart TVs cannot cope with dynamic changes, resulting in poor synchronization and affecting the audio experience.
By obtaining the audio signals of the built-in speakers and wireless speakers and the audio signals collected by the microphone, the delay information is calculated, and the speaker playback delay is dynamically adjusted to achieve synchronization.
Monitor and adjust speaker delays in real time to ensure good synchronization results when the environment and equipment status changes, without manual user intervention and improve audio experience.
Smart Images

Figure CN120455772A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of audio processing technology, and more particularly to a method, device, electronic device, and computer-readable storage medium for synchronizing audio of multiple speakers. Background Art
[0002] A smart TV's surround audio system uses both the TV's built-in speakers and wireless surround speakers to deliver multi-channel audio. The built-in speakers are typically located on the TV itself and play audio signals for a subset of channels, such as the front speakers. Wireless surround speakers, located around the viewing area, play surround sound, providing users with a wider sound coverage. Ideally, each speaker should play the corresponding audio signal simultaneously to ensure synchronization and continuity, delivering an immersive listening experience.
[0003] To address speaker synchronization issues, existing technologies typically measure the delay between each speaker in advance. Specifically, during system initialization, a specific test audio signal is used to measure the time difference between the TV's built-in speakers and the wireless speakers. Based on this measurement, a fixed delay parameter is set for the TV's built-in speakers.
[0004] Since smart TVs are affected by factors such as system performance and wireless interference environment during playback, the delay between the built-in speakers and wireless speakers will continue to change. Setting a fixed delay is obviously unable to cope with this dynamic change, resulting in continued delay between the speakers. Summary of the Invention
[0005] The embodiments of the present disclosure provide a multi-speaker audio synchronization method, device, electronic device, and computer-readable storage medium, aiming to solve at least one of the technical problems in the related art to a certain extent.
[0006] In a first aspect, an embodiment of the present disclosure provides a method for synchronizing audio of multiple speakers, the method comprising:
[0007] Obtaining a first audio signal and a second audio signal, wherein one of the first audio signal and the second audio signal is a signal to be played by a built-in speaker of the device, and the other of the first audio signal and the second audio signal is a signal to be played by a wireless speaker;
[0008] Acquiring a third audio signal actually collected by the microphone;
[0009] determining delay information between the built-in speaker and the wireless speaker according to the first audio signal, the second audio signal, and the third audio signal;
[0010] Based on the delay information, the built-in speaker and the wireless speaker are controlled to play audio synchronously.
[0011] In a second aspect, an embodiment of the present disclosure further provides a multi-speaker audio synchronization device, the device comprising:
[0012] A first acquisition module is configured to acquire a first audio signal and a second audio signal, wherein one of the first audio signal and the second audio signal is a signal to be played by a built-in speaker of the device, and the other of the first audio signal and the second audio signal is a signal to be played by a wireless speaker;
[0013] A second acquisition module is used to acquire a third audio signal actually collected by the microphone;
[0014] a determining module, configured to determine delay information between the built-in speaker and the wireless speaker based on the first audio signal, the second audio signal, and the third audio signal;
[0015] The control module is used to control the built-in speaker and the wireless speaker to play audio synchronously based on the delay information.
[0016] In a third aspect, an embodiment of the present disclosure further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the steps in the above-mentioned multi-speaker audio synchronization method are implemented.
[0017] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned multi-speaker audio synchronization method are implemented.
[0018] In a fifth aspect, embodiments of the present disclosure further provide a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in various optional implementations of the embodiments of the present disclosure.
[0019] In an embodiment of the present disclosure, a first audio signal and a second audio signal are first obtained, wherein one of the first audio signal and the second audio signal is a signal to be played by the device's built-in speaker, and the other of the first audio signal and the second audio signal is a signal to be played by the wireless speaker. Then, a third audio signal actually collected by the microphone is obtained, and then the delay information between the built-in speaker and the wireless speaker is determined based on the first audio signal, the second audio signal and the third audio signal. Then, based on the delay information, the built-in speaker and the wireless speaker are controlled to play audio synchronously. In this way, the audio signal can be monitored and analyzed in real time, and the playback delay of the speaker can be dynamically adjusted according to the actual situation. During the audio playback process, environmental factors, device status, etc. may change, causing the delay between the speakers to change accordingly. The present application can capture these changes in real time and make timely adjustments to ensure that a good synchronization effect is always maintained without manual intervention by the user.
[0020] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the present disclosure, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 1 is a flowchart of a multi-speaker audio synchronization method provided by the first embodiment of the present disclosure;
[0023] Figure 2 1 is a flow chart of a multi-speaker audio synchronization method provided by a second embodiment of the present disclosure;
[0024] Figure 3 1 is a schematic structural diagram of a multi-speaker audio synchronization device provided by an embodiment of the present disclosure;
[0025] Figure 4 It is a structural diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0026] Some embodiments of the present disclosure will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. Various changes, modifications and equivalents of the methods, devices and / or systems described herein will become apparent after understanding the present disclosure. For example, the order of operations described herein is merely an example and is not limited to those orders set forth herein, but may be changed as becomes apparent after understanding the present disclosure, except for operations that must be performed in a specific order. In addition, for the sake of clarity and brevity, descriptions of features known in the art may be omitted.
[0027] The embodiments described in the following examples of the present disclosure do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0028] It should be noted that the executor of the multi-speaker audio synchronization method of this embodiment can be a multi-speaker audio synchronization device, which can be configured in any type of electronic device, such as a tablet computer, television, mobile phone, computer, etc., and is not limited here.
[0029] In the embodiments of the present disclosure, the “multi-speaker audio synchronization device” is used as an execution body to execute the “multi-speaker audio synchronization method” for illustration, and no limitation is given herein.
[0030] It should be noted that the order of description of the following embodiments does not limit the priority order of the embodiments.
[0031] Figure 1 4 is a flowchart of a multi-speaker audio synchronization method provided according to the first embodiment of the present disclosure.
[0032] like Figure 1 As shown, the method includes:
[0033] Step 101: Acquire a first audio signal and a second audio signal, wherein one of the first audio signal and the second audio signal is a signal to be played by a built-in speaker of a device, and the other of the first audio signal and the second audio signal is a signal to be played by a wireless speaker.
[0034] For example, if the first audio signal is a signal to be played by the device's built-in speaker, the second audio signal is a signal to be played by the wireless speaker. If the first audio signal is a signal to be played by the wireless speaker, the second audio signal is a signal to be played by the device's built-in speaker.
[0035] As an example, the device in the embodiment of the present disclosure may be a television system, or may be a conference device, etc., which is not limited here.
[0036] Optionally, if the device is a television system, the two audio signals can be acquired separately through the television system's internal audio capture module. If the first audio signal is a signal to be played by the device's built-in speaker, it can be acquired through a channel within the television system specifically configured for audio capture of built-in speakers. If the second audio signal is a signal to be played by a wireless speaker, it can be acquired using an interface within the television system adapted for audio capture of wireless speakers.
[0037] Specifically, you need to ensure that both the built-in speakers and wireless speakers (surround speakers) are properly connected to the corresponding audio playback device and that the device can recognize both speakers. For example, if implementing this feature on a smart TV, you must ensure that the built-in speakers are properly connected to the TV's audio output port and that the wireless speakers are successfully paired with the TV via wireless methods such as Bluetooth and Wi-Fi.
[0038] Step 102: Acquire a third audio signal actually collected by the microphone.
[0039] Optionally, the microphone can be a built-in microphone of the device for sound collection.
[0040] As a possible implementation method, after the built-in speaker plays the first audio signal and the wireless speaker plays the second audio signal, the third audio signal can be collected by the microphone.
[0041] Alternatively, after the built-in speaker plays the second audio signal and the wireless speaker plays the first audio signal, the third audio signal can be collected by the microphone.
[0042] The first audio signal and the second audio signal are signals to be played synchronously, and the third audio signal is a signal actually collected by the microphone when the first audio signal and the second audio signal are played.
[0043] It is understandable that the first audio signal and the second audio signal can be locally stored audio files or online audio streams. The first audio signal and the second audio signal need to be played synchronously by different speakers. For example, the user chooses to play a piece of music, and the music is divided or processed into two-channel audio signals, respectively as the first audio signal and the second audio signal. In addition, when playing the first audio signal and the second audio signal, necessary processing can also be performed on the obtained first audio signal and the second audio signal, such as audio format conversion, volume adjustment, etc., to ensure that the signal can be played normally by the speaker.
[0044] It's understandable that when built-in speakers or wireless speakers play sound, the surrounding air fluctuates with the vibrations of the sound. The microphone's pickup unit senses these air fluctuations and converts them into electrical signals. The sensor inside the microphone converts the sensed sound into an analog audio signal. The voltage changes in this analog signal correspond to the amplitude and frequency of the sound vibrations. The microphone converts the analog audio signal into a digital audio signal for subsequent analysis and processing. During this conversion process, operations such as sampling, quantization, and encoding are performed. Furthermore, the collected digital audio signal may also undergo filtering and noise reduction to improve signal quality.
[0045] It is understood that the processed digital audio signal is the third audio signal, which is stored in an audio playback device or other designated storage medium for subsequent analysis and calculation of the delay between the two speakers to achieve audio synchronization.
[0046] Step 103: Determine delay information between the built-in speaker and the wireless speaker according to the first audio signal, the second audio signal, and the third audio signal.
[0047] Optionally, the first audio signal may be divided into a plurality of time periods according to a preset time length;
[0048] determining a first reference signal according to the first audio signal corresponding to each time period;
[0049] determining a second reference signal from the second audio signal according to a time period of the first reference signal;
[0050] Delay information between the built-in speaker and the wireless speaker is determined based on the first reference signal, the second reference signal, and the third audio signal.
[0051] The preset time length may be 20ms, 15ms, 22ms, etc., which is not limited here.
[0052] It should be noted that, taking 20 ms as an example, the first audio signal may be divided into multiple time periods, each time period corresponding to 20 ms of the first audio signal.
[0053] Optionally, the root mean square value corresponding to the first audio signal in each time period may be determined first, and then the first audio signal corresponding to the maximum root mean square value may be used as the first reference signal.
[0054] Among them, the root mean square value (RMS) can be used to represent the effective value of the signal.
[0055] It is understood that in the embodiment of the present application, the RMS value of the first audio signal is calculated based on a preset time period (e.g., 20ms). By comparing the RMS values of different time periods, the portion with the highest signal strength can be identified. For example, the first audio signal within the period with the maximum RMS value is recorded as the first reference signal for subsequent waveform comparison and delay calculation. This is because the signal characteristics are more obvious in the portion with higher signal strength, which facilitates more accurate analysis and processing.
[0056] The second reference signal may be an audio signal in the second audio signal corresponding to the time of the first reference signal.
[0057] For example, if the first reference signal is the first audio signal corresponding to the time period t1-t2, then the corresponding audio signal may be extracted from the second audio signal in the time period t1-t2 as the second reference signal.
[0058] It should be noted that in a surround audio system, there may be a time difference, or delay, when playing audio between the built-in speakers and wireless speakers due to factors such as wireless interference and system performance fluctuations.
[0059] The delay information may be a specific quantitative result of the time difference between the two speakers playing the audio.
[0060] Specifically, the third audio signal can be divided according to multiple time lengths and then divided into multiple time periods, and then the correlation between the third audio signal and the first reference signal in each time period and the correlation between the third audio signal and the second reference signal in each time period are compared, and then the delay information between the built-in speaker and the wireless speaker is determined based on the respective correlations.
[0061] Step 104: Based on the delay information, control the built-in speaker and the wireless speaker to play audio synchronously.
[0062] The delay parameter refers to the amount of time adjustment for the transmission or playback of an audio signal, which can delay the output or playback of the signal by a certain amount of time from the original time point. For example, if an audio signal is supposed to start playing at 1 second, but a delay parameter of 0.5 seconds is set, it will start playing at 1.5 seconds.
[0063] It is understandable that by adjusting the delay parameters of the built-in speaker or the wireless speaker accordingly, the start time and rhythm of the audio played by the built-in speaker and the wireless speaker can be made consistent, thereby achieving synchronous playback.
[0064] Optionally, based on the delay information, a delay parameter of the built-in speaker may be adjusted so that the adjusted built-in speaker and the wireless speaker play audio synchronously.
[0065] Specifically, the delay parameters of the built-in speaker can be modified based on the obtained delay information. For example, if the wireless speaker is calculated to be 50ms faster than the built-in speaker, the delay parameters of the built-in speaker can be reduced by 50ms. In this way, the built-in speaker will play audio 50ms earlier and synchronize with the wireless speaker.
[0066] Alternatively, the delay parameter of the wireless speaker may be adjusted based on the delay information, so that the adjusted wireless speaker and the built-in speaker play audio synchronously.
[0067] For example, if it is calculated that the built-in speaker is 50ms faster than the wireless speaker, the delay parameter of the built-in speaker can be increased by 50ms, so that the built-in speaker will play audio 50ms later and thus synchronize with the wireless speaker.
[0068] In an embodiment of the present disclosure, a first audio signal and a second audio signal are first acquired, wherein one of the first and second audio signals is a signal to be played by the device's built-in speaker, and the other of the first and second audio signals is a signal to be played by a wireless speaker. A third audio signal actually captured by a microphone is then acquired. Delay information between the built-in speaker and the wireless speaker is determined based on the first, second, and third audio signals. Based on this delay information, the built-in speaker and the wireless speaker are then controlled to play audio synchronously. This allows real-time monitoring and analysis of audio signals, dynamically adjusting the speaker playback delay based on actual conditions. During audio playback, environmental factors, device status, and other factors may change, causing the delay between the speakers to also change. This application can capture these changes in real time and make timely adjustments to ensure consistent synchronization without requiring manual user intervention. By comparing each speaker's reference signal with the audio signal captured by the microphone in real time, the delay between the speakers can be accurately calculated and the delay of the device's built-in speaker can be set in real time, ensuring real-time synchronization of the audio between the speakers and improving the audio experience.
[0069] Figure 2 4 is a flow chart of a multi-speaker audio synchronization method provided according to the second embodiment of the present disclosure.
[0070] like Figure 2 As shown, the method includes:
[0071] Step 201: Acquire a first audio signal and a second audio signal, wherein one of the first audio signal and the second audio signal is a signal to be played by a built-in speaker of a device, and the other of the first audio signal and the second audio signal is a signal to be played by a wireless speaker.
[0072] Step 202: Acquire a third audio signal actually collected by the microphone.
[0073] Step 203: Divide the first audio signal into a plurality of time periods according to a preset time length.
[0074] Step 204: Determine a first reference signal according to the first audio signal corresponding to each time period.
[0075] Step 205: Determine a second reference signal from the second audio signal according to the time period of the first reference signal.
[0076] It should be noted that the specific implementation of steps 201-205 can refer to the above embodiment and will not be described in detail here.
[0077] Step 206: Divide the third audio signal into a plurality of time periods according to a preset time length.
[0078] The preset time length may be 20ms, 15ms, 22ms, etc., which is not limited here.
[0079] It should be noted that, taking 20 ms as an example, the third audio signal may be divided into a plurality of time periods, each time period corresponding to a 20 ms third audio signal.
[0080] Step 207: Determine a first correlation between the third audio signal and the first reference signal in each time period.
[0081] The first correlation may be a correlation between the third audio signal and the first reference signal corresponding to a single time period.
[0082] Optionally, the first correlation between the third audio signal and the first reference signal in each time period may be calculated by a waveform comparison method, a cross-correlation function method, a cosine similarity method, or the like.
[0083] A waveform is a graph of a signal's changes over time. Waveform comparison involves comparing the waveforms of two or more signals, analyzing their similarities or differences in shape, amplitude, phase, and other aspects. If the waveforms of two signals are very similar, they are highly correlated. Conversely, if the waveforms differ significantly, the correlation is low.
[0084] The cross-correlation function is used to measure the similarity between two signals at different time offsets. For discrete signals, it reflects the correlation by calculating the cumulative sum of the products of the corresponding samples of the two signals at different relative positions.
[0085] Cosine similarity measures the similarity between two vectors by calculating the cosine of the angle between them. In audio signal processing, the first reference signal and the third audio signal within a certain time period can be considered as two vectors in a vector space, and their correlation can be determined by calculating their cosine similarity.
[0086] Step 208: Determine a second correlation between the third audio signal and the second reference signal in each time period.
[0087] The second correlation may be a correlation between the third audio signal and the second reference signal corresponding to a single time period.
[0088] It should be noted that the second correlation between the third audio signal and the second reference signal in each time period may also be calculated by using a waveform comparison method, a cross-correlation function method, a cosine similarity method, or the like.
[0089] Step 209 : Determine the delay information between the built-in speaker and the wireless speaker according to the first correlation and the second correlation.
[0090] Optionally, when the value of any first correlation is the maximum value among all the first correlations, the time period corresponding to any first correlation can be determined as the first time period, and when the value of any second correlation is the maximum value among all the second correlations, the time period corresponding to any second correlation can be determined as the second time period. Then, based on the second time period and the first time period, the delay information between the built-in speaker and the wireless speaker is determined.
[0091] For example, the third audio signal is divided into five time periods, numbered 1, 2, 3, 4, and 5. The first correlations between the third audio signal and the first reference signal in each time period are 0.4, 0.9, 0.23, 0.7, and 0.6, respectively. The first correlation data show that the first correlation value of 0.9 for time period "2" is the maximum among all the first correlations. Therefore, time period "2" is determined as the first time period. Similarly, the second time period can be determined based on the second correlation data in the same manner.
[0092] Furthermore, if the number corresponding to the second time period is "3" and the number corresponding to the first time period is "2", and if each time period is 20 ms, it means that the difference between the second time period and the first time period is 20 ms.
[0093] It should be noted that if the first reference signal represents the audio signal corresponding to the built-in speaker and the second reference signal represents the audio signal corresponding to the wireless speaker, then the first time period corresponds to the built-in speaker and the second time period corresponds to the wireless speaker. The second time period is one time period different from the first time period. The delay information between the built-in speaker and the wireless speaker is 20ms, which means that the wireless speaker plays audio 20ms later than the built-in speaker. Subsequently, the delay parameters (or playback time) of the wireless speaker or the built-in speaker can be adjusted according to this delay information to achieve synchronous playback.
[0094] If the first time period differs from the second time period by one time period, it means that the built-in speaker plays audio 20ms later than the wireless speaker. Subsequently, the delay parameters (or playback time) of the wireless speaker or the built-in speaker can be adjusted according to this delay information to achieve synchronous playback.
[0095] Step 210: Based on the delay information, control the built-in speaker and the wireless speaker to play audio synchronously.
[0096] It should be noted that the specific implementation of step 210 can refer to the above embodiment and will not be described in detail here.
[0097] In an embodiment of the present disclosure, a first audio signal and a second audio signal are first acquired, wherein one of the first and second audio signals is a signal to be played by a built-in speaker of a device, and the other of the first and second audio signals is a signal to be played by a wireless speaker. A third audio signal actually collected by a microphone is then acquired. The first audio signal is then divided into a plurality of time periods according to a preset time length. A first reference signal is then determined based on the first audio signal corresponding to each time period. A second reference signal is then determined from the second audio signal based on the time period in which the first reference signal occurs. The third audio signal is then divided into a plurality of time periods according to a preset time length. A first correlation is then determined between the third audio signal and the first reference signal for each time period. A second correlation is then determined between the third audio signal and the second reference signal for each time period. Finally, based on each of the first and second correlations, delay information between the built-in speaker and the wireless speaker is determined. Thus, by calculating the first and second correlations to determine the delay information, the time difference between the built-in speaker and the wireless speaker can be accurately determined, allowing for precise synchronization and better fusion of the sounds emitted by the different speakers. Furthermore, the audio signal can be monitored in real time, and the delay can be dynamically adjusted based on environmental changes and device status. During use, the system automatically keeps the speakers synchronized without manual user intervention, ensuring stable, high-quality audio effects at all times.
[0098] To facilitate better implementation of the multi-speaker audio synchronization method disclosed herein, the present disclosure also provides a multi-speaker audio synchronization device based on the multi-speaker audio synchronization method. The meanings of the terms herein are the same as those in the multi-speaker audio synchronization method described above. For specific implementation details, please refer to the description in the method embodiment.
[0099] See also Figure 3 , Figure 3 : is a schematic structural diagram of a multi-speaker audio synchronization device provided by an embodiment of the present disclosure. The multi-speaker audio synchronization device 300 includes:
[0100] A first acquisition module 310 is configured to acquire a first audio signal and a second audio signal, wherein one of the first audio signal and the second audio signal is a signal to be played by a built-in speaker of the device, and the other of the first audio signal and the second audio signal is a signal to be played by a wireless speaker;
[0101] A second acquisition module 320 is configured to acquire a third audio signal actually collected by the microphone;
[0102] a determination module 330, configured to determine delay information between the built-in speaker and the wireless speaker based on the first audio signal, the second audio signal, and the third audio signal;
[0103] The control module 340 is configured to control the built-in speaker and the wireless speaker to play audio synchronously based on the delay information.
[0104] In an embodiment of the present disclosure, a first audio signal and a second audio signal are first obtained, wherein one of the first audio signal and the second audio signal is a signal to be played by the device's built-in speaker, and the other of the first audio signal and the second audio signal is a signal to be played by the wireless speaker. Then, a third audio signal actually collected by the microphone is obtained, and then the delay information between the built-in speaker and the wireless speaker is determined based on the first audio signal, the second audio signal and the third audio signal. Then, based on the delay information, the built-in speaker and the wireless speaker are controlled to play audio synchronously. In this way, the audio signal can be monitored and analyzed in real time, and the playback delay of the speaker can be dynamically adjusted according to the actual situation. During the audio playback process, environmental factors, device status, etc. may change, causing the delay between the speakers to change accordingly. The present application can capture these changes in real time and make timely adjustments to ensure that a good synchronization effect is always maintained without manual intervention by the user.
[0105] In addition, the present disclosure also provides an electronic device, such as Figure 4 , which shows a schematic structural diagram of the electronic device involved in the present disclosure, specifically:
[0106] The electronic device may include one or more processing core processors 401, one or more computer-readable storage media memories 402, a power supply 403, an input unit 404 and other components. Those skilled in the art will understand that Figure 4 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange components differently.
[0107] Processor 401 is the control center of the electronic device, connecting the various parts of the entire electronic device using various interfaces and lines. By running or executing software programs and / or modules stored in memory 402 and accessing data stored in memory 402, it performs various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. Optionally, processor 401 may include one or more processing cores; preferably, processor 401 may integrate an application processor and a modem processor, wherein the application processor primarily processes the operating system, user interface, and application programs, while the modem processor primarily handles wireless communications. It is understood that the modem processor may not be integrated into processor 401.
[0108] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
[0109] The electronic device also includes a power supply 403 for supplying power to various components. Preferably, the power supply 403 can be logically connected to the processor 401 via a power management system, thereby enabling the power management system to manage charging, discharging, and power consumption. The power supply 403 can also include one or more DC or AC power supplies, a recharging system, a power supply device debugging circuit, a power converter or inverter, a power status indicator, and other arbitrary components.
[0110] The electronic device may further include an input unit 404, which may be configured to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0111] Although not shown, the electronic device may further include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 401 in the electronic device loads the executable files corresponding to one or more application processes into the memory 402 according to the following instructions, and the processor 401 runs the application stored in the memory 402, thereby implementing the steps of any of the multi-speaker audio synchronization methods provided in the embodiments of the present disclosure.
[0112] In an embodiment of the present disclosure, a first audio signal and a second audio signal are first obtained, wherein one of the first audio signal and the second audio signal is a signal to be played by the device's built-in speaker, and the other of the first audio signal and the second audio signal is a signal to be played by the wireless speaker. Then, a third audio signal actually collected by the microphone is obtained, and then the delay information between the built-in speaker and the wireless speaker is determined based on the first audio signal, the second audio signal and the third audio signal. Then, based on the delay information, the built-in speaker and the wireless speaker are controlled to play audio synchronously. In this way, the audio signal can be monitored and analyzed in real time, and the playback delay of the speaker can be dynamically adjusted according to the actual situation. During the audio playback process, environmental factors, device status, etc. may change, causing the delay between the speakers to change accordingly. The present application can capture these changes in real time and make timely adjustments to ensure that a good synchronization effect is always maintained without manual intervention by the user.
[0113] The specific implementation of the above operations can be found in the previous embodiments and will not be repeated here.
[0114] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be accomplished by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0115] To this end, the present disclosure provides a computer-readable storage medium having a computer program stored thereon. The computer program can be loaded by a processor to execute the steps of any multi-speaker audio synchronization method provided in the present disclosure.
[0116] The specific implementation of the above operations can be found in the previous embodiments and will not be repeated here.
[0117] The computer-readable storage medium may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0118] Since the instructions stored in the computer-readable storage medium can execute the steps in any multi-speaker audio synchronization method provided in the present disclosure, the beneficial effects that can be achieved by any multi-speaker audio synchronization method provided in the present disclosure can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0119] The above is a detailed introduction to the multi-speaker audio synchronization method, device, electronic device and computer-readable storage medium provided by the present disclosure. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core ideas. At the same time, for those skilled in the art, according to the ideas of the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the contents of this specification should not be understood as limiting the present invention.
Claims
1. A method for synchronizing audio of multiple speakers, characterized in that: include: Obtaining a first audio signal and a second audio signal, wherein one of the first audio signal and the second audio signal is a signal to be played by a built-in speaker of the device, and the other of the first audio signal and the second audio signal is a signal to be played by a wireless speaker; Acquiring a third audio signal actually collected by the microphone; determining delay information between the built-in speaker and the wireless speaker according to the first audio signal, the second audio signal, and the third audio signal; Based on the delay information, the built-in speaker and the wireless speaker are controlled to play audio synchronously.
2. The method according to claim 1, characterized in that The determining, according to the first audio signal, the second audio signal, and the third audio signal, delay information between the built-in speaker and the wireless speaker includes: Dividing the first audio signal into a plurality of time periods according to a preset time length; determining a first reference signal according to the first audio signal corresponding to each of the time periods; determining a second reference signal from the second audio signal according to a time period of the first reference signal; Delay information between the built-in speaker and the wireless speaker is determined based on the first reference signal, the second reference signal, and the third audio signal.
3. The method according to claim 2, characterized in that The determining the first reference signal according to the first audio signals corresponding to the respective time periods includes: determining a root mean square value corresponding to the first audio signal in each of the time periods; The first audio signal corresponding to the maximum root mean square value is used as a first reference signal.
4. The method according to claim 2, characterized in that The determining, based on the first reference signal, the second reference signal, and the third audio signal, delay information between the built-in speaker and the wireless speaker includes: Dividing the third audio signal into a plurality of time periods according to the preset time length; determining a first correlation between the third audio signal and the first reference signal in each of the time periods; determining a second correlation between the third audio signal and the second reference signal for each of the time periods; Delay information between the built-in speaker and the wireless speaker is determined according to the first correlations and the second correlations.
5. The method according to claim 4, characterized in that The determining, according to each of the first correlations and the second correlations, delay information between the built-in speaker and the wireless speaker includes: When the value of any first correlation degree is the maximum value among the first correlation degrees, determining the time period corresponding to the any first correlation degree as the first time period; When the value of any second correlation degree is the maximum value among the second correlation degrees, determining the time period corresponding to the any second correlation degree as the second time period; Delay information between the built-in speaker and the wireless speaker is determined according to the second time period and the first time period.
6. The method according to claim 1, characterized in that The step of controlling the built-in speaker and the wireless speaker to synchronously play audio based on the delay information includes: Adjusting a delay parameter of the built-in speaker based on the delay information so that the built-in speaker and the wireless speaker play audio synchronously after the adjustment; or, Based on the delay information, the delay parameter of the wireless speaker is adjusted so that the adjusted wireless speaker and the built-in speaker play audio synchronously.
7. The method according to claim 1, characterized in that The obtaining of the third audio signal actually collected by the device through the microphone includes: In response to the built-in speaker playing the first audio signal and the wireless speaker playing the second audio signal, collecting the third audio signal through the microphone; or, In response to the built-in speaker playing the second audio signal and the wireless speaker playing the first audio signal, the microphone collects the third audio signal, The first audio signal and the second audio signal are signals to be played synchronously, and the third audio signal is a signal actually collected by the microphone when the first audio signal and the second audio signal are played.
8. A multi-speaker audio synchronization device, characterized in that: include: A first acquisition module is configured to acquire a first audio signal and a second audio signal, wherein one of the first audio signal and the second audio signal is a signal to be played by a built-in speaker of the device, and the other of the first audio signal and the second audio signal is a signal to be played by a wireless speaker; A second acquisition module is used to acquire a third audio signal actually collected by the microphone; a determining module, configured to determine delay information between the built-in speaker and the wireless speaker based on the first audio signal, the second audio signal, and the third audio signal; The control module is used to control the built-in speaker and the wireless speaker to play audio synchronously based on the delay information.
9. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 7.