Multi-audio superposition method based on embedded device and related device

By adopting a multi-ring buffer area management mechanism in embedded devices, the volume adjustment and superposition of white noise is realized, which solves the problem of superposition difficulties caused by insufficient equipment performance, and ensures the continuity and personalization of audio output.

CN118981297AActive Publication Date: 2024-11-19SHENZHEN ZHANYIN TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410976488.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-20
Publication Date
2024-11-19
Estimated Expiration
2044-07-20

AI Technical Summary

Technical Problem

Due to limited performance, existing embedded devices cannot decode different white noises using multiple decoders at the same time, resulting in the inability to flexibly superimpose white noises.

Method used

By adopting a multi-ring cache area management mechanism in embedded devices, the data amount of the cache area is judged and adjusted according to the user's volume adjustment parameters, data overlay operation is realized without opening multiple file decoders, reducing system resource usage.

Benefits of technology

Implement audio overlay on embedded devices with insufficient processor performance to ensure the continuity and personalization of audio output, and avoid excessive resource usage and interruption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118981297A_ABST
    Figure CN118981297A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of audio processing, in particular to a multi-audio superposition method based on embedded equipment and related equipment, which can realize audio superposition on the embedded equipment. The method comprises the steps of receiving a volume adjustment parameter of a user, judging whether the data volume of a player cache region is lower than a preset threshold value, if the data volume of the player cache region is lower than the preset threshold value, determining M annular cache regions according to the volume adjustment parameter and judging whether a target annular cache region with the data volume lower than a second preset threshold value exists, if the target annular cache region does not exist, reading the target data in each annular cache region according to the volume adjustment parameters to obtain M target sub-data, adjusting each target sub-data according to the volume adjustment parameters to obtain M adjusted sub-data, and performing superposition operation on the M adjusted sub-data to obtain M target sub-data; and the target superposition data is written into the player cache region.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of audio processing, and in particular to a multi-audio superposition method based on an embedded device and related equipment. Background Art

[0002] The current urban life is fast-paced and people are under great pressure. White noise can relieve anxiety, improve work efficiency and improve concentration. Therefore, more and more people choose to play white noise in their spare time. Gradually, people have also put forward more personalized requirements for the white noise played by the equipment, requiring that multiple different white noises can be played in superposition and the volume of different white noises in the superimposed audio can be freely adjusted.

[0003] At present, a number of mobile phone apps have appeared on the market. Relying on the powerful performance of mobile phones, they can use multiple decoders to decode different white noises at the same time, so that multiple white noise audios can be superimposed and played, and the volume of each white noise in the superimposed audio can be controlled. However, in embedded devices with limited performance, it is impossible to use multiple decoders to decode multiple white noises at the same time, resulting in the inability of embedded devices to flexibly superimpose white noise. Summary of the invention

[0004] In order to solve the problem that the existing embedded devices are unable to use multiple decoders to decode different white noises at the same time due to performance limitations, resulting in the embedded devices being restricted in superimposing and playing white noise, the present application provides a multi-audio superposition method based on an embedded device and related devices.

[0005] The first aspect of the present application provides a multi-audio superposition output method based on an embedded device, comprising: If the volume adjustment parameter of the user is received, it is determined whether the amount of data in the player buffer is lower than a preset threshold; If the amount of data in the player buffer is lower than the preset threshold, M circular buffers are determined according to the volume adjustment parameter, where M is an integer greater than or equal to 2; Determine whether there is a target circular buffer area with a data volume lower than a second preset threshold value in the M circular buffer areas, each of the M circular buffer areas stores target data, and the target data stored in each circular buffer area corresponds to one PCM file; If the target circular buffer area does not exist in the M circular buffer areas, reading the target data in each circular buffer area according to the volume adjustment parameter to obtain M target sub-data; Adjusting each target sub-data in the M target sub-data according to the volume adjustment parameter to obtain M adjusted sub-data; A superposition operation is performed on the M adjusted sub-data to obtain target superposition data, and the target superposition data is written into a player buffer area.

[0006] By adopting the above technical solution, after receiving the user's volume adjustment parameter, it is determined whether the player buffer area can receive the superimposed data. If the player buffer area can receive the superimposed data, the circular buffer area that needs to be read is determined according to the volume adjustment parameter, and it is determined whether each determined circular buffer area has enough data to read. If each determined circular buffer area has enough data, the data in each determined circular buffer area is read, and the read data is adjusted according to the volume adjustment parameter, and finally the superimposed and adjusted data is stored in the player buffer area. Therefore, when performing audio superposition operation, there is no need to open multiple file decoders, which will not cause excessive occupation of system resources, thereby realizing audio superposition on embedded devices with insufficient processor performance.

[0007] Optionally, a multi-audio superposition method based on an embedded device further includes: If the data volume in the player buffer is not less than the preset threshold, real-time monitoring is performed on the data volume in the player buffer; If the amount of data in the player buffer is lower than the preset threshold, the step of determining M circular buffers according to the volume adjustment parameter is performed.

[0008] By adopting the above technical solution, the amount of data in the player buffer is detected in real time, and it is replenished in time when the amount of data in the player buffer is insufficient, ensuring that there will be no interruption in the output of audio.

[0009] Optionally, a multi-audio superposition method based on an embedded device further includes: If there is a target circular buffer area whose data volume is lower than the second preset threshold value among the M circular buffer areas, replenishing the data volume of the target circular buffer area until the data volume of the target circular buffer area reaches the second preset threshold value; According to the volume adjustment parameter, the data in the target annular buffer area and the data in other annular buffer areas are adjusted to obtain a plurality of adjusted sub-data, wherein the other annular buffer areas are buffer areas other than the target annular buffer area among the M annular buffer areas; A superposition operation is performed on the multiple sub-data to obtain first superposition data, and the first superposition data is written into a player buffer area.

[0010] By adopting the above technical solution, when performing data superposition, it is determined whether the amount of data in the circular buffer area where data superposition is required is sufficient. If the amount of data in the circular buffer area is insufficient, the amount of data in the corresponding circular buffer area is supplemented, and then the data reading, adjustment and superposition operations are performed to ensure that when data superposition is performed, the corresponding circular buffer area can have enough data to be read.

[0011] Optionally, determining the M ring buffer areas according to the volume adjustment parameter comprises the following steps: Determine whether there is a first circular buffer area whose volume adjustment parameter is 0 among the N circular buffer areas, wherein N is an integer greater than or equal to 2; If there is a first circular buffer area whose volume adjustment parameter is 0, the first circular buffer area is removed from the N circular buffer areas to obtain the M circular buffer areas, wherein the M is less than or equal to the N; If there is no first circular buffer area whose volume adjustment parameter is 0, the N circular buffer areas are determined as the M circular buffer areas.

[0012] By adopting the above technical solution, the circular buffer area with a volume adjustment parameter of 0 is removed from the list of circular buffer areas to be read, which can reduce the resource overhead of the embedded system.

[0013] Optionally, the step of reading the target data in each ring buffer area according to the volume adjustment parameter to obtain M target sub-data includes the following steps: Determine a target reading amount for each of the M circular buffer areas according to a preset reading amount corresponding to the player buffer area; Each of the ring buffer areas is read according to the target reading amount to obtain the M target sub-data.

[0014] By adopting the above technical solution, a preset data reading amount is set according to the number of player buffer areas and circular buffer areas that need to be read, and the same amount of data from each circular buffer area is read according to the preset data reading amount to facilitate subsequent data overlay operations.

[0015] Optionally, adjusting each target sub-data in the M target sub-data according to the volume adjustment parameter to obtain M adjusted sub-data comprises the following steps: Converting the volume adjustment parameter into a corresponding volume proportional coefficient; The M target sub-data are adjusted according to the volume proportional coefficient to obtain the M adjusted sub-data.

[0016] By adopting the above technical solution, the volume adjustment parameter is converted into a corresponding volume proportional coefficient, and the read data is adjusted according to the volume proportional coefficient, so as to facilitate the audio superposition operation of different volumes.

[0017] Optionally, a multi-audio superposition output method based on an embedded device also includes If there is no second circular buffer area with a data volume lower than the second preset threshold value among the N circular buffer areas, the data volume of the N circular buffer areas is monitored in real time; If there is a second circular buffer area among the N circular buffer areas whose data volume is lower than the second preset threshold, the data volume of the second circular buffer area is replenished until the data volume of the second circular buffer area reaches the second preset threshold.

[0018] By adopting the above technical solution, the data volume of the circular buffer area is detected in real time, and it is supplemented in time when the data volume of the circular buffer area is insufficient, ensuring that the circular buffer area can provide sufficient data when data superposition is required.

[0019] The second aspect of the present application provides an embedded device, which adopts the following technical solution: An embedded device, comprising: A receiving module, used for receiving a volume adjustment parameter of a user; A determination module, configured to determine M ring buffers according to the volume adjustment parameter, wherein M is an integer greater than or equal to 2; A determination module, used to determine whether there is a target circular buffer area with a data volume lower than a second preset threshold value among the M circular buffer areas and to determine whether the data volume of the player buffer area is lower than a preset threshold value; A reading module, configured to read the target data in each of the circular buffer areas according to the volume adjustment parameter to obtain M target sub-data; an adjustment module, configured to adjust each target sub-data in the M target sub-data according to the volume adjustment parameter to obtain M adjusted sub-data; The superposition module is used to perform a superposition operation on the M adjusted sub-data to obtain target superposition data, and write the target superposition data into a player buffer area.

[0020] A third aspect of the present application provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of a multi-audio superposition method based on an embedded device described in the first aspect are implemented.

[0021] A fourth aspect of the present application provides a computer storage medium, which includes instructions. When the instructions are executed on a computer, the computer executes the steps of a multi-audio superposition method based on an embedded device as described in any one of the above aspects.

[0022] In summary, it can be seen that in the embodiment provided by the present application, the amount of data in the player buffer and each circular buffer is monitored in real time. If the amount of data in each circular buffer is insufficient, data is read from the corresponding PCM file to ensure that the amount of data in the circular buffer is sufficient. If the amount of data in the player buffer is insufficient, the data in each circular buffer is read and adjusted according to the obtained volume adjustment parameters, and the data superposition operation is performed to write the superimposed data into the circular buffer. As a result, there is no need to use multiple decoders to decode different audio files before performing audio superposition, which reduces the requirements for device performance when performing audio superposition operations, and can realize personalized superimposed audio on embedded devices. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 It is a flowchart of a multi-audio superposition method based on an embedded device provided in an embodiment of the present application; Figure 2 It is a virtual structural diagram of a multi-audio superposition device based on an embedded device provided in an embodiment of the present application; Figure 3 It is a schematic diagram of the hardware structure of a computer device provided in an embodiment of the present application; DETAILED DESCRIPTION The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.

[0024] For ease of understanding, some terms provided in the embodiments of the present application are explained below, as follows: PCM file is an audio file format that stores sound information by converting analog audio signals into digital signals.

[0025] The sampling rate refers to the number of times the original sound signal is sampled per second during the audio digitization process. The unit of sampling rate is Hertz, which indicates the number of samples per second.

[0026] The number of bits refers to the bit depth of the audio file, which indicates the quantization accuracy of each sampling point, that is, how many bits of binary are used to represent each sampling value.

[0027] The following describes a multi-audio superposition method based on an embedded device from the perspective of an embedded device. The embedded device may be a server or a service unit in a server, and is not specifically limited.

[0028] Combined with reference Figure 1 , Figure 1 A multi-audio superposition method based on an embedded device provided in an embodiment of the present application includes: 101. If the volume adjustment parameter of the user is received, it is determined whether the data volume in the player buffer is lower than a preset threshold. If so, step 102 is executed.

[0029] In this embodiment, the embedded device can obtain the volume adjustment parameters of the user, which include but are not limited to various audio volume increase and decrease parameters and audio signal parameters, system volume control parameters of the embedded device, and application volume control parameters. The acquisition method can be that the user obtains the volume adjustment parameters by adjusting a knob on the embedded device, or the user inputs the volume adjustment parameters through a dialog box provided by the embedded device or by sliding a slider in the dialog box. Of course, the volume adjustment parameters can also be obtained in other ways, such as the user storing multiple volume adjustment parameters in the embedded device in advance, and automatically obtaining the corresponding volume adjustment parameters when needed, which is not specifically limited; Afterwards, the embedded device will determine whether the data volume in the player cache is lower than a preset threshold. The preset threshold is the limit value at which the data volume in the player cache is at a lower level. The data volume in the player cache is maintained above this limit value to ensure that the player cache has enough data volume to continuously output audio data.

[0030] In one embodiment, after the embedded device determines whether the amount of data in the player buffer is lower than a preset threshold, the following steps are included: If the data volume in the player buffer is not less than a preset threshold, the data volume in the player buffer is monitored in real time; If the amount of data in the player buffer is lower than a preset threshold, the step of determining M circular buffers according to the volume adjustment parameter is executed.

[0031] In this embodiment, the embedded device will continuously monitor the amount of data in the player cache. If the amount of data in the current player cache is lower than the preset threshold, the embedded device will promptly start the data superposition operation according to the currently acquired volume adjustment parameter to supplement the amount of data in the player cache, that is, execute step 102 to determine the M circular buffer areas according to the volume adjustment parameter. If the amount of data in the current player cache is not lower than the preset threshold, the embedded device will continue to monitor the amount of data in the player cache.

[0032] In one embodiment, the embedded device determines whether the amount of data in the player buffer is lower than a preset threshold before the embedded device comprises the following steps: If there is no second circular buffer area with a data volume lower than the second preset threshold value among the N circular buffer areas, the data volume of the N circular buffer areas is monitored in real time; If there is a second circular buffer area with a data volume lower than the second preset threshold value among the N circular buffer areas, the data volume of the second circular buffer area is replenished until the data volume of the second circular buffer area reaches the second preset threshold value.

[0033] In this embodiment, the embedded device will continuously monitor the data volume of N circular buffer areas. If the data volume appearing in the N circular buffer areas is lower than the circular buffer area at the second preset threshold, the embedded device will promptly read the PCM file data and write it to the circular buffer area. The PCM file can be stored in the embedded device in advance according to the corresponding audio parameters, or the embedded device can filter it out according to the corresponding audio parameters in the audio database. There is no specific limitation. The audio parameters are determined based on the processor performance of the embedded device, including but not limited to the audio sampling rate, the number of audio bits, etc. If the data volume not currently existing in the N circular buffer areas is not lower than the circular buffer area at the second preset threshold, the embedded device will continue to monitor the data volume of the N circular buffer areas.

[0034] 102. Determine M ring buffer areas according to the volume adjustment parameter; In this embodiment, when the amount of data in the player buffer area is lower than a preset threshold, the embedded device determines M circular buffer areas based on the user's volume adjustment parameters, where M is an integer greater than or equal to 2, and the M circular buffer areas are the circular buffer areas that need to read and superimpose data subsequently.

[0035] In one embodiment, determining the M ring buffer areas according to the volume adjustment parameter includes: Determine whether there is a first circular buffer area with a volume adjustment parameter of 0 among the N circular buffer areas, where N is an integer greater than or equal to 2; If there is a first circular buffer area whose volume adjustment parameter is 0, the first circular buffer area is removed from the N circular buffer areas to obtain M circular buffer areas, where M is less than or equal to N; If there is no first circular buffer area whose volume adjustment parameter is 0, the N circular buffer areas are determined to be M circular buffer areas.

[0036] In this embodiment, the embedded device determines whether the volume adjustment parameter of the circular buffer area is 0, and eliminates the circular buffer area with the volume adjustment parameter of 0, thereby determining M circular buffer areas from N circular buffer areas. The embedded device can also add the identification of the circular buffer area to the received volume adjustment parameter. The embedded device parses the volume adjustment parameter to obtain the identification of the circular buffer area, and determines M circular buffer areas from the N circular buffer areas according to the identification.

[0037] 103 . Determine whether there is a target circular buffer area with a data volume lower than a second preset threshold among the M circular buffer areas. If not, execute step 104 .

[0038] In this embodiment, the embedded device determines whether the data volume of the M circular buffers reaches a second preset threshold value, which is a limit value at which the data volume of the circular buffers is at a lower level. The data volume of the circular buffers is maintained above this limit value to ensure that there is enough data in the circular buffers to be read in subsequent overlay operations.

[0039] In one embodiment, after determining whether there is a target circular buffer area with a data volume lower than a second preset threshold value in the M circular buffer areas, the following steps are also included: If there is a target circular buffer area with a data volume lower than the second preset threshold value among the M circular buffer areas, the data volume of the target circular buffer area is supplemented until the data volume of the target circular buffer area reaches the second preset threshold value; According to the volume adjustment parameter, the data in the target circular buffer area and the data in other circular buffer areas are adjusted to obtain a plurality of adjusted sub-data, wherein the other circular buffer areas are buffer areas other than the target circular buffer area among the M circular buffer areas; A superposition operation is performed on the plurality of sub-data to obtain first superposition data, and the first superposition data is written into a buffer area of ​​the player.

[0040] In this embodiment, if a circular buffer area with a data volume lower than the second preset threshold appears in the M circular buffer areas of the embedded device, the corresponding PCM file data will be read and written into the circular buffer area until the data of the M circular buffer areas reach the second preset threshold value, the data of the M circular buffer areas will be adjusted according to the volume adjustment parameter, and the adjusted multiple sub-data will be superimposed, and the superimposed data will be written into the player buffer area, that is, the operations of steps 104 to 106 are executed.

[0041] 104. Read the target data in each circular buffer area according to the volume adjustment parameter to obtain M target sub-data; In this embodiment, if there is no circular buffer area whose volume is lower than the second threshold value among the M circular buffer areas of the embedded device, the data of the circular buffer area is read according to the volume adjustment parameter obtained in step 101, and the reading position of the circular buffer area is the position when the last reading of the circular buffer area ended.

[0042] In one embodiment, reading the target data in each circular buffer area according to the volume adjustment parameter to obtain M target sub-data further includes the following steps: Determine a target reading amount for each of the M circular buffer areas according to a preset reading amount corresponding to the player buffer area; Each ring buffer is read according to the target reading amount to obtain M target sub-data.

[0043] In this embodiment, the embedded device determines a preset read amount according to the size of the player buffer area, calculates a target read amount according to the preset read amount and M ring buffers, and reads data of M target read amounts from the M ring buffers to obtain M target sub-data; The following is a specific example to illustrate how an embedded device calculates the target read amount based on the preset read amount and M ring buffers. Assuming that the preset read amount of the embedded device is 64KB, and there are 4 ring buffers that need to be read, the target read amount is 16KB, and 16KB of data will be read from each ring buffer to obtain 4 16KB target sub-data.

[0044] 105. Adjust each target sub-data in the M target sub-data according to the volume adjustment parameter to obtain M adjusted sub-data; In this embodiment, the embedded device adjusts each target sub-data according to the volume adjustment parameter. The adjustment of the target sub-data includes but is not limited to adjusting the volume, adjusting the equalizer, bass enhancement, treble enhancement, adjusting the channel, etc.

[0045] In one embodiment, adjusting each target sub-data in the M target sub-data according to the volume adjustment parameter to obtain the M adjusted sub-data further includes the following steps: Convert the volume adjustment parameter into the corresponding volume proportional coefficient; The M target sub-data are adjusted according to the volume ratio coefficient to obtain M adjusted sub-data.

[0046] In this embodiment, the embedded device converts the volume adjustment parameter into a corresponding volume scale coefficient, and multiplies the volume scale coefficient by the target sub-data to obtain the adjusted sub-data.

[0047] The following is a description of how to convert the volume adjustment parameters into corresponding volume scale coefficients with reference to a specific example. The volume adjustment parameters received in step 101 are 60, 40, and 100, which correspond to the volume adjustment parameters of three target sub-data, respectively. The volume adjustment parameters are converted into corresponding volume scale coefficients of 0.6, 0.4, and 1. The corresponding adjusted sub-data can be obtained by multiplying the volume scale coefficients with the corresponding target sub-data.

[0048] 106. Perform a superposition operation on the M adjusted sub-data to obtain target superposition data, and write the target superposition data into a player buffer area.

[0049] In this embodiment, the embedded device performs a superposition operation on the M adjusted sub-data, aligns the multiple target sub-data in time, and adds the values ​​of each sampling point to form superposition data. After the audio superposition is completed, in order to avoid audio distortion caused by value overflow, the embedded device can avoid value overflow by obtaining the average value of the superposition data, use a limiter to limit the overflow of the superposition data, or continuously monitor the superposition data, and make adjustments in time when the superposition data is about to overflow. There is no specific limitation. The overlay data is then written to the player buffer.

[0050] In summary, it can be seen that in the embodiment provided by the present application, according to the performance parameters of the embedded device, N PCM files with the same sampling rate and bit number are selected and stored in the embedded device. The embedded device simultaneously monitors the data volume of N ring buffers and the data volume of the player buffer. When the data volume of the N ring buffers is too low, the corresponding PCM files can be read in time for supplementation. When the data volume of the player buffer is too low, the audio superposition operation can be started in time to supplement, and the superimposed data can be processed to prevent overflow, so as to realize personalized and continuous audio superposition operations on embedded devices with insufficient performance.

[0051] See also Figure 2 , Figure 2 This is a virtual structure diagram of a multi-audio superposition device based on an embedded device in the present application. The image transmission test system 200 includes: Receiving module 201, used for receiving volume adjustment parameters of a user; A determination module 202, configured to determine M ring buffers according to the volume adjustment parameter, wherein M is an integer greater than or equal to 2; A determination module 203 is used to determine whether there is a target circular buffer with a data volume lower than a second preset threshold value among the M circular buffers and to determine whether the data volume of the player buffer is lower than a preset threshold value; A reading module 204, configured to read the target data in each of the ring buffers according to the volume adjustment parameter to obtain M target sub-data; An adjustment module 205, configured to adjust each target sub-data in the M target sub-data according to the volume adjustment parameter to obtain M adjusted sub-data; The superposition module 206 is used to perform a superposition operation on the M adjusted sub-data to obtain target superposition data, and write the target superposition data into a player buffer area.

[0052] See also Figure 3 , Figure 3 A schematic diagram of the structure of a computer device provided in an embodiment of the present application, the computer device 300 includes: At least one processor 301, at least one communication bus 302, at least one memory 306, a power supply 307, and a user interface 308. The user interface 308 of the computer device 300 includes a display, a knob, or a click device. The memory 306 may include a high-speed RAM memory, or may include a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 306 stores one or more computer programs 303 or data 305. When the terminal device 300 is running, the processor 301 communicates with the memory 306, and the processor 301 calls the instructions stored in the memory 306 to execute the above Figure 1 The multi-audio superposition method based on an embedded device as described above. The operating system 304 includes various programs for implementing various basic services and processing tasks according to hardware.

[0053] In one embodiment, the present application provides a computer device, which may be a server, and its internal structure diagram may be as follows: Figure 3 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a multi-audio superposition method based on an embedded device is implemented.

[0054] Those skilled in the art will understand that Figure 3The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0055] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0056] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the above-mentioned computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), tape, floppy disk, flash memory or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0057] The above are all preferred embodiments of the present application, and the protection scope of the present application is not limited thereto. Therefore, any equivalent changes made according to the structure, shape, and principle of the present application should be included in the protection scope of the present application.

Claims

1. A multi-audio superposition method based on embedded devices, characterized in that: The method comprises: If the volume adjustment parameter of the user is received, it is determined whether the amount of data in the player buffer is lower than a preset threshold; If the amount of data in the player buffer is lower than the preset threshold, M circular buffers are determined according to the volume adjustment parameter, where M is an integer greater than or equal to 2; Determine whether there is a target circular buffer area with a data volume lower than a second preset threshold value in the M circular buffer areas, each of the M circular buffer areas stores target data, and the target data stored in each circular buffer area corresponds to one PCM file; If the target circular buffer area does not exist in the M circular buffer areas, reading the target data in each circular buffer area according to the volume adjustment parameter to obtain M target sub-data; Adjusting each target sub-data in the M target sub-data according to the volume adjustment parameter to obtain M adjusted sub-data; A superposition operation is performed on the M adjusted sub-data to obtain target superposition data, and the target superposition data is written into a player buffer area.

2. The method according to claim 1, characterized in that: The method further comprises: If the data volume in the player buffer is not less than the preset threshold, real-time monitoring is performed on the data volume in the player buffer; If the amount of data in the player buffer is lower than the preset threshold, the step of determining M circular buffers according to the volume adjustment parameter is performed.

3. The method according to claim 1, characterized in that: The method further comprises: If there is a target circular buffer area whose data volume is lower than the second preset threshold value among the M circular buffer areas, replenishing the data volume of the target circular buffer area until the data volume of the target circular buffer area reaches the second preset threshold value; According to the volume adjustment parameter, the data in the target annular buffer area and the data in other annular buffer areas are adjusted to obtain a plurality of adjusted sub-data, wherein the other annular buffer areas are buffer areas other than the target annular buffer area among the M annular buffer areas; A superposition operation is performed on the multiple sub-data to obtain first superposition data, and the first superposition data is written into a player buffer area.

4. The method according to claim 1, characterized in that: Determining the M ring buffer areas according to the volume adjustment parameter comprises: Determine whether there is a first circular buffer area whose volume adjustment parameter is 0 among the N circular buffer areas, wherein N is an integer greater than or equal to 2; If there is a first circular buffer area whose volume adjustment parameter is 0, the first circular buffer area is removed from the N circular buffer areas to obtain the M circular buffer areas, wherein the M is less than or equal to the N; If there is no first circular buffer area whose volume adjustment parameter is 0, the N circular buffer areas are determined as the M circular buffer areas.

5. The method according to claim 1, characterized in that: The step of reading the target data in each of the ring buffers according to the volume adjustment parameter to obtain M target sub-data includes: Determine a target reading amount for each of the M circular buffer areas according to a preset reading amount corresponding to the player buffer area; Each of the ring buffer areas is read according to the target reading amount to obtain the M target sub-data.

6. The method according to claim 1, characterized in that: The step of adjusting each target sub-data in the M target sub-data according to the volume adjustment parameter to obtain M adjusted sub-data includes: Converting the volume adjustment parameter into a corresponding volume proportional coefficient; The M target sub-data are adjusted according to the volume proportional coefficient to obtain the M adjusted sub-data.

7. The method according to claims 1 to 6, characterized in that: The method further comprises: If there is no second circular buffer area with a data volume lower than the second preset threshold value among the N circular buffer areas, the data volume of the N circular buffer areas is monitored in real time; If there is a second circular buffer area among the N circular buffer areas whose data volume is lower than the second preset threshold, the data volume of the second circular buffer area is replenished until the data volume of the second circular buffer area reaches the second preset threshold.

8. A multi-audio superposition device based on an embedded device, characterized in that: include: A receiving module, used for receiving a volume adjustment parameter of a user; A determination module, configured to determine M ring buffers according to the volume adjustment parameter, wherein M is an integer greater than or equal to 2; A determination module, used to determine whether there is a target circular buffer with a data volume lower than a second preset threshold value among the M circular buffers and to determine whether the data volume of the player buffer is lower than a preset threshold value; A reading module, configured to read the target data in each of the circular buffer areas according to the volume adjustment parameter to obtain M target sub-data; an adjustment module, configured to adjust each target sub-data in the M target sub-data according to the volume adjustment parameter to obtain M adjusted sub-data; The superposition module is used to perform a superposition operation on the M adjusted sub-data to obtain target superposition data, and write the target superposition data into a player buffer area.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the multi-audio superposition method based on an embedded device are implemented as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of a multi-audio superposition method based on an embedded device are implemented as claimed in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Audio sound mixing method and device

    CN106782576A

  • Audio and video processing method and device, terminal and storage medium

    CN109819314A

  • Multi-track audio processing method and device and computer storage medium

    CN115249490A

  • Audio mixing processing method and device, chip, Bluetooth equipment and audio mixing system

    CN117012215A

  • Apparatus and method for controlling volume in an audioreproducing device

    KR1020080036878A