CN118098182A - Mixing processing method, device, computer equipment and computer readable storage medium - Google Patents

Mixing processing method, device, computer equipment and computer readable storage medium Download PDF

Info

Publication number
CN118098182A
CN118098182A CN202410083299.5A CN202410083299A CN118098182A CN 118098182 A CN118098182 A CN 118098182A CN 202410083299 A CN202410083299 A CN 202410083299A CN 118098182 A CN118098182 A CN 118098182A
Authority
CN
China
Prior art keywords
data
current
mixing
accompaniment
kernel space
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410083299.5A
Other languages
Chinese (zh)
Inventor
刘兆祥
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Coocaa Network Technology Co Ltd
Original Assignee
Shenzhen Coocaa Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Coocaa Network Technology Co Ltd filed Critical Shenzhen Coocaa Network Technology Co Ltd
Priority to CN202410083299.5A priority Critical patent/CN118098182A/en
Publication of CN118098182A publication Critical patent/CN118098182A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10HELECTROPHONIC MUSICAL INSTRUMENTS; INSTRUMENTS IN WHICH THE TONES ARE GENERATED BY ELECTROMECHANICAL MEANS OR ELECTRONIC GENERATORS, OR IN WHICH THE TONES ARE SYNTHESISED FROM A DATA STORE
    • G10H1/00Details of electrophonic musical instruments
    • G10H1/36Accompaniment arrangements
    • G10H1/361Recording/reproducing of accompaniment for use with an external source, e.g. karaoke systems
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10HELECTROPHONIC MUSICAL INSTRUMENTS; INSTRUMENTS IN WHICH THE TONES ARE GENERATED BY ELECTROMECHANICAL MEANS OR ELECTRONIC GENERATORS, OR IN WHICH THE TONES ARE SYNTHESISED FROM A DATA STORE
    • G10H1/00Details of electrophonic musical instruments
    • G10H1/0008Associated control or indicating means

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Acoustics & Sound (AREA)
  • Multimedia (AREA)
  • Electrophonic Musical Instruments (AREA)

Abstract

The present invention is applicable to the field of audio data processing, and in particular, to a method, an apparatus, a computer device, and a computer readable storage medium for processing audio data. The sound mixing processing method is applied to an operating system of the computer equipment, accompaniment data output by an application program in the computer equipment are sent to a kernel space of the operating system, current accompaniment of the kernel space output to a playing module at the current moment is obtained, current voice collected by a sound receiving module at the current moment is sent to the kernel space, sound mixing processing is carried out on the current accompaniment and the current voice in the kernel space, sound mixing data at the current moment are obtained, and delay time from when a user sends the current voice to when the user hears corresponding sound mixing of the current voice is reduced.

Description

Mixing processing method, device, computer equipment and computer readable storage medium
Technical Field
The present invention relates to the field of audio data processing, and in particular, to a method and apparatus for processing audio data, a computer device, and a computer readable storage medium.
Background
Along with the wide application of audio technology, more and more users are willing to order songs through personal computers or mobile terminals and other computer equipment, and mix and output the accompaniment sounds and own voice, so as to realize the effect of ordering, the current technology for realizing the effect of ordering is generally divided into two links, namely, the accompaniment sounds are acquired, and the accompaniment sounds and the voice are mixed, wherein the accompaniment sounds and the voice are mixed, the voice received by the computer equipment is often required to be transferred from the kernel space of an operating system to the user space, and the voice mixing processing of the voice and the accompaniment sounds is realized in the user space, so that the main processing time can comprise the time of transmitting the voice to the computer equipment from the kernel space, the time of transmitting the voice to the user space, the time of transmitting the mixed voice to a playing module and the like, and the complex processing process of the voice is likely to lead the user to have a worse voice mixing experience when the user sends the current voice to the user, and the voice is relatively delayed.
Therefore, how to reduce the delay time of the user hearing the mixed sound corresponding to the current voice when the user performs the singing activity is a problem to be solved.
Disclosure of Invention
Based on the above, a method, a device, a computer device and a computer readable storage medium for processing mixed sound are provided, so as to solve the problem of how to reduce the delay time of the user hearing the mixed sound corresponding to the current voice when the user performs singing activities.
In a first aspect, an embodiment of the present invention provides a method for processing a mixing sound, where the method for processing a mixing sound is applied to an operating system of a computer device, and the method for processing a mixing sound includes the following steps:
The accompaniment data output by the application program in the computer equipment are sent to the kernel space of the operating system, and the kernel space is used for outputting the accompaniment data to a playing module for playing;
Acquiring a current accompaniment which is output to the playing module at the current moment by the kernel space;
Transmitting the current voice acquired by the radio module at the current moment to the kernel space;
and in the kernel space, mixing the current accompaniment and the current voice to obtain the mixed data at the current moment, wherein the kernel space is used for outputting the mixed data to the playing module for playing.
In a second aspect, an embodiment of the present invention provides a mixing processing apparatus, where the mixing processing apparatus is applied to an operating system of a computer device, and the mixing processing apparatus includes:
the first sending module is used for sending accompaniment data output by an application program in the computer equipment to a kernel space of the operating system, and the kernel space is used for outputting the accompaniment data to the playing module for playing;
the first acquisition module is used for acquiring the current accompaniment which is output to the playing module at the current moment by the kernel space;
the second sending module is used for sending the current voice acquired by the sound receiving module at the current moment to the kernel space;
And the sound mixing module is used for mixing the current accompaniment and the current voice in the kernel space to obtain the sound mixing data at the current moment, and the kernel space is used for outputting the sound mixing data to the playing module for playing.
In a third aspect, an embodiment of the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the steps of the above-mentioned method for processing mixing sound in the first aspect are implemented when the processor executes the computer program.
In a fourth aspect, an embodiment of the present invention provides a computer readable storage medium storing a computer program, which when executed by a processor, implements the steps of the above-described mixing processing method of the first aspect.
The invention is different from the technical effects obtained by the scheme in the prior art: the invention relates to a sound mixing processing method, which is applied to an operating system of a computer device, and is characterized in that accompaniment data output by an application program in the computer device are sent to a kernel space of the operating system, current accompaniment of the kernel space output to a playing module at the current moment is obtained, current voice acquired by a sound receiving module at the current moment is sent to the kernel space, and sound mixing processing is carried out on the current accompaniment and the current voice in the kernel space, so that sound mixing data at the current moment is obtained. The method and the device have the advantages that through sending the current voice and the current accompaniment to the kernel space, the voice mixing processing is carried out in the kernel space, compared with the voice mixing processing carried out in the user space, the time for switching the kernel space to the user space, which is involved, of the collected current voice is saved, the time for switching the mixed voice data from the user space to the kernel space, which is involved, of the mixed voice data is played, and the time for switching the user space to the kernel space, which is involved, is reduced, so that the delay time for sending the current voice to the mixed voice corresponding to the current voice by a user is shortened, and better singing experience is brought for the user.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments of the present invention will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of a method for processing mixing sound according to a first embodiment of the present invention;
Fig. 2 is a flow chart of a method for processing mixing sound according to a second embodiment of the present invention;
Fig. 3 is a flow chart of a method for processing mixed sound according to a third embodiment of the present invention;
Fig. 4 is a flow chart of a method for processing mixing sound according to a fourth embodiment of the present invention;
fig. 5 is an overall flow chart of a mixing processing method according to a fifth embodiment of the present invention;
fig. 6 is a schematic structural diagram of a mixing processing device according to a sixth embodiment of the present invention;
fig. 7 is a schematic structural diagram of a computer device according to a seventh embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be understood that the sequence numbers of the steps in the following embodiments do not mean the order of execution, and the execution order of the processes should be determined by the functions and the internal logic, and should not be construed as limiting the implementation process of the embodiments of the present invention.
As shown in fig. 1, a flowchart of a mixing processing method according to a first embodiment of the present invention is shown, and the embodiment provides a mixing processing method applied in an operating system of a computer device, where the mixing processing method may include the following steps:
Step S101: accompaniment data output by an application program in the computer device is transmitted to a kernel space of an operating system.
In this embodiment, the computer device may refer to an electronic device having input, data processing, storage and output functions, for example, the computer device may be a notebook computer, a television, a projector, etc., the application program may refer to a computer program developed and run on an operating system for completing one or more specific tasks, for example, in the audio data processing field of the present invention, the application program may be a national K song, a networkcloud music, a kukou music, etc., the accompaniment data may be data of sound components such as melodies, rhythms, musical instruments, etc., except for human voices, the operating system may refer to a computer program for managing and controlling computer hardware and software resources, for example, the operating system may be a Linux system, a Windows system, etc., the kernel space may be a memory space controlled and managed by an operating system kernel, and the kernel space may be used for outputting the accompaniment data to a playing module for playing.
In the process of sending the accompaniment data to the kernel space of the operating system, the accompaniment data can be sent to the kernel space of the operating system through a communication mechanism such as a shared memory or message transmission, and after the accompaniment data is received by the kernel, the accompaniment data is output to a playing module for playing. For example, the accompaniment data is sent to the kernel space of the operating system through the shared memory, firstly, a shared memory area for storing the accompaniment data can be allocated in the kernel space through the operating system, then, the shared memory can be mapped into the address space of the user space and the kernel space through system call, finally, the accompaniment data is written into the shared memory area by the application program according to the address of the mapped shared memory area, and the accompaniment data can be read from the shared memory by monitoring the change of the shared memory area by the program in the kernel space.
Step S102: and acquiring the current accompaniment of the kernel space output to the playing module at the current moment.
In this embodiment, the playing module may be a software or hardware component responsible for playing audio data, for example, the playing module may be a speaker, a sound device, a headset, and the like.
After the kernel space receives the accompaniment data, the received accompaniment data is required to be output to the playing module for playing, the accompaniment audio frames which are being played by the playing module are acquired, the playing time of the accompaniment audio frames which are being played by the corresponding playing module is recorded as the current moment, and the corresponding accompaniment audio frames which are being played are recorded as the current accompaniment. For example, in the process of obtaining the current accompaniment of the kernel space output to the playing module at the current moment, the playing state of the playing module is queried to obtain the time stamp information corresponding to the current accompaniment, the time stamp information can be used for identifying the playing time of the current accompaniment, and the current accompaniment is obtained by matching the accompaniment data received from the kernel space according to the time stamp information corresponding to the current accompaniment.
Step S103: and sending the current voice acquired by the sound receiving module at the current moment to the kernel space.
In this embodiment, the sound receiving module may be a software or hardware component responsible for collecting voice data, for example, the sound receiving module may be a microphone, a sound card, etc., and the current voice is the voice data collected at the current moment. In the process of sending the current voice collected by the sound receiving module at the current moment to the kernel space, the current voice data collected at the current moment can be read from the buffer zone of the sound receiving module through system call, and the read current voice is sent to the kernel space. For example, the current voice may be read from the buffer of the sound reception module through a system call function read () for a read operation, and the read current voice may be transmitted into the kernel space through a system call function mmap () for a data transfer operation.
Step S104: and in the kernel space, mixing the current accompaniment and the current voice to obtain the mixing data at the current moment.
In this embodiment, the audio mixing data may be audio data including accompaniment and voice, and the kernel space is used to output the audio mixing data to the playing module for playing.
The method comprises the steps of obtaining current accompaniment and current voice from an audio buffer area of a kernel space, mixing the current accompaniment and the current voice, wherein the mixing treatment can be a mixing method such as weighted mixing, average mixing, maximum mixing or minimum mixing of the current accompaniment and the current voice, for example, the mixing treatment is carried out by the mixing method of average mixing, the current accompaniment and the current voice are obtained from the audio buffer area of the kernel space, and the average value is obtained after the current accompaniment and the current voice are added and processed, so that the mixing data after the mixing treatment can be obtained.
In an embodiment, in the mixing processing method for weighting accompaniment and voice, the depth and dimension of sound may be increased by performing reverberation processing on accompaniment, voice or mixing data by designing a specific function, or resampling processing may be performed on accompaniment, voice or mixing data by designing a specific function, so as to perform mixing processing and playing on accompaniment, voice or mixing data.
In an embodiment, the audio mixing data at the current time may be played simultaneously with a next accompaniment of the current accompaniment, for example, if the current time is recorded as T 0, the current accompaniment is recorded as X 0, the current voice is recorded as Z 0, the audio mixing data at the current time may be recorded as X 0+Z0, if the next accompaniment of the current accompaniment is recorded as Y 1, the playing time of the next accompaniment of the current accompaniment is recorded as T 1(T1>T0), and if the audio mixing data at the current time and the next accompaniment of the current accompaniment are played simultaneously, that is, the audio mixing data X 0+Z0 corresponding to the time T 0 and the accompaniment Y 1 corresponding to the time T 1 are played simultaneously at the time T 1.
In this embodiment, accompaniment data output by an application program in a computer device is sent to a kernel space of an operating system, a current accompaniment that the kernel space outputs to a playing module at a current moment is obtained, a current voice collected by a sound receiving module at the current moment is sent to the kernel space, and mixing processing is performed on the current accompaniment and the current voice in the kernel space to obtain mixed voice data at the current moment, wherein by sending the current voice and the current accompaniment to the kernel space and performing mixing processing in the kernel space, compared with the mixing processing in a user space, the time for transferring the collected current voice from the kernel space to the user space, the time for switching the related kernel space to the user space, and the time for playing the mixed voice data, the time for transferring the mixed voice data from the user space to the kernel space, and the time for switching the user space to the kernel space are saved, so that delay time for a user to send the current voice to hear the mixed voice corresponding to the current voice is reduced, and better singing experience is brought to the user.
As shown in fig. 2, a flow chart of a mixing processing method provided in the second embodiment of the present invention is shown, in the first embodiment, in step S104, mixing processing is performed on a current accompaniment and a current voice to obtain mixing data at a current moment, and the method may include the following steps:
Step S201: and acquiring an accompaniment weight value preset for the current accompaniment and a voice weight value preset for the current voice.
In this embodiment, the preset accompaniment weight may be a preset weight of the current accompaniment, for example, the preset accompaniment weight may be used to represent a relative sound value in the audio mix data of the current accompaniment at the current time, and the preset vocal weight may be a preset weight of the current vocal, for example, the preset vocal weight may be used to represent a relative sound value in the audio mix data of the current vocal at the current time.
Step S202: and weighting the current accompaniment and the current voice according to the preset accompaniment weight value and the preset voice weight value to obtain the mixing data at the current moment.
In the process of weighting the current accompaniment and the current voice, the weighting processing mode may be a calculation mode such as weighted average, weighted summation and weighted product, for example, the weighting processing is performed on the current accompaniment and the current voice by the calculation mode of weighted summation, firstly, multiplication operation is performed on a preset accompaniment weight value and the current accompaniment, multiplication operation is performed on a preset voice weight value and the current voice, and then, summation processing is performed on the product result of the two multiplication operations, so that the mixed voice data of the current moment after the weighting processing can be obtained. For example, if the preset accompaniment weight is w1, the preset vocal weight is w2, the current accompaniment is X, and the current vocal is Y, the obtained mixing data at the current moment may be expressed as w1×x+w2×y by a calculation method of weighted summation.
In this embodiment, the current accompaniment and the current voice are weighted according to the preset accompaniment weight value and the preset voice weight value, so as to obtain the mixing data at the current moment. The accompaniment weight value and the human voice weight value are used for carrying out weighting processing on the accompaniment and the human voice respectively, so that the proportion of the accompaniment and the human voice in the mixed sound data can be better controlled, the coordination and the balance feeling of the mixed sound data are improved, and better hearing experience feeling is brought to a user.
As shown in fig. 3, a flow chart of a mixing processing method according to a third embodiment of the present invention may further include the following steps after obtaining mixing data at the current time in step S104 in the first embodiment:
Step S301: and acquiring the data quantity of the mixing data at the current moment.
Step S302: and detecting whether the data quantity of the mixed data at the current moment is larger than a preset first data quantity threshold value.
Step S303: if the data volume of the mixing data at the current moment is detected to be larger than the preset first data volume threshold, the data volume of the mixing data at the current moment is compressed to the preset first data volume threshold.
In this embodiment, the data amount may refer to a size of the mixing data, and the preset first data amount threshold may be a preset data amount of the mixing data.
For example, if the data amount of the mixed audio data may be binary represented by a 16-bit signed integer, the range of the decimal signed integer represented by the 16-bit signed integer represented by the binary may be-32768 to 32767, the preset first data amount threshold may be determined to be 32767 according to the range of the decimal signed integer represented by the 16-bit signed integer, and the process of detecting whether the data amount of the mixed audio data at the current time is greater than the preset first data amount threshold may be a process of detecting whether the data amount of the mixed audio data at the current time overflows upwards, that is, if the data amount of the mixed audio data at the current time is 40000, the data amount of the mixed audio data at the current time may be considered to be greater than the preset first data amount threshold, that is, the data amount of the mixed audio data at the current time may be considered to overflow upwards, and the data amount of the mixed audio data at the current time may be compressed to the preset first data amount threshold.
In this embodiment, if it is detected that the data amount of the mixing data at the current time is greater than the preset first data amount threshold, the data amount of the mixing data at the current time is compressed to the preset first data amount threshold, and overflow detection is performed on the mixing data obtained by weighting, so that the integrity of the mixing data is ensured, and breakdown of the program due to data overflow is avoided, thereby improving the stability and reliability of the program
As shown in fig. 4, a flow chart of a mixing processing method according to a fourth embodiment of the present invention is shown, and after the data amount of the mixing data at the current time is obtained in step S301 in the third embodiment, the method may further include the following steps:
S401: and detecting whether the data quantity of the mixing data at the current moment is smaller than a preset second data quantity threshold value.
S402: if the data volume of the mixing data at the current moment is detected to be smaller than the preset second data volume threshold value, the data volume of the mixing data at the current moment is compressed to the preset second data volume threshold value.
In this embodiment, the preset second data amount threshold may be a preset data amount size of the mix data.
For example, if the data amount of the mixed audio data can be binary represented by a 16-bit signed integer, the range of the decimal signed integer which can be represented by the 16-bit signed integer represented by the binary representation is-32768 to 32767, the preset second data amount threshold value can be determined to be-32768 according to the range of the decimal signed integer which can be represented by the 16-bit signed integer, the process of detecting whether the data amount of the mixed audio data at the current time is smaller than the preset second data amount threshold value, that is, the process of detecting whether the data amount of the mixed audio data at the current time overflows downwards, that is, if the data amount of the mixed audio data at the current time is-40000, the data amount of the mixed audio data at the current time is smaller than the preset second data amount threshold value, that is, the data amount of the mixed audio data at the current time is considered to overflow downwards, and the data amount of the mixed audio data at the current time is compressed to the preset second data amount threshold value.
In this embodiment, if it is detected that the data amount of the mixing data at the current time is smaller than the preset second data amount threshold, the data amount of the mixing data at the current time is compressed to the preset second data amount threshold, and overflow detection is performed on the mixing data obtained by weighting, so that the integrity of the mixing data is ensured, and breakdown of the program due to data overflow is avoided, thereby improving the stability and reliability of the program.
As shown in fig. 5, which is an overall flow chart of a mixing processing method provided in a fifth embodiment of the present invention, the present embodiment provides a mixing processing method that can be applied to a scene controlled in a vehicle, that is, an application such as singing by a user using the mixing processing method in the vehicle, specifically, an application in an operating system of a computer device in the scene controlled in the vehicle, where the application is a vehicle-mounted application, and step S101 in the first embodiment sends accompaniment data output by the application in the computer device to a kernel space of the operating system, which may include:
and transmitting accompaniment data output by the vehicle-mounted application program from a user space of the operating system to a kernel space of the operating system through a system call interface of the operating system.
In this embodiment, the in-vehicle application may refer to an application used on a vehicle, and the system call interface may refer to a set of functions provided by an operating system for implementing various system-level functions and services, for example, the system call interface may be: an open ()'s for opening a file, a fork () for creating a process operation, a socket () for implementing a network connection operation, etc., and the user space may refer to a memory space allocated by the operating system for a user for storing personal data and programs of the user, and the kernel space is used for outputting accompaniment data to a play module for play.
As shown in fig. 5, in the scene controlled in the vehicle, the operating system is a Linux operating system, the application is a vehicle-mounted application, in transmitting accompaniment data outputted from the vehicle-mounted application from a user space to a kernel space through a system call interface, firstly, the vehicle-mounted application transmits the accompaniment data to an Audio hardware abstraction layer (Audio HAL) through an interface provided by an Audio frame (Audio frame), then the Audio HAL creates a system call request including the accompaniment data through the system call interface, and transmits the system call request from the user space to the kernel space, wherein the system call interface may be send () for a data transfer operation or write () for file writing, etc., and finally, if the system call request is received by the kernel, the kernel will process the system call request, determine the corresponding Audio driver in the Linux driving layer, send the accompaniment data to the corresponding Audio driver, send the received accompaniment data to the digital signal Processor (DIGITAL SIGNAL Processor, DSP) of the Audio hardware by the Audio driver to process and play the accompaniment data, obtain the current accompaniment of the kernel space output to the DSP at the current time, send the current voice collected by the DSP at the current time through the USB (Universal Serial Bus) receiver to the kernel space, specifically refer to the contents in step S202 and step S203, after the current accompaniment and the current voice are both sent to the kernel space, the Linux driving layer in the kernel space mixes the current accompaniment and the current voice to obtain the mixed data of the current time, specifically, the contents in step S204, step S301 and step S302 may be referred to, and after the mixed data is obtained, the mixed data may be sent to the DSP through a system call to process and play the mixed data.
Alternatively, after obtaining the mixing data at the current time, the mixing data at the current time may be sent to an application program in a user space of the operating system for storage through a system call interface of the operating system. For example, the mix data at the present time may be copied from the kernel space to the user space through a system call interface read (), write (), send (), or the like for a transfer operation, and stored in the user space.
In this embodiment, the application program is a vehicle-mounted application program, and accompaniment data output by the vehicle-mounted application program is sent from a user space of the operating system to a kernel space of the operating system through a system call interface of the operating system. The accompaniment data is transmitted through system call, damage to the accompaniment data is avoided, accuracy and safety of accompaniment data transmission are guaranteed, and meanwhile efficiency of accompaniment data transmission is improved.
As shown in fig. 6, a schematic structural diagram of a mixing processing device according to a sixth embodiment of the present application is provided, where the mixing processing device corresponds to the mixing processing method in the foregoing embodiment one by one, and the mixing processing device is applied to an operating system of a computer device, and the mixing processing device includes a first sending module 61, a first obtaining module 62, a second sending module 63, and a mixing module 64. The functional modules are described in detail as follows:
A first sending module 61, configured to send accompaniment data output by an application program in the computer device to a kernel space of the operating system, where the kernel space is configured to output the accompaniment data to a playing module for playing;
A first obtaining module 62, configured to obtain a current accompaniment that is output to the playing module at the current time by the kernel space;
A second sending module 63, configured to send the current voice collected by the sound receiving module at the current time to the kernel space;
And the mixing module 64 is configured to perform mixing processing on the current accompaniment and the current voice in the kernel space to obtain mixing data at the current moment, where the kernel space is used to output the mixing data to the playing module for playing.
Optionally, the above-mentioned mixing module 64 includes:
The second acquisition sub-module is used for acquiring an accompaniment weight value preset for the current accompaniment and a voice weight value preset for the current voice;
And the weighting sub-module is used for carrying out weighting processing on the current accompaniment and the current voice according to the preset accompaniment weight value and the preset voice weight value to obtain the mixed data at the current moment.
Optionally, the mixing processing device further includes:
A third obtaining module, configured to obtain a data amount of the mixing data at the current time;
the first detection module is used for detecting whether the data volume of the mixing data at the current moment is larger than a preset first data volume threshold value or not;
And the first compression module is used for compressing the data volume of the mixing data at the current moment to the preset first data volume threshold value if the data volume of the mixing data at the current moment is detected to be larger than the preset first data volume threshold value.
Optionally, the mixing processing device further includes:
the second detection module is used for detecting whether the data volume of the mixing data at the current moment is smaller than a preset second data volume threshold value or not;
And the second compression module is used for compressing the data volume of the mixing data at the current moment to the preset second data volume threshold value if the data volume of the mixing data at the current moment is detected to be smaller than the preset second data volume threshold value.
For specific limitations of the mixing processing apparatus, reference may be made to the above limitations of the mixing processing method, and no further description is given here. The respective modules in the above-described mixing processing apparatus may be implemented in whole or in part by software, hardware, and a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
Fig. 7 is a schematic structural diagram of a terminal device according to a seventh embodiment of the present invention. As shown in fig. 7, the terminal device of this embodiment includes: at least one processor (only one shown in fig. 7), a memory, and a computer program stored in the memory and executable on the at least one processor, the processor implementing the steps in any of the various mixing processing method embodiments described above when the computer program is executed.
The terminal device may include, but is not limited to, a processor, a memory. It will be appreciated by those skilled in the art that fig. 7 is merely an example of a terminal device and is not limiting of the terminal device, and that the terminal device may comprise more or less components than shown, or may combine some components, or different components, e.g. may further comprise a network interface, a display screen, an input device, etc.
The Processor may be a central processing unit (Central Processing Unit, CPU), which may also be other general purpose processors, digital signal processors (DIGITAL SIGNAL Processor, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), off-the-shelf Programmable gate array (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory includes a readable storage medium, an internal memory, etc., where the internal memory may be a memory of the terminal device, and the internal memory provides an environment for the operation of an operating system and computer readable instructions in the readable storage medium. The readable storage medium may be a hard disk of the terminal device, and in other embodiments may be an external storage device of the terminal device, for example, a plug-in hard disk, a smart memory card (SMART MEDIA CARD, SMC), a Secure Digital (SD) card, a flash memory card (FLASH CARD) or the like provided on the terminal device. Further, the memory may also include both an internal storage unit of the terminal device and an external storage device. The memory is used to store an operating system, application programs, boot loader (BootLoader), data, and other programs such as program codes of computer programs, and the like. The memory may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, the specific names of the functional units and modules are only for distinguishing from each other, and are not used for limiting the protection scope of the present invention. The specific working process of the units and modules in the above device may refer to the corresponding process in the foregoing method embodiment, which is not described herein again. The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the present invention may implement all or part of the flow of the method of the above-described embodiment, and may be implemented by a computer program to instruct related hardware, and the computer program may be stored in a computer readable storage medium, where the computer program, when executed by a processor, may implement the steps of the method embodiment described above. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, executable files or in some intermediate form, etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code, a recording medium, a computer Memory, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), an electrical carrier signal, a telecommunications signal, and a software distribution medium. Such as a U-disk, removable hard disk, magnetic or optical disk, etc. In some jurisdictions, computer readable media may not be electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
The present invention may also be implemented by a computer program product for implementing all or part of the steps of the method embodiments described above, when the computer program product is run on a terminal device, causing the terminal device to execute the steps of the method embodiments described above.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other manners. For example, the apparatus/terminal device embodiments described above are merely illustrative, e.g., the division of modules or units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection via interfaces, devices or units, which may be in electrical, mechanical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
The above embodiments are only for illustrating the technical aspects of the present invention, not for limiting the same, and although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may be modified or some technical features may be replaced with other technical solutions, and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and all the modifications or replacements are included in the protection scope of the present invention.

Claims (10)

1. A method for processing a sound mixture, wherein the method is applied to an operating system of a computer device, and the method comprises the following steps:
The accompaniment data output by the application program in the computer equipment are sent to the kernel space of the operating system, and the kernel space is used for outputting the accompaniment data to a playing module for playing;
Acquiring a current accompaniment which is output to the playing module at the current moment by the kernel space;
Transmitting the current voice acquired by the radio module at the current moment to the kernel space;
and in the kernel space, mixing the current accompaniment and the current voice to obtain the mixed data at the current moment, wherein the kernel space is used for outputting the mixed data to the playing module for playing.
2. The method for processing mixing according to claim 1, wherein said performing mixing processing on said current accompaniment and said current human voice to obtain mixing data of said current time comprises:
Acquiring an accompaniment weight value preset for the current accompaniment and a voice weight value preset for the current voice;
and weighting the current accompaniment and the current voice according to the preset accompaniment weight value and the preset voice weight value to obtain the mixed data at the current moment.
3. The mixing processing method according to claim 1, further comprising, after said obtaining the mixing data at the current time:
acquiring the data quantity of the mixing data at the current moment;
Detecting whether the data quantity of the mixing data at the current moment is larger than a preset first data quantity threshold value or not;
If the data volume of the mixing data at the current moment is detected to be larger than the preset first data volume threshold, the data volume of the mixing data at the current moment is compressed to the preset first data volume threshold.
4. The mixing processing method according to claim 3, further comprising, after said acquiring the data amount of the mixing data at the current time:
Detecting whether the data quantity of the mixing data at the current moment is smaller than a preset second data quantity threshold value or not;
And if the data quantity of the mixing data at the current moment is detected to be smaller than the preset second data quantity threshold value, compressing the data quantity of the mixing data at the current moment to the preset second data quantity threshold value.
5. The method of claim 1, wherein the application is a vehicle-mounted application, and the sending accompaniment data output by the application in the computer device to the kernel space of the operating system comprises:
And transmitting accompaniment data output by the vehicle-mounted application program from a user space of the operating system to a kernel space of the operating system through a system call interface of the operating system.
6. The mixing processing method according to claim 1, further comprising, after said obtaining the mixing data at the current time:
and sending the mixing data at the current moment to a user space of the operating system for storage through a system call interface of the operating system.
7. A mixing processing device, wherein the mixing processing device is applied to an operating system of a computer device, and the mixing processing device comprises:
the first sending module is used for sending accompaniment data output by an application program in the computer equipment to a kernel space of the operating system, and the kernel space is used for outputting the accompaniment data to the playing module for playing;
the first acquisition module is used for acquiring the current accompaniment which is output to the playing module at the current moment by the kernel space;
the second sending module is used for sending the current voice acquired by the sound receiving module at the current moment to the kernel space;
And the sound mixing module is used for mixing the current accompaniment and the current voice in the kernel space to obtain the sound mixing data at the current moment, and the kernel space is used for outputting the sound mixing data to the playing module for playing.
8. The mixing processing apparatus of claim 7, wherein the mixing module comprises:
The second acquisition sub-module is used for acquiring an accompaniment weight value preset for the current accompaniment and a voice weight value preset for the current voice;
And the weighting sub-module is used for carrying out weighting processing on the current accompaniment and the current voice according to the preset accompaniment weight value and the preset voice weight value to obtain the mixed data at the current moment.
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 the processor implements the steps of the mixing processing method according to any one of claims 1 to 6 when the computer program is executed.
10. A computer-readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the steps of the mixing processing method according to any one of claims 1 to 6.
CN202410083299.5A 2024-01-19 2024-01-19 Mixing processing method, device, computer equipment and computer readable storage medium Pending CN118098182A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410083299.5A CN118098182A (en) 2024-01-19 2024-01-19 Mixing processing method, device, computer equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410083299.5A CN118098182A (en) 2024-01-19 2024-01-19 Mixing processing method, device, computer equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN118098182A true CN118098182A (en) 2024-05-28

Family

ID=91149738

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410083299.5A Pending CN118098182A (en) 2024-01-19 2024-01-19 Mixing processing method, device, computer equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN118098182A (en)

Similar Documents

Publication Publication Date Title
CN111078930A (en) Audio file data processing method and device
CN201946299U (en) Vehicle-mounted bluetooth wireless player
CN110941415B (en) Audio file processing method and device, electronic equipment and storage medium
WO2024045634A1 (en) Vehicle interior-exterior conversation method and system based on vehicle-mounted entertainment system, and vehicle
CN100401281C (en) System for multimedia rendering in a portable device
CN108289232B (en) Control method of playing device, terminal device and storage medium
CN113050985B (en) Front-end engineering dependency automatic registration method and device
EP3657821A1 (en) Method and device for playing back audio, and terminal
CN111857473B (en) Audio playing method and device and electronic equipment
CN110971943A (en) Video code rate adjusting method, device, terminal and storage medium
CN118098182A (en) Mixing processing method, device, computer equipment and computer readable storage medium
CN112738726A (en) Positioning method, positioning device, terminal and storage medium
CN114639392A (en) Audio processing method and device, electronic equipment and storage medium
CN110600022B (en) Audio processing method and device and computer storage medium
CN1316877A (en) Portable voice device
CN109714734B (en) DMR system, wireless communication method and device of DMR and terminal equipment
CN105549945B (en) A kind of audio transmission management method and user terminal
CN111028848B (en) Compressed voice processing method and device and electronic equipment
CN112019919B (en) Video sticker adding method and device and electronic equipment
CN115223582B (en) Audio noise processing method, system, electronic device and medium
CN113763139B (en) Queuing number bidding method based on blockchain, electronic device and storage medium
CN111381796B (en) Processing method and device for realizing KTV function on client and user equipment
CN103186357B (en) A kind of method and electronic equipment showing information
CN114974186A (en) Audio processing method, apparatus, device, medium, and program product
CN116405813A (en) Method and device for cooperatively realizing function of sound box, sound box and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination