Audio signal processing methods, devices, storage media and electronic equipment
By introducing signal sampling, multi-task processing, and signal output modules into the target device group, and employing timing and delay mechanisms, the problem of inconsistent audio signal output delay in multi-functional devices was solved, achieving synchronized audio output from different devices and improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-26
- Publication Date
- 2026-03-10
AI Technical Summary
In multifunctional electronic devices, the processor needs to handle multiple tasks simultaneously, resulting in inconsistent audio signal output delays and causing different devices to be unable to output audio signals synchronously.
By introducing a signal sampling module, a multi-task processing module, and a signal output module into the target device group, and employing timing and delay mechanisms, the audio signal is ensured to be output uniformly after a preset delay duration, and time synchronization is achieved through a playback buffer module and a synchronization processing module.
It effectively ensures the time consistency of audio signals in different devices, realizes the synchronous output of audio signals emitted from the same signal source, and improves the user experience.
Smart Images

Figure CN115696546B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of audio signal processing, and more specifically, to an audio signal processing method, apparatus, storage medium, and electronic device. Background Technology
[0002] With the development of electronic technology, electronic devices are no longer limited to a single function but are now diverse and feature-rich. The amount of data that processors need to handle is becoming increasingly complex. Furthermore, users have higher demands for audio signal playback quality. Therefore, it's increasingly rare to directly output received audio signals without processing them. Instead, processors (or control devices) need to perform noise reduction, filtering, frequency modulation, encoding, and decoding on the received audio signals before outputting them. When the processor handling the audio signal has multiple functions, it may be processing data from other functions when the audio signal is received. This inevitably introduces a delay in the audio signal output process. When different devices (each with a processor, such as two headphones, each with a controller) need to simultaneously output the received audio signal, the different processors on each device may have different numbers of tasks to perform, and the time required to perform each task may also differ. Therefore, the resulting delays will vary, easily leading to asynchronous output. Summary of the Invention
[0003] The purpose of this disclosure is to provide an audio signal processing method, apparatus, storage medium, and electronic device.
[0004] To achieve the above objectives, a first aspect of this disclosure provides an audio signal processing method applied to target devices in a target device group, the target device group including at least two of the target devices, for synchronously playing audio signals emitted from the same signal source. Each target device includes a signal sampling module, a multi-task processing module, and a signal output module; the signal sampling module is connected to the signal output module through the multi-task processing module. The method includes:
[0005] If a first audio signal is acquired by the signal sampling module during the current sampling period, timing begins, and the acquired first audio signal is sent to the multi-task processing module; the multi-task processing module is used to process the received data sequentially, and if the received data is the first audio signal, the first audio signal is sent to the signal output module;
[0006] When the timing duration reaches the preset delay duration, the first audio signal is sent to the signal output module through the multi-task processing module;
[0007] The first audio signal is output through the signal output module.
[0008] Optionally, the target device further includes a playback buffer module, and the method further includes:
[0009] The playback buffer module buffers the second audio signal, which includes any one of the following: a Bluetooth audio signal received through the Bluetooth module, a locally stored local audio signal, and an interface audio signal received through a preset audio signal interface.
[0010] The first audio signal and the buffered second audio signal are time-synchronized to obtain the second audio signal after time synchronization.
[0011] The signal output module is controlled to read the time-synchronized second audio signal from the playback buffer module and mix the time-synchronized second audio signal with the first audio signal for output.
[0012] Optionally, buffering the second audio signal through the playback buffer module includes:
[0013] If the second audio signal is a Bluetooth audio signal, and the Bluetooth audio signal is received through the Bluetooth module, then the Bluetooth audio signal is buffered through the playback buffer module; or...
[0014] If the second audio signal is an interface audio signal, and the interface audio signal is received through the preset audio signal interface, then the interface audio signal is buffered by the playback buffer module; or...
[0015] If the second audio signal is a local audio signal, and a playback command corresponding to the local audio signal is received, the local audio signal is buffered by the playback buffer module.
[0016] Optionally, the signal output module is configured to output the first audio signal according to a first-in-first-out principle after buffering the first audio signal of a preset length. The step of performing time synchronization processing on the first audio signal and the buffered second audio signal to obtain a time-synchronized second audio signal includes:
[0017] When sending the first frame of audio data of the second audio signal to the playback buffer module, the current buffer duration of the signal output module is obtained;
[0018] Delete the target audio data corresponding to the buffer duration in the playback buffer module, wherein the starting frame of the target audio data is the first frame of audio data;
[0019] The remaining audio data in the playback buffer module, excluding the target audio data, is used as the second audio signal after time synchronization processing.
[0020] Optionally, obtaining the current buffer duration of the signal output module includes:
[0021] Obtain the data length of the currently buffered data in the signal output module;
[0022] The cache duration is determined based on the data length.
[0023] Optionally, the multi-task processing module includes a data processing module and a target buffer module connected to the data processing module; the data processing module is used to send the first audio signal to the target buffer module when the received data is the first audio signal, and the target buffer module is used to buffer the first audio signal;
[0024] When the timing duration reaches the preset delay duration, the first audio signal is sent to the signal output module through the multi-task processing module, including:
[0025] When the timing duration reaches the preset delay duration, the first audio signal is sent to the signal output module through the target buffer module in the multi-task processing module.
[0026] A second aspect of this disclosure provides an audio signal processing apparatus applied to target devices in a target device group, the target device group including at least two of the target devices, for synchronously playing audio signals emitted from the same signal source. Each target device includes a signal sampling module, a multi-task processing module, and a signal output module; the signal sampling module is connected to the signal output module via the multi-task processing module. The apparatus includes:
[0027] A timing module is used to start timing when a first audio signal is acquired by the signal sampling module in the current sampling period, and to send the acquired first audio signal to the multi-task processing module; the multi-task processing module is used to process the received data sequentially, and when the received data is the first audio signal, to send the first audio signal to the signal output module;
[0028] The delayed transmission module is used to send the first audio signal to the signal output module through the multi-task processing module when the timing duration reaches the preset delay duration;
[0029] An output module is used to output the first audio signal through the signal output module.
[0030] Optionally, the target device further includes a playback buffer module, and the apparatus further includes:
[0031] A signal buffer module is used to buffer a second audio signal through the playback buffer module. The second audio signal includes any one of the following: a Bluetooth audio signal received through the Bluetooth module, a locally stored local audio signal, and an interface audio signal received through a preset audio signal interface.
[0032] The synchronization module is used to perform time synchronization processing on the first audio signal and the buffered second audio signal to obtain the time-synchronized second audio signal;
[0033] The mixing module is used to control the signal output module to read the time-synchronized second audio signal from the playback buffer module, and to mix the time-synchronized second audio signal with the first audio signal for output.
[0034] Optionally, the signal buffer module is used for:
[0035] If the second audio signal is a Bluetooth audio signal, and the Bluetooth audio signal is received through the Bluetooth module, then the Bluetooth audio signal is buffered through the playback buffer module; or...
[0036] If the second audio signal is an interface audio signal, and the interface audio signal is received through the preset audio signal interface, then the interface audio signal is buffered by the playback buffer module; or...
[0037] If the second audio signal is a local audio signal, and a playback command corresponding to the local audio signal is received, the local audio signal is buffered by the playback buffer module.
[0038] Optionally, the signal output module is configured to output the first audio signal according to a first-in-first-out principle after buffering the first audio signal of a preset length, and the synchronization module is configured to:
[0039] When sending the first frame of audio data of the second audio signal to the playback buffer module, the current buffer duration of the signal output module is obtained;
[0040] Delete the target audio data corresponding to the buffer duration in the playback buffer module, wherein the starting frame of the target audio data is the first frame of audio data;
[0041] The remaining audio data in the playback buffer module, excluding the target audio data, is used as the second audio signal after time synchronization processing.
[0042] Optionally, the synchronization module is used for:
[0043] Obtain the data length of the currently buffered data in the signal output module;
[0044] The cache duration is determined based on the data length.
[0045] Optionally, the multi-task processing module includes a data processing module and a target buffer module connected to the data processing module; the data processing module is used to send the target audio output to the target buffer module when the received data is the first audio signal, the target buffer module is used to buffer the first audio signal, and the delayed transmission module is used to:
[0046] When the timing duration reaches the preset delay duration, the first audio signal is sent to the signal output module through the target buffer module in the multi-task processing module.
[0047] A third aspect of this disclosure provides a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the steps of the method described in the first aspect above.
[0048] A fourth aspect of this disclosure provides an electronic device comprising:
[0049] A memory on which computer programs are stored;
[0050] A processor for executing the computer program in the memory to implement the steps of the method described in the first aspect above.
[0051] The above technical solution, when synchronously playing audio signals emitted from the same signal source through target devices in a target device group, can start timing when the first audio signal is acquired by the signal sampling module in the current sampling period, and send the acquired first audio signal to the multi-task processing module; when the timing duration reaches the preset delay duration, the first audio signal is sent to the signal output module through the multi-task processing module; and the first audio signal is output through the signal output module. In this way, sending the first audio signal to the signal output module through the multi-task processing module when the timing duration reaches the preset delay duration effectively ensures that the audio signal reaches the signal output module at a consistent time in different target devices, thereby effectively ensuring synchronous output of audio signals emitted from the same signal source by different target devices.
[0052] Other features and advantages of this disclosure will be described in detail in the following detailed description section. Attached Figure Description
[0053] The accompanying drawings are provided to further illustrate the present disclosure and form part of the specification. They are used together with the following detailed description to explain the present disclosure, but do not constitute a limitation thereof. In the drawings:
[0054] Figure 1 This is a flowchart illustrating an audio signal processing method according to an exemplary embodiment of the present disclosure;
[0055] Figure 2 This is a schematic diagram illustrating an application scenario of an exemplary embodiment of this disclosure;
[0056] Figure 3 It is based on Figure 1 The illustrated embodiment presents a flowchart of an audio signal processing method;
[0057] Figure 4 This is a block diagram illustrating an audio signal processing apparatus according to an exemplary embodiment of the present disclosure;
[0058] Figure 5 It is based on Figure 4 The illustrated embodiment shows a block diagram of an audio signal processing apparatus;
[0059] Figure 6 This is a block diagram illustrating an electronic device according to an exemplary embodiment. Detailed Implementation
[0060] The specific embodiments of this disclosure will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit this disclosure.
[0061] Before detailing the specific embodiments of this disclosure, the application scenarios of this disclosure are described below. This disclosure can be applied to scenarios where audio signals emitted from the same signal source are played synchronously by target devices in a target device group. Furthermore, the target device includes functions other than processing the audio signal (e.g., noise reduction, filtering, encoding, decoding, etc.). (For example, in the case of a headset, these other functions may include answering and hanging up phone calls, volume adjustment, or song switching.) The target device lacks a dedicated real-time audio signal processing module and does not input, process, or output the received audio signal in real time. Because the processor (or control device) that processes audio signals needs to process data from multiple functions simultaneously, when the audio signal is received, the processor may be processing data from other functions. Thus, the process of outputting the audio signal will inevitably introduce a delay. When it is necessary to ensure that different target devices (each target device has a processor, for example, two headphones, each with a controller) output the received audio signal simultaneously, the number of tasks to be executed may be different, and the time required to execute each task may also be different, resulting in different delays. Therefore, it is easy for the phenomenon of asynchronous output to occur.
[0062] To address the aforementioned technical problems, this disclosure provides an audio signal processing method, apparatus, storage medium, and electronic device. When target devices in a target device group synchronously play audio signals emitted from the same signal source, each device in the target device group does not need to know if other devices are present, and communication between devices is unnecessary. Upon acquiring a first audio signal through the signal sampling module during the current sampling period, timing begins, and the acquired first audio signal is sent to the multi-task processing module. When the timing duration reaches a preset delay, the first audio signal is sent to the signal output module through the multi-task processing module, and then output through the signal output module. Thus, by sending the first audio signal to the signal output module through the multi-task processing module when the timing duration reaches the preset delay, the time it takes for the audio signal to reach the signal output module is consistent across different target devices, thereby effectively ensuring synchronous output of audio signals from the same signal source by different target devices.
[0063] The present disclosure will now be described in conjunction with specific embodiments.
[0064] Figure 1 This is a flowchart illustrating an audio signal processing method according to an exemplary embodiment of this disclosure; see also Figure 1 This method can be applied to, for example Figure 2 The target device in the target device group shown includes at least two such target devices for synchronously playing audio signals emitted from the same signal source. Each target device includes a signal sampling module 201, a multi-task processing module 202, and a signal output module 203. The signal sampling module 201 is connected to the signal output module 203 via the multi-task processing module 202. The method may include the following steps:
[0065] Step 101: If the first audio signal is acquired by the signal sampling module during the current sampling period, start timing and send the acquired first audio signal to the multi-task processing module.
[0066] The multitasking module is used to process the received data sequentially, and when the received data is the first audio signal, it sends the first audio signal to the signal output module.
[0067] It should be noted that the above-mentioned sequential processing of received data can be performed according to the time sequence of the received data. Each target device in the target device group can have its own clock, that is, different target devices can have different clocks. The signal sampling module can be a microphone, and the multi-task processing module can be a controller shared by multiple functions in the target device. Accordingly, the data received by the multi-task processing module can be the first audio signal data, and can also include data corresponding to other functions.
[0068] For example, when the target device is a headset, the multiple functions may include functions other than receiving and processing audio signals. These other functions may be at least one of answering / hanging up a call, adjusting volume, or switching songs. Accordingly, the data received by the multitasking module may include the audio signal data collected by the microphone, and may also include at least one of the control signal data corresponding to answering / hanging up a call, adjusting volume, and switching songs.
[0069] Step 102: When the timing duration reaches the preset delay duration, the first audio signal is sent to the signal output module through the multi-task processing module.
[0070] The preset delay duration can be determined based on the delay duration within a historical time period of the multitasking module. For example, the preset delay duration can be set to the longest delay duration generated within the historical time period. The multitasking module may include a data processing module and a target buffer module connected to the data processing module. The target buffer module is used to buffer the first audio signal. For example, the data processing module may be a DMA data transfer module, and the target buffer module may be a microphone signal buffer module used to buffer the audio signal acquired by the microphone. By setting this target buffer module, it can be ensured that the audio data is transmitted to the signal output module at the preset delay duration, guaranteeing accurate and reliable execution time and effectively ensuring synchronous output of the audio data.
[0071] In one possible implementation, the data processing module can be used to perform filtering, noise reduction, frequency modulation, and other sound quality alterations on the first audio signal. After processing by the data processing module, the first audio signal is sent to the target buffer module for buffering. When the timing duration reaches a preset delay duration, the first audio signal is sent to the signal output module through the target buffer module in the multi-task processing module. Thus, since timing begins when the first audio signal is acquired by the signal sampling module in the current sampling period, and the first audio signal is sent to the signal output module when the timing duration reaches the preset delay duration, even if a delay occurs during the processing of the first audio signal by the data processing module, the preset delay duration is relatively long compared to the delay caused by the data processing module's processing of the first audio signal. Therefore, it can be ensured that the first audio signal has been buffered in the target buffer module before the timing duration reaches the preset delay duration, effectively guaranteeing that the first audio signal can be output when the timing duration reaches the preset delay duration.
[0072] In another possible implementation, the data processing module can be used to, when the received data is the first audio signal, not to process the first audio signal in any way, but to directly send the first audio signal to the target buffer module for buffering. When the timing duration reaches a preset delay duration, the first audio signal is sent to the signal output module through the target buffer module in the multi-task processing module. In this way, since the timing starts when the first audio signal is acquired by the signal sampling module in the current sampling period, and the first audio signal is sent to the signal output module when the timing duration reaches the preset delay duration, even if the data processing module does not process the first audio signal (i.e., no delay occurs during the data processing module stage), the delay duration still needs to be guaranteed to reach the preset delay duration. Therefore, it can effectively ensure that the first audio signal is output when the preset delay duration is reached. Thus, even if other target devices experience delays while the data processing module processes the first audio signal, they can still output the first audio signal simultaneously with other target devices.
[0073] Step 103: Output the first audio signal through the signal output module.
[0074] The signal output module can be a DAC (digital-to-analog converter) memory, for example, a DAC FIFO (First Input First Output).
[0075] In this step, after receiving the first audio signal sent by the multitasking module, the first audio signal is output (played) according to the first-in-first-out principle.
[0076] The above technical solution, when the timing duration reaches the preset delay duration, sends the first audio signal to the signal output module through the multi-task processing module, which can effectively ensure that the audio signal is transmitted to the signal output module at the same time in different target devices, thereby effectively ensuring that different target devices output audio signals emitted from the same signal source synchronously.
[0077] In the above Figure 1 After outputting the first audio signal through the signal output module as described in step 103, the method may further include the following: Figure 3 ( Figure 3 It is based on Figure 1 The illustrated embodiment presents a flowchart of an audio signal processing method; the mixed audio process is shown in the diagram.
[0078] Step 104: Buffer the second audio signal through the playback buffer module.
[0079] The target device also includes a playback buffer module, and the second audio signal includes any one of the following: a Bluetooth audio signal received through the Bluetooth module, a locally stored local audio signal, and an interface audio signal received through a preset audio signal interface.
[0080] In this step, if the second audio signal is a Bluetooth audio signal, and the Bluetooth audio signal is received through the Bluetooth module, then the Bluetooth audio signal is buffered through the playback buffer module; or, if the second audio signal is an interface audio signal, and the interface audio signal is received through the preset audio signal interface, then the interface audio signal is buffered through the playback buffer module; or, if the second audio signal is a local audio signal, and a playback command corresponding to the local audio signal is received, then the local audio signal is buffered through the playback buffer module.
[0081] Step 105: Perform time synchronization processing on the first audio signal and the buffered second audio signal to obtain the time-synchronized second audio signal.
[0082] In this step, the second audio signal after time synchronization processing can be obtained by following the steps S1 to S3:
[0083] S1, when the first frame of audio data of the second audio signal is sent to the playback buffer module, the current buffer duration of the signal output module is obtained.
[0084] One possible method for obtaining the current buffer duration of the signal output module is to: obtain the data length of the current buffered data of the signal output module; and determine the buffer duration based on the data length.
[0085] S2, delete the target audio data corresponding to the buffer duration in the playback buffer module.
[0086] The starting frame of the target audio data is the first frame of audio data.
[0087] S3, the remaining audio data in the playback buffer module other than the target audio data is used as the second audio signal after time synchronization processing.
[0088] For example, at time T0 (T0 is the agreed-upon simultaneous playback time for different target devices in the target device group), the Bluetooth module starts sending the first frame of Bluetooth audio data to the playback buffer module. If the data buffered by the signal output module (which can be a DAC FIFO) can play for 1ms at this time, the Bluetooth audio data in the playback buffer module for 1ms starting from the first frame of Bluetooth audio data can be discarded. In this way, the remaining audio data after 1ms will be output from the signal output module at time T0+1ms, enabling the second audio signal (Bluetooth audio signal) to be played synchronously by different target devices in the target device group.
[0089] Step 106: Control the signal output module to read the time-synchronized second audio signal from the playback buffer module, and mix the time-synchronized second audio signal with the first audio signal for output.
[0090] The signal output module is used to output the first audio signal according to the first-in-first-out principle after buffering the first audio signal of a preset length.
[0091] The above technical solution enables the asynchronously input first audio signal and the asynchronously input second audio signal to be output synchronously for different target devices within the target device group, avoiding misaligned playback of the second audio signal in different target devices, thereby effectively improving the user experience.
[0092] Figure 4 This is a block diagram illustrating an audio signal processing apparatus according to an exemplary embodiment of this disclosure; see also Figure 4 The audio signal processing device can be applied to target devices in a target device group, which includes at least two such target devices, for synchronously playing audio signals emitted from the same signal source. Each target device includes a signal sampling module, a multi-task processing module, and a signal output module. The signal sampling module is connected to the signal output module via the multi-task processing module. The device may include:
[0093] The timing module 401 is used to start timing when the first audio signal is acquired by the signal sampling module in the current sampling period, and to send the acquired first audio signal to the multi-task processing module; the multi-task processing module is used to process the received data in sequence, and when the received data is the first audio signal, to send the first audio signal to the signal output module;
[0094] The delayed transmission module 402 is used to send the first audio signal to the signal output module through the multi-task processing module when the timing duration reaches the preset delay duration;
[0095] Output module 403 is used to output the first audio signal through the signal output module.
[0096] The above technical solution, when the timing duration reaches the preset delay duration, sends the first audio signal to the signal output module through the multi-task processing module, which can effectively ensure that the audio signal is transmitted to the signal output module at the same time in different target devices, thereby effectively ensuring that different target devices output audio signals emitted from the same signal source synchronously.
[0097] Figure 5 It is based on Figure 4 The illustrated embodiment shows a block diagram of an audio signal processing apparatus; see also Figure 5 The target device also includes a playback buffer module, and the device may further include:
[0098] The signal buffer module 404 is used to buffer a second audio signal through the playback buffer module. The second audio signal includes any one of the Bluetooth audio signal received through the Bluetooth module, the local audio signal stored locally, and the interface audio signal received through the preset audio signal interface.
[0099] The synchronization module 405 is used to perform time synchronization processing on the first audio signal and the buffered second audio signal to obtain the time-synchronized second audio signal;
[0100] The mixing module 406 is used to control the signal output module to read the time-synchronized second audio signal from the playback buffer module and mix the time-synchronized second audio signal with the first audio signal for output.
[0101] Optionally, the signal buffer module 404 is used for:
[0102] If the second audio signal is a Bluetooth audio signal, and the Bluetooth audio signal is received through the Bluetooth module, then the Bluetooth audio signal is buffered through the playback buffer module; or,
[0103] If the second audio signal is an interface audio signal, and the interface audio signal is received through the preset audio signal interface, then the interface audio signal is buffered by the playback buffer module; or,
[0104] If the second audio signal is a local audio signal, and a playback command corresponding to the local audio signal is received, the local audio signal is buffered by the playback buffer module.
[0105] Optionally, the signal output module is used to output the first audio signal according to the first-in-first-out principle after buffering the first audio signal of a preset length, and the synchronization module is used to:
[0106] When the first frame of audio data of the second audio signal is sent to the playback buffer module, the current buffer duration of the signal output module is obtained;
[0107] Delete the target audio data corresponding to the buffer duration in the playback buffer module, wherein the starting frame of the target audio data is the first frame of audio data;
[0108] The remaining audio data in the playback buffer module, excluding the target audio data, is used as the second audio signal after time synchronization processing.
[0109] Optionally, the synchronization module 405 is used for:
[0110] Get the length of the currently buffered data in the signal output module;
[0111] The cache duration is determined based on the data length.
[0112] The above technical solution enables the asynchronously input first audio signal and the asynchronously input second audio signal to be output synchronously for different target devices within the target device group, avoiding misaligned playback of the second audio signal in different target devices, thereby effectively improving the user experience.
[0113] Optionally, the multitasking processing module includes a data processing module and a target buffer module connected to the data processing module; the data processing module is used to send the target audio output to the target buffer module when the received data is the first audio signal, and the target buffer module is used to buffer the first audio signal; the delayed transmission module 402 is used to:
[0114] When the timing duration reaches the preset delay duration, the first audio signal is sent to the signal output module through the target buffer module in the multi-task processing module.
[0115] The above technical solution, when the timing duration reaches the preset delay duration, sends the first audio signal to the signal output module through the target buffer module in the multi-task processing module. This can effectively ensure that the audio signal is transmitted to the signal output module at the same time in different target devices, thereby effectively ensuring that different target devices output audio signals emitted from the same signal source synchronously.
[0116] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0117] Figure 6This is a block diagram illustrating an electronic device according to an exemplary embodiment. Figure 6 As shown, the electronic device 600 may include a processor 601 and a memory 602. The electronic device 600 may also include one or more of a multimedia component 603, an input / output (I / O) interface 604, and a communication component 605.
[0118] The processor 601 controls the overall operation of the electronic device 600 to complete all or part of the steps in the audio signal processing method described above. The memory 602 stores various types of data to support the operation of the electronic device 600. This data may include, for example, instructions for any application or method operating on the electronic device 600, and application-related data such as contact data, sent and received messages, pictures, audio, video, etc. The memory 602 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. Multimedia component 603 may include a screen and an audio component. The screen may be, for example, a touchscreen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signals may be further stored in memory 602 or transmitted via communication component 605. The audio component also includes at least one speaker for outputting audio signals. I / O interface 604 provides an interface between processor 601 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual or physical buttons. Communication component 605 is used for wired or wireless communication between the electronic device 600 and other devices. Wireless communication may include Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, or 4G, or a combination of these. Therefore, the corresponding communication component 605 may include a Wi-Fi module, a Bluetooth module, or an NFC module.
[0119] In an exemplary embodiment, the electronic device 600 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the audio signal processing method described above.
[0120] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, which, when executed by a processor, implement the steps of the audio signal processing method described above. For example, the computer-readable storage medium may be the memory 602 including the program instructions described above, which may be executed by the processor 601 of the electronic device 600 to complete the audio signal processing method described above.
[0121] The preferred embodiments of this disclosure have been described in detail above with reference to the accompanying drawings. However, this disclosure is not limited to the specific details of the above embodiments. Within the scope of the technical concept of this disclosure, various simple modifications can be made to the technical solutions of this disclosure, and these simple modifications all fall within the protection scope of this disclosure.
[0122] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, this disclosure will not describe the various possible combinations separately.
[0123] Furthermore, various different embodiments of this disclosure can be combined in any way, as long as they do not violate the spirit of this disclosure, they should also be regarded as the content disclosed in this disclosure.
Claims
1. A method of audio signal processing, characterized by, The target device applied to a target device group, the target device group comprising at least two target devices, is used for synchronously playing audio signals emitted by the same signal source, and the target device comprises a signal sampling module, a multi-task processing module, and a signal output module. The signal sampling module is connected with the signal output module through the multi-task processing module, and the method comprises the following steps: In the case that a first audio signal is collected by the signal sampling module in a current sampling period, timing is started, and the collected first audio signal is sent to the multi-task processing module; the multi-task processing module is used for sequentially processing received data, and in the case that the received data is the first audio signal, the first audio signal is sent to the signal output module; In the case that the timing duration reaches a preset delay duration, the first audio signal is sent to the signal output module through the multi-task processing module; The first audio signal is output through the signal output module; The target device further comprises a playback buffer module, and the method further comprises the following steps: The second audio signal is buffered through the playback buffer module; The first audio signal and the buffered second audio signal are subjected to time synchronization processing to obtain a time-synchronized second audio signal; The signal output module is controlled to read the time-synchronized second audio signal from the playback buffer module and mix and output the time-synchronized second audio signal and the first audio signal; The signal output module is used for outputting the first audio signal according to the first-in first-out principle after buffering the first audio signal of a preset length, and the time synchronization processing of the first audio signal and the buffered second audio signal to obtain the time-synchronized second audio signal comprises the following steps: When the first frame of audio data of the second audio signal is sent to the playback buffer module, the current buffering duration of the signal output module is obtained; Target audio data corresponding to the buffering duration in the playback buffer module is deleted, wherein the starting frame of the target audio data is the first frame of audio data; The remaining audio data in the playback buffer module except the target audio data is taken as the time-synchronized second audio signal.
2. The method of claim 1, wherein, The second audio signal comprises any one of a Bluetooth audio signal received through a Bluetooth module, a local audio signal stored locally, and an interface audio signal received through a preset audio signal interface.
3. The method of claim 2, wherein, The buffering of the second audio signal through the playback buffer module comprises the following steps: In the case that the second audio signal is a Bluetooth audio signal, if the Bluetooth audio signal is received through the Bluetooth module, the Bluetooth audio signal is buffered through the playback buffer module; or In the case that the second audio signal is an interface audio signal, if the interface audio signal is received through the preset audio signal interface, the interface audio signal is buffered through the playback buffer module; or In the case that the second audio signal is a local audio signal, if the local audio signal is received through the preset audio signal interface, the local audio signal is buffered through the playback buffer module. In a case that the second audio signal is a local audio signal, if a playing instruction corresponding to the local audio signal is received, the local audio signal is buffered by the playback buffer module.
4. The method of claim 1, wherein, The current cache duration of the signal output module is obtained, including: The data length of the current cache data of the signal output module is obtained. The cache duration is determined according to the data length.
5. The method according to any one of claims 1 to 4, characterized in that, The multi-task processing module includes a data processing module and a target buffer module connected with the data processing module; the data processing module is configured to send the first audio signal to the target buffer module in a case that the received data is the first audio signal; and the target buffer module is configured to cache the first audio signal. In a case that the timing duration reaches a preset delay duration, the first audio signal is sent to the signal output module by the multi-task processing module, including: In a case that the timing duration reaches a preset delay duration, the first audio signal is sent to the signal output module by the target buffer module in the multi-task processing module.
6. An audio signal processing apparatus, characterized by comprising: The target device is applied to a target device group including at least two target devices, and is configured to synchronously play audio signals emitted by a same signal source; the target device includes a signal sampling module, a multi-task processing module, and a signal output module. The signal sampling module is connected with the signal output module through the multi-task processing module, and the device includes: A timing module is configured to start timing in a case that a first audio signal is collected by the signal sampling module in a current sampling period, and send the collected first audio signal to the multi-task processing module; the multi-task processing module is configured to sequentially process received data, and send the first audio signal to the signal output module in a case that the received data is the first audio signal. A delay sending module is configured to send the first audio signal to the signal output module by the multi-task processing module in a case that a timing duration reaches a preset delay duration. An output module is configured to output the first audio signal by the signal output module. The target device further includes a playback buffer module, and the device further includes: A signal buffer module is configured to buffer a second audio signal by the playback buffer module. A synchronization module is configured to perform time synchronization processing on the first audio signal and the buffered second audio signal to obtain a time synchronization processed second audio signal. A mixing module is configured to control the signal output module to read the time synchronization processed second audio signal from the playback buffer module, and mix and output the time synchronization processed second audio signal and the first audio signal. The signal output module is configured to output the first audio signal according to a first-in first-out principle after the first audio signal of a preset length is cached. In a case that the first frame of audio data of the second audio signal is sent to the playback buffer module, the current cache duration of the signal output module is obtained. delete target audio data corresponding to the cache duration in the playback buffer module, wherein a starting frame of the target audio data is the first frame of audio data; remaining audio data in the playback buffer module except the target audio data as the second audio signal after time synchronization processing.
7. The apparatus of claim 6, wherein, The second audio signal includes any one of a Bluetooth audio signal received through a Bluetooth module, a locally stored local audio signal, and an interface audio signal received through a preset audio signal interface.
8. The apparatus of claim 7, wherein, The signal buffer module is configured to: if the second audio signal is a Bluetooth audio signal, if the Bluetooth audio signal is received through the Bluetooth module, buffer the Bluetooth audio signal through the playback buffer module; or if the second audio signal is an interface audio signal, if the interface audio signal is received through the preset audio signal interface, buffer the interface audio signal through the playback buffer module; or if the second audio signal is a local audio signal, if a play instruction corresponding to the local audio signal is received, buffer the local audio signal through the playback buffer module.
9. The apparatus of claim 6, wherein, The synchronization module is configured to: obtain a data length of current cache data of the signal output module; determine the cache duration according to the data length.
10. The device according to any of claims 6-9, characterized in that The multi-task processing module includes a data processing module and a target buffer module connected to the data processing module; the data processing module is configured to send the target audio output to the target buffer module in the case that the received data is the first audio signal; the target buffer module is configured to cache the first audio signal; and the delay sending module is configured to: in the case that the timing duration reaches a preset delay duration, send the first audio signal to the signal output module through the target buffer module in the multi-task processing module.
11. A computer readable storage medium having stored thereon a computer program, characterized in that The program is executed by the processor to implement the steps of the method of any one of claims 1-5.
12. An electronic device, comprising: comprise: a memory having a computer program stored thereon; a processor configured to execute the computer program in the memory to implement the steps of the method of any one of claims 1-5.
Citation Information
Patent Citations
Synchronous playing method and device, electronic equipment and medium
CN110708582A