Audio processing method, device and electronic equipment in game
Patent Information
- Application Number
- CN202310861399.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-13
- Publication Date
- 2026-10-16
- Estimated Expiration
- 2043-07-13
AI Technical Summary
相关技术中,从声音的接收和声音的传播模拟两个维度,分别采用HRTF(Head Related Transfer Function,头相关变换函数,)和复杂的空间音频模拟的方法,使得游戏中的声音兼顾空间和声场定位,但是这些方法需要占用大量的系统资源,可能还需要复杂的物理建模,或大量的实时射线检测,需要消耗较大的游戏系统资源,导致游戏的稳定性较差,进而导致玩家的游戏体验感较差
[0016]This invention provides an audio processing method, apparatus, and electronic device for games. The method involves acquiring a first audio signal emitted from a target location within a game scene; converting the first audio signal into a second audio signal; the first audio signal being multi-channel audio and the second audio signal being mono audio; playing the second audio signal and controlling its variation according to preset sound attenuation and channel mixing coefficients; and ensuring that the proportion of multi-channel audio to mono audio in the second audio signal varies at different times. In this method, after a sound is emitted from the target location within the game scene, mono audio is played first to provide clear spatial positioning information, and then gradually converted to multi-channel audio over time, maintaining the original spatial diffusion effect. The simple channel mixing coefficients effectively balance spatial positioning and sound field width, while consuming fewer game system resources, thus improving game stability and player experience.
Smart Images

Figure CN117065345B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to an audio processing method, apparatus, and electronic device for games. Background Technology
[0002] Sound propagation simulation technology in games is a technique applied in game development to enhance the immersion and realism of games. Currently, sound propagation simulation technology in games mainly includes two approaches: simple distance-based models and complex physics-based models. These technologies employ HRTF (Head Related Transfer Function) and complex spatial audio simulation methods to simulate sound reception and propagation, respectively, enabling game sound to achieve spatial and sound field localization. However, these methods require significant system resources, potentially necessitating complex physical modeling or extensive real-time raycasting, leading to poor game stability and consequently a poor player experience. Summary of the Invention
[0003] In view of this, the purpose of the present invention is to provide an audio processing method, device and electronic device for games. After a sound is emitted at the target scene location in the game scene, it first plays a mono channel to provide clear spatial positioning information, and then gradually becomes multi-channel over time to give the sound the original spatial diffusion effect. By using a simple channel mixing coefficient, it can take into account both the spatial positioning and sound field width of the sound, and consumes less game system resources, thereby improving the stability of the game and the player's gaming experience.
[0004] In a first aspect, embodiments of the present invention provide an audio processing method in a game, the method comprising: acquiring a first audio emitted from a target scene location in a game scene; wherein the first audio is multi-channel audio; converting the first audio into a second audio; wherein the second audio is mono audio; playing the second audio and controlling the second audio to change according to a preset sound attenuation coefficient and a channel mixing coefficient; wherein the proportion of multi-channel audio in the second audio is different from the proportion of mono audio at different times.
[0005] The steps of playing the second audio and controlling the second audio to change according to the channel mixing coefficient include: playing the second audio and controlling the second audio to change according to the preset channel mixing coefficient within the target duration.
[0006] At the first moment of the target duration, the proportion of multi-channel audio in the second audio is equal to the proportion of mono audio; at the second moment of the target duration, the proportion of multi-channel audio in the second audio is greater than the proportion of mono audio; the first moment is earlier than the second moment.
[0007] Before the steps of playing the second audio and controlling the second audio to change according to the preset channel mixing coefficient within the target duration, the above method further includes: determining the current scene position of the controlled virtual character in the game scene and calculating the scene distance between the current scene position and the target scene position; and determining the target duration based on the scene distance.
[0008] The steps for determining the target duration based on scene distance include: if the scene distance is less than or equal to the specified distance, determining the target duration based on the scene distance.
[0009] The steps for determining the target duration based on scene distance include: if the scene distance is greater than the specified distance, the target duration is determined to be the maximum duration.
[0010] The distance in the above scenarios is positively correlated with the target duration.
[0011] The mono audio mentioned above is used to enhance the spatial positioning effect of sound; multi-channel audio is used to enhance the spatial effect of sound.
[0012] Secondly, embodiments of the present invention provide an audio processing device for a game, the device comprising: an audio acquisition module for acquiring a first audio emitted from a target scene location in a game scene; wherein the first audio is multi-channel audio; an audio conversion module for converting the first audio into a second audio; wherein the second audio is mono audio; playing the second audio and controlling the second audio to change according to a preset sound attenuation coefficient and channel mixing coefficient; wherein the proportion of multi-channel audio and the proportion of mono audio in the second audio are different at different times.
[0013] Thirdly, embodiments of the present invention provide an electronic device, including a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the audio processing method in the game of any one of the first aspects.
[0014] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are invoked and executed by a processor, the computer-executable instructions cause the processor to implement the audio processing method in the game according to any one of the first aspects.
[0015] The embodiments of the present invention bring the following beneficial effects:
[0016] This invention provides an audio processing method, apparatus, and electronic device for games. The method involves acquiring a first audio signal emitted from a target location within a game scene; converting the first audio signal into a second audio signal; the first audio signal being multi-channel audio and the second audio signal being mono audio; playing the second audio signal and controlling its variation according to preset sound attenuation and channel mixing coefficients; and ensuring that the proportion of multi-channel audio to mono audio in the second audio signal varies at different times. In this method, after a sound is emitted from the target location within the game scene, mono audio is played first to provide clear spatial positioning information, and then gradually converted to multi-channel audio over time, maintaining the original spatial diffusion effect. The simple channel mixing coefficients effectively balance spatial positioning and sound field width, while consuming fewer game system resources, thus improving game stability and player experience.
[0017] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.
[0018] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0019] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0020] Figure 1 A flowchart of an audio processing method in a game provided by an embodiment of the present invention;
[0021] Figure 2 A function curve provided in an embodiment of the present invention;
[0022] Figure 3 Another function curve provided in this embodiment of the invention;
[0023] Figure 4 This is a schematic diagram of the structure of an audio processing device in a game provided by an embodiment of the present invention;
[0024] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0026] Sound propagation simulation technology in games is a technique applied in game development to enhance the immersion and realism of games. It involves solving multiple technical challenges, including sound source localization, environmental simulation, and multi-channel sound, making it technically demanding. In the real world, sound waves undergo complex physical changes during propagation, including natural energy attenuation, reflection, diffraction, and transmission. Simulating the natural propagation of sound within games using digital methods has always been a cutting-edge research topic in game audio development.
[0027] Currently, sound propagation simulation technology in games mainly includes two approaches: a simple model based on distance and a complex model based on physics simulation.
[0028] Low-quality games typically use simple models to simulate sound propagation, neglecting complex effects like sound transmission and diffraction, and only simulating basic distance attenuation. Sound simulation in open environments is also relatively simple, merely applying fixed pre-defined curves for volume attenuation and filtering. While simple, this method cannot simulate the complex process of sound propagation. It can only meet the basic sound localization requirements of large-scale 3D games, and in doing so, it downmixes multi-channel audio materials into mono, resulting in a loss of spatial sound.
[0029] High-quality games with ample development budgets typically employ complex physics-based models. Different approaches use different methods to acquire spatial information within the game scene and then simulate sound wave propagation based on this information. While this method can simulate relatively realistic sound propagation effects, it involves significant computational demands and is highly complex to implement.
[0030] Simple sound simulation models typically downmix sound materials when performing spatial sound localization, converting stereo sound into mono to facilitate the representation of spatial localization effects. While this approach emphasizes the directional information of sound, it introduces a problem: a loss of spatial sound perception.
[0031] When trying to represent a sound coming from the side, the game engine completely removes the sound from the other direction. This results in only one direction having sound, which is highly illogical in reality. The effect is also unsatisfactory when trying to represent a sound coming from directly in front or behind. Because game engines downmix all multi-channel audio to mono to improve the accuracy of sound spatial positioning, sounds from directly in front or behind will also be downmixed into a single point after a certain distance from the listener, losing the original width information of the sound file. This also contradicts the acoustic logic of the real world. In the real world, as sound travels further away from a person, because sound propagates divergently, one can perceive not only the phase of the sound but also that it radiates from the sound source, creating an increasingly wider sound field. Traditional simplified models cannot simulate this effect.
[0032] To address the aforementioned issues, related technologies attempt to solve the problem from two dimensions: sound reception and sound propagation simulation. These methods employ HRTF (Head Related Transfer Function) and complex spatial audio simulation to achieve a balance between spatial and sound field localization in games. HRTF utilizes the human binaural effect to enhance sound spatial localization, resolving the issue of only one ear hearing sound when lateral. However, it cannot address the loss of sound field width for forward sounds. Several complex spatial audio simulation techniques have been developed, effectively addressing the aforementioned problems and balancing spatial localization and sound field width during sound propagation simulation. However, these methods invariably require significant system resources, necessitating either complex physical modeling or extensive real-time raycasting. This poses a substantial challenge to game performance and optimization, leading to poor game stability and consequently a subpar player experience.
[0033] Based on this, embodiments of the present invention provide an audio processing method, apparatus, and electronic device for games, which can be applied to devices such as mobile phones, computers, laptops, and tablets.
[0034] In one embodiment of this disclosure, the audio processing method in a game can run on a local terminal device or a server. When the audio processing method in a game runs on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device.
[0035] In an optional implementation, various cloud applications, such as cloud gaming, can run under the cloud interaction system. Taking cloud gaming as an example, cloud gaming refers to a gaming method based on cloud computing. In the cloud gaming operating mode, the game program and the game screen presentation are separated. The storage and execution of audio processing methods in the game are completed on the cloud gaming server. The client device is used for data reception, transmission, and game screen presentation. For example, the client device can be a display device with data transmission capabilities located close to the user, such as a mobile terminal, television, computer, or PDA; however, the information processing is performed by the cloud gaming server in the cloud. When playing the game, the player operates the client device to send operation commands to the cloud gaming server. The cloud gaming server runs the game according to the operation commands, encodes and compresses game screen data, returns it to the client device via the network, and finally, the client device decodes and outputs the game screen.
[0036] In an optional implementation, taking a game as an example, the local terminal device stores the game program and is used to display the game screen. The local terminal device is used to interact with the player through a graphical user interface (GUI), i.e., conventionally by downloading, installing, and running the game program via an electronic device. The local terminal device can provide the GUI to the player in various ways, such as rendering it on the terminal's display screen or providing it to the player via holographic projection. For example, the local terminal device can include a display screen for displaying the GUI, which includes game screens, and a processor for running the game, generating the GUI, and controlling the display of the GUI on the display screen.
[0037] In one possible implementation, this embodiment of the invention provides an audio processing method for games. This method is applied to a terminal device, wherein the terminal device can be the aforementioned local terminal device or a client device in the aforementioned cloud interaction system. Figure 1 As shown, the method includes the following steps:
[0038] Step S102: Obtain the first audio emitted from the target scene location in the game scene; wherein, the first audio is multi-channel audio;
[0039] The aforementioned game scene includes various types of game objects, such as virtual characters, virtual buildings, virtual vehicles, virtual weapons, virtual vegetation, and virtual rivers. For example, in response to a sound trigger event, the system might acquire the first audio emitted from a target location within the game scene. This sound trigger event could be a sound emitted by a game object in the game scene, such as a virtual weapon firing a bullet, a virtual vehicle starting or moving, or a virtual weapon being thrown. Specifically, in response to the sound trigger event, the game audio engine acquires the first audio emitted from the target location within the game scene; this first audio is a three-dimensional sound, i.e., multi-channel audio.
[0040] Step S104: Convert the first audio to the second audio; wherein the second audio is a mono audio.
[0041] Specifically, this involves converting multi-channel audio to mono audio, focusing the sound on a single point. This provides spatial positioning information for the sound at the start of playback. The number of channels can be any mainstream audio channel format, including stereo, 5.1, 7.1, and other multi-channel formats.
[0042] Step S106: Play the second audio and control the second audio to change according to the preset sound attenuation coefficient and channel mixing coefficient; wherein, the proportion of multi-channel audio in the second audio is different from the proportion of mono audio at different times.
[0043] The aforementioned sound attenuation coefficient is used to control the volume of the second audio track to decrease over time. For example, the volume of the second audio track starts at 10, and gradually decreases over time until it reaches zero. Similarly, the aforementioned channel mixing coefficient is used to control the proportion of multi-channel audio in the second audio track to increase and the proportion of mono audio to decrease over time. For example, at the beginning of playback, the proportion of mono audio in the second audio track is 100%. After a period of time (e.g., 1 second), the proportion of mono audio in the second audio track is 50% and the proportion of multi-channel audio is 50%. After another period of time (e.g., 3 seconds), the proportion of mono audio in the second audio track is 25% and the proportion of multi-channel audio is 75%.
[0044] The aforementioned mono audio is used to enhance the spatial localization effect of sound; multi-channel audio is used to enhance the spatial effect of sound. In this embodiment, the simple simulation of sound propagation effects in an open environment can surpass traditional simple acoustic simulation schemes, although its final effect cannot match complex spatial audio simulation techniques. However, this scheme has very low system consumption, can be implemented using the basic functions of a game engine, requires no additional development functions, and does not require adding complex acoustic modeling simulations and ray calculations. The performance consumption on the game is almost negligible.
[0045] Because this solution consumes very little system resources, it can significantly improve the audio performance of 3D sound sources in open environments at a very low cost in the development of small-scale games or games with very demanding performance requirements.
[0046] This invention provides an audio processing method for games, which involves acquiring a first audio signal emitted from a target location in a game scene; converting the first audio signal into a second audio signal; the first audio signal being multi-channel audio and the second audio signal being mono audio; playing the second audio signal and controlling it to change according to a preset sound attenuation coefficient and channel mixing coefficient; the proportion of multi-channel audio to mono audio in the second audio signal varies at different times. In this method, after a sound is emitted from the target location in the game scene, mono audio is played first to provide clear spatial positioning information, and then gradually becomes multi-channel over time, giving the sound its original spatial diffusion effect. A simple channel mixing coefficient can balance the spatial positioning and sound field width of the sound, while consuming fewer game system resources, thus improving game stability and the player's gaming experience.
[0047] In step S106 above, the step of playing the second audio and controlling the second audio to change according to the channel mixing coefficient can be implemented as follows: playing the second audio and controlling the second audio to change according to the preset channel mixing coefficient within the target duration.
[0048] The target duration mentioned above refers to the playback time of the second audio file. Specifically, at the first moment of the target duration, the proportion of multi-channel audio in the second audio file is equal to the proportion of mono audio; at the second moment of the target duration, the proportion of multi-channel audio in the second audio file is greater than the proportion of mono audio; the first moment is earlier than the second moment. For example, if the target duration is 5 seconds, at the initial moment, the proportion of multi-channel audio in the second audio file is 0, and the proportion of mono audio is 100%; at the first moment of the target duration (e.g., 2 seconds or 3 seconds), the proportion of multi-channel audio in the second audio file is 50%, and the proportion of mono audio is 50%; at the second moment of the target duration (e.g., at the 5th second), the proportion of multi-channel audio in the second audio file is 75%, and the proportion of mono audio is 25%. The sum of the proportions of multi-channel audio and mono audio in the second audio file is 100%.
[0049] For example, such as Figure 2The function curve shown represents the proportion of mono audio in the second audio track. 100 represents complete mixing (mono), and 0 represents no mixing, meaning the second audio track retains its original multi-channel audio but loses spatial positioning information. In this example, the target duration is 3 seconds, which can be understood as adding a 3-second timer to the second audio track. The horizontal axis represents the timer's duration. When the second audio track begins playing, the timer starts, and the sound gradually transitions from pure mono to 75% multi-channel and then 25% mono within 3 seconds. During this process, the spatial positioning effect weakens, but the sense of space is enhanced. It retains the initial spatial positioning ability of the sound while simulating the sound spreading from the source in the latter half of the sound, giving the sound a sufficient sense of space.
[0050] Considering the distance between the controlled virtual character and the target scene location in the game scene, the farther the distance, the slower the sound travels, and the closer the distance, the faster the sound travels. To further improve the spatial sense and diffusion of the sound, in this embodiment, before playing the second audio and controlling the second audio to change according to the preset channel mixing coefficient within the target duration, the above method further includes:
[0051] Determine the current scene position of the controlled virtual character in the game scene, and calculate the scene distance between the current scene position and the target scene position; determine the target duration based on the scene distance.
[0052] The aforementioned controlled virtual character is controlled via a terminal device. The scene distance and target duration are positively correlated; that is, the greater the scene distance, the longer the target duration. This positive correlation can be a proportional correlation, an exponential correlation, etc. Generally, scene distances have a certain range. To simulate realistic scenes, distant sounds are inaudible at very large distances.
[0053] For example, such as Figure 3 The function curve shown has the scene distance on the horizontal axis and the target duration on the vertical axis. When the scene distance is zero, the target duration is 3 seconds; when the scene distance is 9500 meters, the target duration is 6 seconds.
[0054] In the above methods, the farther the sound source is from the listener, the slower time passes. Therefore, the slower the sound is converted from mono to multi-channel, the slower the sound field spreads in the listener's subjective perception, making the sound seem farther away. This aligns with the logic of real-world acoustic propagation.
[0055] One possible implementation of the above steps for determining the target duration based on scene distance is as follows: if the scene distance is less than or equal to the specified distance, determine the target duration based on the scene distance.
[0056] The specified distance can be pre-set according to the needs of the game, such as 500m, 1000m, etc. For example, ... Figure 3 As shown, when the scene distance is less than or equal to the specified distance, according to... Figure 3 The function curve shown determines the target duration.
[0057] Another possible implementation of the step of determining the target duration based on scene distance is: if the scene distance is greater than the specified distance, the target duration is determined to be the maximum duration.
[0058] The maximum duration mentioned above is the target duration corresponding to the specified distance. For example, if the scene distance exceeds the specified distance, the target duration corresponding to the specified distance (i.e., the maximum duration mentioned above) will be used by default. However, this situation is generally unlikely because there is no sound in the game that can travel beyond the specified distance.
[0059] All of the above effects are modulated using preset effects from the audio engine, without the need for any additional plugins or development features. Furthermore, because they are all preset basic effects, the performance consumption is very low.
[0060] Corresponding to the above method embodiments, this invention provides an audio processing device for games, such as... Figure 4 As shown, the device includes:
[0061] The audio acquisition module 41 is used to acquire the first audio emitted from the target scene location in the game scene; wherein, the first audio is multi-channel audio;
[0062] Audio conversion module 42 is used to convert the first audio to a second audio; wherein the second audio is a mono audio.
[0063] The audio playback module 43 is used to play the second audio and control the second audio to change according to the preset sound attenuation coefficient and channel mixing coefficient; wherein, the proportion of multi-channel audio in the second audio is different from the proportion of mono audio at different times.
[0064] This invention provides an audio processing device for games, which acquires a first audio signal emitted from a target location in a game scene; converts the first audio signal into a second audio signal; the first audio signal is multi-channel audio, and the second audio signal is mono audio; plays the second audio signal and controls it to change according to a preset sound attenuation coefficient and channel mixing coefficient; the proportion of multi-channel audio and mono audio in the second audio signal varies at different times. In this method, after a sound is emitted from the target location in the game scene, mono audio is played first to provide clear spatial positioning information, and then gradually becomes multi-channel over time, giving the sound its original spatial diffusion effect; a simple channel mixing coefficient can balance the spatial positioning and sound field width of the sound, while consuming fewer game system resources, thus improving game stability and the player's gaming experience.
[0065] The aforementioned audio playback module is also used to: play a second audio, and control the second audio to change according to a preset channel mixing coefficient within a target duration.
[0066] At the first moment of the target duration, the proportion of multi-channel audio in the second audio is equal to the proportion of mono audio; at the second moment of the target duration, the proportion of multi-channel audio in the second audio is greater than the proportion of mono audio; the first moment is earlier than the second moment.
[0067] The aforementioned device further includes: a target duration determination module, used to determine the current scene position of the controlled virtual character in the game scene, and calculate the scene distance between the current scene position and the target scene position; and determine the target duration based on the scene distance.
[0068] The aforementioned target duration determination module is also used to: determine the target duration based on the scene distance if the scene distance is less than or equal to the specified distance.
[0069] The aforementioned target duration determination module is also used to: if the scene distance is greater than the specified distance, determine the target duration as the maximum duration.
[0070] The distance in the above scenarios is positively correlated with the target duration.
[0071] The mono audio mentioned above is used to enhance the spatial positioning effect of sound; multi-channel audio is used to enhance the spatial effect of sound.
[0072] The audio processing device in the game provided in this embodiment of the invention has the same technical features as the audio processing method provided in the above embodiments, so it can also solve the same technical problems and achieve the same technical effects.
[0073] This embodiment also provides an electronic device, including a processor and a memory. The memory stores machine-executable instructions that can be executed by the processor. The processor executes the machine-executable instructions to implement the audio processing method in the aforementioned game. This electronic device can be a server or a terminal device.
[0074] See Figure 5 As shown, the electronic device includes a processor 100 and a memory 101. The memory 101 stores machine-executable instructions that can be executed by the processor 100. The processor 100 executes the machine-executable instructions to implement the audio processing method in the game described above.
[0075] Furthermore, Figure 5 The electronic device shown also includes a bus 102 and a communication interface 103, with the processor 100, the communication interface 103 and the memory 101 connected via the bus 102.
[0076] The memory 101 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 103 (which can be wired or wireless), such as the Internet, wide area network, local area network, or metropolitan area network. The bus 102 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0077] Processor 100 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 100 or by instructions in software form. Processor 100 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a readily available storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 101, and the processor 100 reads the information from memory 101 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.
[0078] The processor in the aforementioned electronic device, by executing machine-executable instructions, can perform the following operations in the audio processing method of the aforementioned game:
[0079] Acquire the first audio emitted from the target scene location in the game scene; wherein the first audio is multi-channel audio; convert the first audio into a second audio; wherein the second audio is mono audio; play the second audio and control the second audio to change according to a preset sound attenuation coefficient and channel mixing coefficient; wherein the proportion of multi-channel audio and the proportion of mono audio in the second audio are different at different times.
[0080] The steps of playing the second audio and controlling the second audio to change according to the channel mixing coefficient include: playing the second audio and controlling the second audio to change according to the preset channel mixing coefficient within the target duration.
[0081] At the first moment of the target duration, the proportion of multi-channel audio in the second audio is equal to the proportion of mono audio; at the second moment of the target duration, the proportion of multi-channel audio in the second audio is greater than the proportion of mono audio; the first moment is earlier than the second moment.
[0082] Before the steps of playing the second audio and controlling the second audio to change according to the preset channel mixing coefficient within the target duration, the above method further includes: determining the current scene position of the controlled virtual character in the game scene and calculating the scene distance between the current scene position and the target scene position; and determining the target duration based on the scene distance.
[0083] The steps for determining the target duration based on scene distance include: if the scene distance is less than or equal to the specified distance, determining the target duration based on the scene distance.
[0084] The steps for determining the target duration based on scene distance include: if the scene distance is greater than the specified distance, the target duration is determined to be the maximum duration.
[0085] The distance in the above scenarios is positively correlated with the target duration.
[0086] The mono audio mentioned above is used to enhance the spatial positioning effect of sound; multi-channel audio is used to enhance the spatial effect of sound.
[0087] In this method, after a sound is emitted at the target location in the game scene, it is first played in mono to provide clear spatial positioning information. Then, it gradually becomes multi-channel over time to give the sound its original spatial diffusion effect. By using a simple channel mixing coefficient, it can take into account both the spatial positioning and sound field width of the sound, and consumes less game system resources, thereby improving the stability of the game and the player's gaming experience.
[0088] This embodiment also provides a machine-readable storage medium storing machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions cause the processor to implement the audio processing method in the above-mentioned game.
[0089] The machine-executable instructions stored in the aforementioned machine-readable storage medium can be executed to perform the following operations in the audio processing method of the aforementioned game:
[0090] Acquire the first audio emitted from the target scene location in the game scene; wherein the first audio is multi-channel audio; convert the first audio into a second audio; wherein the second audio is mono audio; play the second audio and control the second audio to change according to a preset sound attenuation coefficient and channel mixing coefficient; wherein the proportion of multi-channel audio and the proportion of mono audio in the second audio are different at different times.
[0091] The steps of playing the second audio and controlling the second audio to change according to the channel mixing coefficient include: playing the second audio and controlling the second audio to change according to the preset channel mixing coefficient within the target duration.
[0092] At the first moment of the target duration, the proportion of multi-channel audio in the second audio is equal to the proportion of mono audio; at the second moment of the target duration, the proportion of multi-channel audio in the second audio is greater than the proportion of mono audio; the first moment is earlier than the second moment.
[0093] Before the steps of playing the second audio and controlling the second audio to change according to the preset channel mixing coefficient within the target duration, the above method further includes: determining the current scene position of the controlled virtual character in the game scene and calculating the scene distance between the current scene position and the target scene position; and determining the target duration based on the scene distance.
[0094] The steps for determining the target duration based on scene distance include: if the scene distance is less than or equal to the specified distance, determining the target duration based on the scene distance.
[0095] The steps for determining the target duration based on scene distance include: if the scene distance is greater than the specified distance, the target duration is determined to be the maximum duration.
[0096] The distance in the above scenarios is positively correlated with the target duration.
[0097] The mono audio mentioned above is used to enhance the spatial positioning effect of sound; multi-channel audio is used to enhance the spatial effect of sound.
[0098] In this method, after a sound is emitted at the target location in the game scene, it is first played in mono to provide clear spatial positioning information. Then, it gradually becomes multi-channel over time to give the sound its original spatial diffusion effect. By using a simple channel mixing coefficient, it can take into account both the spatial positioning and sound field width of the sound, and consumes less game system resources, thereby improving the stability of the game and the player's gaming experience.
[0099] The computer program product of the audio processing method, apparatus and system in the game provided in the embodiments of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementation, please refer to the method embodiments, which will not be repeated here.
[0100] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system and apparatus described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0101] Furthermore, in the description of the embodiments of the present invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in the present invention based on the specific circumstances.
[0102] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0103] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0104] Finally, it should be noted that the above embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. An audio processing method in a game, characterized in that, The method includes: Obtain the first audio emitted from the target scene location in the game scene; wherein, the first audio is multi-channel audio; The first audio is converted into a second audio; wherein the second audio is a mono audio. Play the second audio and control the second audio to change according to a preset sound attenuation coefficient and channel mixing coefficient; wherein, at different times, the proportion of multi-channel audio and the proportion of mono audio in the second audio are different; The step of playing the second audio and controlling the second audio to change according to the channel mixing coefficient includes: playing the second audio and controlling the second audio to change according to the preset channel mixing coefficient within a target duration; wherein, at a first moment of the target duration, the proportion of multi-channel audio in the second audio is equal to the proportion of mono audio; at a second moment of the target duration, the proportion of multi-channel audio in the second audio is greater than the proportion of mono audio; the first moment is earlier than the second moment; Before the steps of playing the second audio and controlling the second audio to change according to a preset channel mixing coefficient within a target duration, the method further includes: determining the current scene position of the controlled virtual character in the game scene, and calculating the scene distance between the current scene position and the target scene position; and determining the target duration based on the scene distance.
2. The audio processing method in a game according to claim 1, characterized in that, The step of determining the target duration based on the scene distance includes: If the scene distance is less than or equal to the specified distance, the target duration is determined based on the scene distance.
3. The audio processing method in a game according to claim 1, characterized in that, The step of determining the target duration based on the scene distance includes: If the scene distance is greater than the specified distance, the target duration is determined to be the maximum duration.
4. The audio processing method in a game according to claim 1 or 2, characterized in that, The scene distance is positively correlated with the target duration.
5. The audio processing method in a game according to claim 1, characterized in that, The mono audio is used to enhance the spatial positioning effect of the sound; the multi-channel audio is used to enhance the spatial effect of the sound.
6. An audio processing device for a game, characterized in that, The device includes: The audio acquisition module is used to acquire the first audio emitted from the target scene location in the game scene in response to a sound trigger event; wherein, the first audio is multi-channel audio; An audio conversion module is used to convert the first audio into a second audio; wherein the second audio is a mono audio. An audio playback module is used to play the second audio and control the second audio to change according to a preset sound attenuation coefficient and channel mixing coefficient; wherein, the proportion of multi-channel audio and the proportion of mono audio in the second audio are different at different times; The audio playback module is further configured to: play the second audio, and control the second audio to change according to a preset channel mixing coefficient within a target duration; wherein, at a first moment of the target duration, the proportion of multi-channel audio in the second audio is equal to the proportion of mono audio; at a second moment of the target duration, the proportion of multi-channel audio in the second audio is greater than the proportion of mono audio; the first moment is earlier than the second moment; The device further includes a target duration determination module, used to: determine the current scene position of the controlled virtual character in the game scene, and calculate the scene distance between the current scene position and the target scene position; and determine the target duration based on the scene distance.
7. An electronic device, characterized in that, It includes a processor and a memory, the memory storing computer-executable instructions that can be executed by the processor, the processor executing the computer-executable instructions to implement the audio processing method in a game according to any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the audio processing method in the game as described in any one of claims 1-5.
Citation Information
Patent Citations
Game sound effect processing method and device, storage medium and terminal equipment
CN114949856A
Audio processing method and device, storage medium and server
CN115695392A