Method and apparatus for switching audio mode in game scene

By creating an audio switching container and setting sub-tracks, the problem of the uniformity of audio mode switching in game scenes was solved, enabling arbitrary switching between 2D and 3D audio modes and improving the immersion and effect of game audio.

CN115373626BActive Publication Date: 2026-01-23CHONGQING PERFECT WORLD INTERACTIVE TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210995271.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-18
Publication Date
2026-01-23
Estimated Expiration
2042-08-18

AI Technical Summary

Technical Problem

In existing technologies, it is not possible to switch arbitrarily between 2D and 3D audio modes for the same sound source, especially in music, within a game scene, which affects the gaming experience.

Method used

Create an audio switching container, import audio files from different game scenes into it, and set two different sub-tracks, specifying the target object state for each. The sub-tracks are automatically called in response to changes in the object state, and the audio mode switching is performed according to the pre-set rules.

Benefits of technology

It enables arbitrary switching of audio modes within game scenes, improves audio playback effects, and brings an immersive music experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115373626B_ABST
    Figure CN115373626B_ABST
Patent Text Reader

Abstract

The application discloses a switching method and device for audio mode in a game scene, relates to the technical field of game design, and can realize arbitrary switching of 2D audio mode and 3D audio mode, so that the audio in the game scene reaches an expected effect. The method comprises the following steps: creating an audio switching container, importing audio files expressing different game scenes into the audio switching container, setting two different sub-audio tracks for the audio switching container, respectively putting the same audio segments in the audio files into the two different sub-audio tracks, in response to audio mode switching caused by changing to a target object state, respectively calling target object states specified by the two different sub-audio tracks, determining target audio segments in the audio files associated with the target object states, and controlling the target audio segments to perform switching of the sub-audio track of the first audio mode and / or the sub-audio track of the second audio mode according to a pre-set audio track switching rule.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of game design technology, and in particular to a method and apparatus for switching audio modes in a game scene. Background Technology

[0002] In game scenarios, sound effects are an essential component. To provide players with a better gaming experience, 3D audio modes are widely used in game scene sound effects, such as gunshots and footsteps, thereby achieving the most realistic simulation of sound.

[0003] In games, sound must respond to player actions. To ensure recorded audio clips function effectively in interactive environments, switching between 3D and 2D audio modes is necessary. For example, specific instruments might be played in certain situations. When a player enters a cave, the entrance uses 3D audio mode to play music, while 2D audio mode is used at other times. Typically, 3D audio mode adjusts the audio playback based on the player's distance from the sound source, while 2D audio mode plays the audio according to a pre-defined setting regardless of the player's position.

[0004] In related technologies, the function of enabling or disabling the relative path of the listener in the audio tool can be used to switch between 3D audio mode and 2D audio mode at will. However, this switching of audio mode can only be applied to a single type of music effect. For example, if you want to set the 3D audio mode, you need to disable the 2D audio mode in the audio tool. For the same sound source in a game scene, especially for music, it is not possible to switch between 2D audio mode and 3D audio mode at will, so the audio in the game scene does not achieve the expected effect, which affects the player's gaming experience. Summary of the Invention

[0005] In view of this, this application provides a method and apparatus for switching audio modes in a game scene. The main purpose is to solve the problem that the existing technology cannot achieve arbitrary switching between 2D audio mode and 3D audio mode for the same sound source, especially music, in a game scene, so that the audio in the game scene does not achieve the expected effect.

[0006] According to the first aspect of this application, a method for switching audio modes in a game scene is provided, comprising:

[0007] Create an audio switching container and import audio files representing different game scenes into the audio switching container;

[0008] Two different sub-tracks are set for the audio switching container. The same audio segments in the audio file are placed into the two different sub-tracks respectively. The state of the target object used in the game scene is specified in the two different sub-tracks respectively. The two different sub-tracks include a sub-track of the first audio mode and a sub-track of the second audio mode.

[0009] In response to the audio mode switching caused by the change to the target object state, the target object state specified by the two different sub-tracks is called respectively to determine the target audio segment in the audio file associated with the target object state;

[0010] For the target object state, control the target audio segment to switch between the sub-tracks of the first audio mode and / or the sub-tracks of the second audio mode according to the preset track switching rules.

[0011] Furthermore, the step of creating an audio switching container and importing audio files representing different game scenes into the audio switching container includes:

[0012] Define a state interface that responds to global events in the game scene, and create an audio switching container based on the state interface;

[0013] Set audio segments associated with different object states in the game scene, summarize the audio segments into audio files that express different game scenes, and import the audio files that express different game scenes into the audio switching container.

[0014] Furthermore, the step of setting audio segments associated with different object states in the game scene, summarizing the audio segments into audio files representing different game scenes, and importing the audio files representing different game scenes into the audio switching container includes:

[0015] Get global events that trigger object state changes in the game scene, and set audio segments associated with different object states in the game scene based on the global events;

[0016] The playback sequence of the audio segments is set according to the order of events that trigger object state changes in the game scene;

[0017] The audio segments are compiled into audio files representing different game scenes according to the playback sequence of the audio segments, and the audio files representing different game scenes are imported into the audio switching container.

[0018] Furthermore, the step of responding to the audio mode switch resulting from the change to the target object state by respectively calling the target object state specified by the two different sub-tracks and determining the target audio segment in the audio file associated with the target object state includes:

[0019] Receive calls from the game engine to initiate global events in the game scene, and monitor changes in the state of objects in the game scene based on the global events in the game scene;

[0020] In response to the audio mode switching caused by the change to the target object state, the target object states specified by the two different sub-tracks are invoked respectively;

[0021] By utilizing the mapping relationship between object states in the game scene and audio segments in audio files, the target audio segment in the audio file associated with the state of the target object can be determined.

[0022] Furthermore, before controlling the target audio segment to switch between sub-tracks of the first audio mode and / or the second audio mode according to a pre-set track switching rule for the target object state, the method further includes:

[0023] Obtain the spatial location information of the target object's state in the game scene, and set a three-dimensional spatial positioning effect for the target audio segment based on the spatial location information of the target object's state in the game scene;

[0024] An audio attenuation curve is added to the target object state, the attribute parameters of the audio attenuation curve are adjusted using the three-dimensional spatial positioning effect, and the target audio segment is processed according to the adjusted audio attenuation curve.

[0025] Further, the step of adding an audio attenuation curve to the target object state, adjusting the attribute parameters of the audio attenuation curve using the three-dimensional spatial positioning effect, and processing the target audio segment according to the adjusted audio attenuation curve includes:

[0026] An audio attenuation curve is added to the target object state, and the three-dimensional spatial positioning effect is used to describe the distance change information and volume change information between the sound source and the listener in the target object state.

[0027] The attribute parameters of the audio attenuation curve are adjusted according to the distance change information and volume change information between the sound source and the listener in the state of the target object, and the target audio segment is processed according to the adjusted audio attenuation curve.

[0028] Furthermore, before controlling the target audio segment to switch between sub-tracks of the first audio mode and / or the second audio mode according to a pre-set track switching rule for the target object state, the method further includes:

[0029] Based on the state of the target object, generate track switching rules applicable to the sub-tracks of the first audio mode and / or the second audio mode in the target audio segment.

[0030] Further, the step of generating audio track switching rules for the target object state, applicable to sub-tracks of the first audio mode and / or the second audio mode in the target audio segment, includes:

[0031] Obtain the transition conditions corresponding to the state of the target object, and determine the transition information for switching to the target audio segment based on the transition conditions corresponding to the state of the target object;

[0032] Using the transition information obtained from switching to the target audio segment, track switching rules are generated for sub-tracks of the first audio mode and / or the second audio mode in the target audio segment.

[0033] Furthermore, the audio track switching rules include at least one of the following: audio switching time, audio switching method, and audio switching position. The step of controlling the target audio segment to switch between sub-tracks of the first audio mode and / or the second audio mode according to the pre-set audio track switching rules, based on the target object state, includes:

[0034] For the state of the target object, a time range for audio switching is set, and it is determined that when the game running time reaches the audio mode switching time, the target audio segment is controlled to switch between the sub-tracks of the first audio mode and / or the sub-tracks of the second audio mode according to the set time range.

[0035] For the state of the target object, set the audio switching effect, determine when the game running time reaches the audio mode switching time, and control the target audio segment to switch the sub-track of the first audio mode and / or the sub-track of the second audio mode according to the set effect;

[0036] For the state of the target object, a spatial position for audio switching is set. When the game running time reaches the audio mode switching time, the target audio segment is controlled to switch between the sub-tracks of the first audio mode and / or the sub-tracks of the second audio mode according to the set spatial position.

[0037] Furthermore, the method also includes:

[0038] The system acquires ambient sound effects from the game scene, determines a target audio mode suitable for the current audio segment in the game scene based on the ambient sound effects, and controls the current audio segment to play using the target audio mode.

[0039] According to a second aspect of this application, a device for switching audio modes in a game scene is provided, comprising:

[0040] A creation unit is used to create an audio switching container and import audio files representing different game scenes into the audio switching container;

[0041] The setting unit is used to set two different sub-tracks for the audio switching container, put the same audio segments in the audio file into the two different sub-tracks respectively, and specify the target object state used in the game scene in the two different sub-tracks respectively. The two different sub-tracks include a sub-track of the first audio mode and a sub-track of the second audio mode.

[0042] The determining unit is used to respond to the audio mode switching caused by the change to the target object state, respectively call the target object state specified by the two different sub-tracks, and determine the target audio segment in the audio file associated with the target object state.

[0043] The switching unit is used to control the target audio segment to switch between sub-tracks of the first audio mode and / or the second audio mode according to the preset track switching rules, based on the state of the target object.

[0044] Furthermore, the creation unit includes:

[0045] Create a module to define the state interface for responding to global events in the game scene, and create an audio switching container based on the state interface;

[0046] The import module is used to set audio segments associated with different object states in the game scene, summarize the audio segments into audio files that express different game scenes, and import the audio files that express different game scenes into the audio switching container.

[0047] Furthermore, the import module is specifically used to acquire global events that trigger changes in the state of objects in the game scene, and to set audio segments associated with different object states in the game scene based on the global events;

[0048] The import module is further configured to set the playback sequence of the audio clips according to the order of events that trigger object state changes in the game scene;

[0049] The import module is further configured to aggregate the audio segments into audio files representing different game scenes according to the playback sequence of the audio segments, and import the audio files representing different game scenes into the audio switching container.

[0050] Furthermore, the determining unit includes:

[0051] The monitoring module is used to receive calls from the game engine to initiate global events in the game scene, and to monitor changes in the state of objects in the game scene based on the global events in the game scene;

[0052] The calling module is used to call the target object state specified by the two different sub-tracks respectively in response to the audio mode switch caused by the change to the target object state;

[0053] The determination module is used to determine the target audio segment in the audio file associated with the state of the target object by utilizing the mapping relationship between the state of objects in the game scene and audio segments in the audio file.

[0054] Furthermore, the device also includes:

[0055] The first acquisition unit is configured to acquire spatial location information of the target object state in the game scene before controlling the target audio segment to switch the sub-track of the first audio mode and / or the sub-track of the second audio mode according to the preset track switching rules for the target object state, and set a three-dimensional spatial positioning effect for the target audio segment based on the spatial location information of the target object state in the game scene.

[0056] An adjustment unit is used to add an audio attenuation curve to the target object state, adjust the attribute parameters of the audio attenuation curve using the three-dimensional spatial positioning effect, and process the target audio segment according to the adjusted audio attenuation curve.

[0057] Furthermore, the adjustment unit is specifically used to add an audio attenuation curve for the target object state, use the three-dimensional spatial positioning effect to describe the distance change information and volume change information between the sound source and the listener in the target object state; adjust the attribute parameters of the audio attenuation curve according to the distance change information and volume change information between the sound source and the listener in the target object state, and process the target audio segment according to the adjusted audio attenuation curve.

[0058] Furthermore, the device also includes:

[0059] The generation unit is configured to generate, for the target object state, a track switching rule applicable to the sub-tracks of the first audio mode and / or the sub-tracks of the second audio mode in the target audio segment before controlling the target audio segment to switch the sub-tracks of the first audio mode and / or the sub-tracks of the second audio mode according to a pre-set track switching rule.

[0060] Furthermore, the generation unit is specifically used to obtain the transition conditions corresponding to the state of the target object, determine the transition information for switching to the target audio segment based on the transition conditions corresponding to the state of the target object, and generate track switching rules applicable to the sub-tracks of the first audio mode and / or the second audio mode in the target audio segment using the transition information for switching to the target audio segment.

[0061] Furthermore, the audio track switching rules include at least one of the following: audio switching time, audio switching method, and audio switching position. Specifically, the switching unit is used to: set a time range for audio switching based on the target object's state; determine when the game running time reaches the audio mode switching time; and control the target audio segment to switch between the sub-tracks of the first audio mode and / or the second audio mode according to the set time range; set an effect for audio switching based on the target object's state; determine when the game running time reaches the audio mode switching time; and control the target audio segment to switch between the sub-tracks of the first audio mode and / or the second audio mode according to the set effect; and set a spatial position for audio switching based on the target object's state; determine when the game running time reaches the audio mode switching time; and control the target audio segment to switch between the sub-tracks of the first audio mode and / or the second audio mode according to the set spatial position.

[0062] Furthermore, the device also includes:

[0063] The second acquisition unit is used to acquire ambient sound effects in the game scene, determine a target audio mode suitable for the current audio segment in the game scene based on the ambient sound effects, and control the current audio segment to play using the target audio mode.

[0064] According to a third aspect of this application, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described in the first aspect above.

[0065] According to a fourth aspect of this application, a readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in the first aspect above.

[0066] By utilizing the above technical solution, this application provides a method and apparatus for switching audio modes in a game scene. Compared with existing methods that achieve arbitrary switching between 3D and 2D audio modes by enabling or disabling the listener relative path function on audio tools, this application creates an audio switching container, imports audio files representing different game scenes into the audio switching container, sets two different sub-tracks for the audio switching container, places identical audio segments from the audio files into the two different sub-tracks, and specifies the target object state used in the game scene within each of the two different sub-tracks. In response to the audio mode switching caused by changing to the target object state, the target object state specified by the two different sub-tracks is invoked respectively, the target audio segment associated with the target object state is determined, and for the target object state, the target audio segment is controlled to switch between the sub-tracks of the first audio mode and / or the sub-tracks of the second audio mode according to the preset audio switching rules. Thus, for the same sound source in the game scene, especially in music, arbitrary switching between the first and second audio modes can be achieved, allowing the audio in the game scene to better match the camera, bringing an immersive music experience and improving the audio playback effect in the game scene.

[0067] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0068] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0069] Figure 1 This illustration shows a flowchart of a method for switching audio modes in a game scene according to an embodiment of this application;

[0070] Figure 2 This document illustrates a flowchart of another method for switching audio modes in a game scene, as provided in an embodiment of this application.

[0071] Figure 3 This illustration shows a structural schematic diagram of an audio mode switching device in a game scene according to an embodiment of this application;

[0072] Figure 4 A schematic diagram of the device structure of a computer device provided in an embodiment of the present invention is shown. Detailed Implementation

[0073] The invention will now be discussed with reference to several exemplary embodiments. It should be understood that these embodiments are described merely to enable those skilled in the art to better understand and thus implement the invention, and are not intended to imply any limitation on the scope of the invention.

[0074] As used herein, the term "comprising" and its variations are to be interpreted as open-ended terms meaning "including but not limited to". The term "based on" is to be interpreted as "at least partially based on". The terms "one embodiment" and "an embodiment" are to be interpreted as "at least one embodiment". The term "another embodiment" is to be interpreted as "at least one other embodiment".

[0075] In the process of switching audio modes in game scenes, the relevant technology allows for arbitrary switching between 3D and 2D audio modes by enabling or disabling the listener relative path function in the audio tool. However, this audio mode switching can only be applied to a single type of music effect. For example, if you want to set the 3D audio mode, you need to disable the 2D audio mode in the audio tool. For the same sound source in a game scene, especially for music, it is not possible to arbitrarily switch between 2D and 3D audio modes, which makes the audio in the game scene not achieve the expected effect and affects the player's gaming experience.

[0076] To address this issue, this embodiment provides a method for switching audio modes in a game scene, such as... Figure 1 As shown, the method includes the following steps:

[0077] 101. Create an audio switching container and import audio files representing different game scenes into the audio switching container.

[0078] The primary role of audio in video games is to create atmosphere and enhance the player's emotional experience. For example, dissonant long notes in string instruments are often used to foreshadow upcoming events, while the roar of an orchestra often abruptly overshadows the event when it suddenly occurs. Players are active participants in games, directly influencing the game's content and visuals, and even if a player plays the same game repeatedly, each playthrough will be different.

[0079] Typically, changes to object states in a game scene can be triggered using global events. For example, a character walking can be triggered by a walking event, and a character launching a skill can be triggered by a launching event. Considering the different parameters used for object states, changes to object states may involve audio switching. For instance, in a ground-walking scene, different ground types and materials result in different audio when the character walks. The audio for the corresponding walking event needs to be switched based on the ground type. For example, for a gravel ground type, the character's footsteps will produce corresponding gravel-like audio. Here, an audio switching container can be created to integrate the audio information needed in different game scenes. Specifically, depending on the game scene to which the object state is applied, the audio switching container can import audio files for different game scenes. For example, if the object state is applied to Preset1, Preset2, and Preset3 game scenes, the audio switching container can be used to set the associated audio files for each game scene: a Rock audio file can be played when Preset1 is selected, a Jazz audio file when Preset2 is selected, and a Classical audio file when Preset3 is selected.

[0080] Furthermore, to make it easier for the game engine to associate global events in the game scene with audio files, it can also set an identifier for the audio files in the audio switching container to associate with the scene change information based on the scene change information corresponding to the global event. Specifically, the identifier of the audio file can be set according to the type of ground material changed in the scene. For example, if the ground material is marble, a marble file identifier can be set, and if the ground material is gravel, a gravel file identifier can be set. It can also be set according to the type of skill changed in the scene. For example, if the skill type is a control skill, a control skill file identifier can be set, and if the skill type is a combo type, a combo type file identifier can be set.

[0081] The execution entity in this embodiment can be an audio mode switching device or equipment in the game scene, which can be configured on the server side of the audio engine. The planner can configure the corresponding audio information according to the global events in the game scene. By creating an audio switching container and importing audio files that express different game scenes into the audio switching container, the audio switching container can switch to play the audio of the corresponding game scene when a global event is triggered.

[0082] 102. Set two different sub-tracks for the audio switching container, put the same audio segments from the audio file into the two different sub-tracks respectively, and specify the state of the target object used in the game scene in the two different sub-tracks respectively.

[0083] Normally, an audio clip can be output and played as a single audio track. However, each audio clip may have different audio modes. In order for audio clips to play different audio modes, two different sub-tracks can be set for the audio switching container. When a sub-track of an audio clip is played, one audio mode will be output and played. The other audio modes will not be discarded, but will be switched according to the change of the object's state.

[0084] It should be noted that the two different sub-tracks here are mainly used for switching between different audio modes, including a sub-track for the first audio mode and a sub-track for the second audio mode. The first audio mode and the second audio mode can be 3D audio mode and 2D audio mode, respectively. Compared with 2D audio mode, 3D audio mode has the characteristics of a larger sound field, more accurate sound positioning, and more realistic sound, allowing players to clearly feel the extension in the audio clips and have a better music effect. Specifically, the two audio sub-tracks can be set in the audio track properties to specify the target object state used in the game scene and the audio clips associated with the target object state. The audio modes in the two audio sub-tracks can be switched using the toggle button / switch during the playback of the audio clips.

[0085] 103. In response to the audio mode switching caused by the change to the target object state, the target object state specified by the two different sub-tracks is called respectively to determine the target audio segment in the audio file associated with the target object state.

[0086] The audio mode switching can be automatically triggered by changes in the state of the target object. For example, the sound effect of the player character entering the secret room in the game scene will change when the sound of the ground being stepped on changes. Alternatively, it can be set to be triggered at a time based on changes in the state of the target object, such as triggering an explosion sound effect 10 seconds after the player enters the explosion scene.

[0087] Typically, the audio engine identifies changes in the state of objects in the game scene in real time based on global events. For example, it identifies whether the player is awake or whether the player is on or underwater. When the state of the target object changes, corresponding audio changes will occur. Since the two different audio subtracks specify the object state and the associated audio segments during the setup process, the target audio segment in the associated audio file of the target object state can be determined based on the association set on the audio subtrack, and the target audio segment can be assigned to the corresponding changed target object state.

[0088] 104. For the state of the target object, control the target audio segment to switch the sub-tracks of the first audio mode and / or the sub-tracks of the second audio mode according to the preset track switching rules.

[0089] In this embodiment, considering the transition between audio segments, the audio track switching rules can use default rules or custom rules. Specific rules can include at least one of audio switching time, audio switching method, and audio switching position. For example, for game scenarios with time requirements, an audio switching time rule can be used. The switching of audio tracks can be controlled by setting a time range for audio switching. Specifically, when the game running time reaches the audio switching time, the target audio segment is controlled to switch between sub-tracks of the first audio mode and / or the second audio mode according to the set time range. Here, the audio mode can be controlled to switch before, within, or after the set time range. This can be set according to the actual game scenario. For example, when the game runs for 30 minutes, coins are distributed to the player. The target audio segment can be the sound of coins falling, with a sound effect duration set to 10 seconds. At this time, the audio mode is controlled to switch from the 2D audio mode sound effect to the 3D audio mode coin falling sound, and the sound effect lasts for 10 seconds after the coin falling is triggered. For game scenarios with effect requirements, audio switching effects can be used. The rules for audio track switching are based on setting audio switching effects. Specifically, when the game runs for a certain period, the system determines whether the audio track should switch to a sub-track of the first audio mode or the second audio mode based on the set effects. Taking the coin-dropping sound as an example, the system can use immediate switching or gradual sound switching effects to control the audio mode to switch immediately from the 2D audio mode sound effect or gradually switch to the 3D audio mode coin-dropping sound. For game scenes with spatial requirements, the rules for audio switching position can be used. The system determines whether the game runs for a certain period, determines whether the audio track should switch to a certain position based on the set spatial position. Here, the spatial position can be the player's position in the game scene. For example, if the player is in water, the system can combine the water sound effects to control the audio mode to switch from the 2D audio mode sound effect to the 3D audio mode coin-dropping sound. The rules for audio track switching are not limited here.

[0090] In practical applications, game scenarios involve various environmental sound effects, including natural, cultural, and magical sound effects. Natural sound effects typically refer to various sounds of nature, including weather sounds such as wind, rain, thunder, and lightning, as well as sounds emanating from specific areas, such as the flow of lava in a volcano, the babbling of a stream, waves crashing on the shore, and the calls of various animals in nature. Cultural sound effects refer to environmental sounds produced by human civilization, such as the sound of reading in a school, the sound of keyboard typing in an office, and discussions. Magical environments refer to virtual world scenes that do not objectively exist but are composed of abstract human-shaped subjects and objects, such as the sky, the underworld, and an underwater palace. Specifically, during the switching of audio modes in a game scene, the system can also acquire environmental sound effects from the game scene, determine the target audio mode suitable for the current audio segment in the game scene based on the environmental sound effects, and control the current audio segment to play using the target audio mode. For example, when the player encounters a natural environment, a 3D audio mode is used to represent different seasons and regions; when the player encounters a human environment, a 2D audio module is used to represent the sounds made by the human activity; when the player encounters a magical environment, a combination of 2D and 3D audio modes is used to represent the characteristics of the scene. 3D audio mode can be used for scenes that create atmosphere, while 2D audio mode can be used for music scenes.

[0091] The audio mode switching method in the game scene provided in this application embodiment, compared with the existing method of arbitrarily switching between 3D and 2D audio modes by enabling or disabling the listener relative path function on the audio tool, creates an audio switching container, imports audio files representing different game scenes into the audio switching container, sets two different sub-tracks for the audio switching container, places the same audio segments from the audio files into the two different sub-tracks respectively, and specifies the target object state used in the game scene in the two different sub-tracks respectively. In response to the audio mode switching caused by changing to the target object state, the target object state specified by the two different sub-tracks is called respectively, the target audio segment in the audio file associated with the target object state is determined, and for the target object state, the target audio segment is controlled to switch the sub-track of the first audio mode and / or the sub-track of the second audio mode according to the preset audio switching rules. Thus, for the same sound source in the game scene, especially music, it is possible to achieve arbitrary switching between the first audio mode and the second audio mode, so that the audio in the game scene can better match the camera, bring an immersive music experience, and improve the audio playback effect in the game scene.

[0092] As a refinement and extension of the specific implementation of the above embodiments, and to fully illustrate the specific implementation process of this embodiment, this embodiment provides another method for switching audio modes in a game scene, such as... Figure 2 As shown, the method includes:

[0093] 201. Define a state interface for responding to global events in the game scene, and create an audio switching container based on the state interface.

[0094] Since game scenes do not have a fixed timeline and event sequence, it is impossible to know how long a player character stays in a certain game scene or when an event is triggered. Therefore, game audio also needs to be connected to the game scene and provide timely feedback.

[0095] Understandably, considering that the state of objects in the game scene will change with global events, for example, the player may step on different materials or trigger different types of skills, we define a state interface that responds to global events in the game scene, create an audio switcher based on the state interface, and then use the audio switcher to associate different object states with audio clips, so that each object state has a unique sound effect.

[0096] 202. Set audio segments associated with different object states in the game scene, summarize the audio segments into audio files that express different game scenes, and import the audio files that express different game scenes into the audio switching container.

[0097] In this embodiment, the audio segment associated with the object state can be determined based on the change information of the object state. If the change information of the object state involves the change of footsteps when the player enters the game scene, the audio segment associated with the object state is the sound effect of stepping on the corresponding ground material. If the change information of the object state involves the player's heart rate accelerating when entering the game scene, the audio segment associated with the object state is the sound effect of the character's heartbeat.

[0098] Specifically, we can obtain global events that trigger object state changes in the game scene, set audio clips associated with different object states in the game scene based on the global events, set the playback sequence of the audio clips according to the order of events that trigger object state changes in the game scene, summarize the audio clips into audio files representing different game scenes according to the playback sequence, and import the audio files representing different game scenes into the audio switching container. Here, object state changes can be from a static state to a walking state, from a walking state on material A to a walking state on material B, from a static state to a skill firing state, etc. Since changes in global events will cause object state changes, in the process of associating different object states with audio clips, considering that object states have matching sound effects in real life, we can extract the sound effects in real life as the audio clips associated with the object states. For example, the walking event of a game character will trigger the object state to change to a walking state, and the walking event needs to be associated with the audio clip of footsteps; the firing event of a game character will trigger the object state to change to a firing state, and the firing event needs to be associated with the audio clip of skills.

[0099] 203. Set two different sub-tracks for the audio switching container, put the same audio segments from the audio file into the two different sub-tracks respectively, and specify the state of the target object used in the game scene in the two different sub-tracks respectively.

[0100] In this embodiment, to better immerse players in the game world, the audio mode corresponding to the current audio segment is determined based on the environmental sound effects required to transition to the new object state in the game scene within two different sub-tracks. If the transition requires artificially created and enhanced sound effects, or sound effects for UI clicks or action feedback, a 3D audio mode can be used to play the audio segment. If the transition involves dialogue from a story animation or quick voice lines, a 2D audio mode can be used. If the transition involves music from a story scene, the choice between 3D and / or 2D audio modes can be determined based on the type of music. Here, while using 2D audio mode, the 3D audio mode can be randomly switched to play the audio segment along with the audio rhythm, thereby avoiding a monotonous audio mode in the game scene and improving the audio playback effect.

[0101] Furthermore, considering the diversity of audio segments, audio sub-tracks can be set for different audio dynamics switching. For example, if an audio segment contains three guitar parts with different dynamics and a blank part, four audio sub-tracks can be set for different audio dynamics switching.

[0102] 204. Receive calls from the game engine to initiate global events in the game scene, and monitor changes in the state of objects in the game scene based on the global events in the game scene.

[0103] During the game design process, the game engine and the audio engine transmit global events in the game scene through game calls. For each game call, the game engine generates a corresponding global event in the game scene and sends the global event to the audio engine so that the audio engine can output different audio effects adapted to the game scene, such as audio effects adapted to the environment in the game scene, or music effects adapted to magic in the game scene.

[0104] It is understandable that global events may occur as the state of objects in the game scene changes. Each global event has an object type and an event type when it is created. For example, when creating a global event to receive an item, the object type of this global event is the item type and the event type is the receiving type. Here, we can monitor changes in the state of objects in the game scene based on the object type and event type of the global event.

[0105] 205. In response to the audio mode switching caused by the change to the target object state, the target object states specified by the two different sub-tracks are invoked respectively.

[0106] 206. Utilize the mapping relationship between object states in the game scene and audio segments in the audio file to determine the target audio segment in the audio file associated with the target object state.

[0107] In this embodiment, the mapping relationship between object states and audio segments in audio files can be one-to-one or many-to-one. That is, each object state corresponds to at least one audio segment, and multiple object states may correspond to the same audio segment. Alternatively, object states can be set to have no sound effects. This mapping relationship can be configured customwise or generated automatically by an audio engine. The audio engine can identify uploaded audio files and, based on the identified audio type, rhythm, and other information, perform audio matching with the object states in the game scene. This establishes an association between audio files suitable for the object states in the game scene, resulting in a mapping relationship between objects in the game scene and audio segments in the audio files. Considering that audio segments in the audio files may have the same or similar musical styles, this mapping relationship can be adjusted later based on the actual adaptation effect.

[0108] 207. For the state of the target object, control the target audio segment to switch the sub-tracks of the first audio mode and / or the sub-tracks of the second audio mode according to the preset track switching rules.

[0109] Here, the target object state is used to determine the audio clip to be played and the audio mode selected for that audio clip. For example, when the current target object state is triggered in the game scene, music clip A is played using the sub-track of the first audio mode. When the next target object state is triggered in the game scene, music clip B is played using the sub-track of the second audio mode. This process can achieve synchronized playback of the object state and the audio clip. At the same time, as the object state changes, the audio clip may also switch playback synchronously, thereby ensuring that the sound effects created by the game scene can meet the player's expectations.

[0110] Furthermore, to improve the playback effect of the audio clip, before this step, the spatial position information of the target object's state in the game scene can be obtained. Based on this spatial position information, a three-dimensional spatial positioning effect is set for the target audio clip, and an audio attenuation curve is added for the target object's state. The attribute parameters of the audio attenuation curve are then adjusted using the three-dimensional spatial positioning effect. Here, the audio attenuation curve is typically used to simulate the natural attenuation of a signal as it moves away from the listener. A series of curves can be used to map attributes such as volume to specific distance values. Using these curves, more detailed distance-based attenuation behavior can be created for sounds and audio objects. Specifically, in the process of adjusting the attribute parameters of the audio attenuation curve using the three-dimensional spatial positioning effect, an audio attenuation curve can be added for the target object's state. The three-dimensional spatial positioning effect describes the distance and volume changes between the sound source and the listener in the target object's state, and the attribute parameters of the audio attenuation curve are adjusted according to these distance and volume changes. In a game scene, the distance between the game object emitting the sound and the listener will determine the volume. When a sound is emitted, the distance can be determined by comparing the three-dimensional coordinates of the sound source and the listener relative to each other. When the sound source moves away, the most obvious change in the sound is that the volume will decrease. The default audio attenuation curve will affect the volume.

[0111] It is understandable that the distance unit of the characters in the game scene, as an attribute parameter of the audio attenuation curve, will also affect the volume change information. For example, if the protagonist in the game scene is an ant, the distance unit may be millimeters, and the magnitude of the volume change information is also small. However, for a game about interstellar travel, the distance may be light-years, and the magnitude of the volume change information is correspondingly larger.

[0112] Furthermore, regarding the pre-setting process of audio switching rules, prior to this step, audio track switching rules applicable to the sub-tracks of the first audio mode and / or the second audio mode in the target audio segment can be generated based on the target object state. Specifically, the transition conditions corresponding to the target object state can be obtained, and the transition information for switching to the target audio segment can be determined based on the transition conditions. The audio track switching rules applicable to the sub-tracks of the first audio mode and / or the second audio mode in the target audio segment can be generated using the transition information for switching to the target audio segment. Here, the transition conditions mainly include transition time and transition volume. For the transition time, the audio segment can be set to switch suddenly or gradually. For the transition volume, the volume of the audio segment can be set to gradually increase to a set volume or directly reach a set volume.

[0113] Furthermore, as Figure 1 and Figure 2In a specific implementation of the method, this application provides a device for switching audio modes in a game scene, such as... Figure 3 As shown, the device includes: a creation unit 31, a setting unit 32, a determination unit 33, and a switching unit 34.

[0114] The creation unit 31 can be used to create an audio switching container and import audio files representing different game scenes into the audio switching container;

[0115] The setting unit 32 can be used to set two different sub-tracks for the audio switching container, put the same audio segments in the audio file into the two different sub-tracks respectively, and specify the target object state used in the game scene in the two different sub-tracks respectively. The two different sub-tracks include a sub-track of the first audio mode and a sub-track of the second audio mode.

[0116] The determining unit 33 can be used to respond to the audio mode switching caused by the change to the target object state, respectively call the target object state specified by the two different sub-tracks, and determine the target audio segment in the audio file associated with the target object state.

[0117] The switching unit 34 can be used to control the target audio segment to switch between the sub-tracks of the first audio mode and / or the sub-tracks of the second audio mode according to the preset track switching rules, based on the state of the target object.

[0118] The audio mode switching device for game scenes provided in this invention, compared with the existing method of achieving arbitrary switching between 3D and 2D audio modes by enabling or disabling the listener relative path function on the audio tool, creates an audio switching container, imports audio files representing different game scenes into the audio switching container, sets two different sub-tracks for the audio switching container, places the same audio segments from the audio files into the two different sub-tracks respectively, and specifies the target object state used in the game scene in the two different sub-tracks respectively. In response to the audio mode switching caused by changing to the target object state, the target object state specified by the two different sub-tracks is called respectively, the target audio segment in the audio file associated with the target object state is determined, and for the target object state, the target audio segment is controlled to switch the sub-track of the first audio mode and / or the sub-track of the second audio mode according to the preset audio switching rules. Thus, for the same sound source in the game scene, especially music, arbitrary switching between the first audio mode and the second audio mode can be achieved, so that the audio in the game scene can better match the camera, bring an immersive music experience, and improve the audio playback effect in the game scene.

[0119] In specific application scenarios, the creation unit 31 includes:

[0120] The creation module can be used to define the state interface that responds to global events in the game scene, and create an audio switching container based on the state interface;

[0121] The import module can be used to set audio segments associated with different object states in the game scene, summarize the audio segments into audio files that express different game scenes, and import the audio files that express different game scenes into the audio switching container.

[0122] In specific application scenarios, the import module can be used to obtain global events that trigger changes in the state of objects in the game scene, and set audio segments associated with different object states in the game scene according to the global events.

[0123] The import module can also be used to set the playback sequence of the audio clips according to the order of events that trigger object state changes in the game scene;

[0124] The import module can also be used to summarize the audio segments into audio files that express different game scenes according to the playback sequence of the audio segments, and import the audio files that express different game scenes into the audio switching container.

[0125] In specific application scenarios, the determining unit 33 includes:

[0126] The monitoring module can be used to receive calls from the game engine to initiate global events in the game scene, and monitor changes in the state of objects in the game scene based on the global events in the game scene;

[0127] The calling module can be used to call the target object state specified by the two different sub-tracks respectively in response to the audio mode switch caused by the change to the target object state;

[0128] The determination module can be used to determine the target audio segment in the audio file associated with the state of a target object by utilizing the mapping relationship between the state of an object in the game scene and the audio segments in the audio file.

[0129] In specific application scenarios, the device further includes:

[0130] The first acquisition unit can be used to acquire the spatial location information of the target object state in the game scene before controlling the target audio segment to switch the sub-track of the first audio mode and / or the sub-track of the second audio mode according to the preset track switching rules for the target object state, and set a three-dimensional spatial positioning effect for the target audio segment according to the spatial location information of the target object state in the game scene.

[0131] The adjustment unit can be used to add an audio attenuation curve to the target object state, adjust the attribute parameters of the audio attenuation curve using the three-dimensional spatial positioning effect, and process the target audio segment according to the adjusted audio attenuation curve.

[0132] In specific application scenarios, the adjustment unit can be used to add an audio attenuation curve to the target object state, use the three-dimensional spatial positioning effect to describe the distance change information and volume change information between the sound source and the listener in the target object state; adjust the attribute parameters of the audio attenuation curve according to the distance change information and volume change information between the sound source and the listener in the target object state, and process the target audio segment according to the adjusted audio attenuation curve.

[0133] In specific application scenarios, the device further includes:

[0134] The generation unit can be used to generate, for the target object state, a track switching rule applicable to the sub-tracks of the first audio mode and / or the sub-tracks of the second audio mode in the target audio segment before controlling the target audio segment to switch the sub-tracks of the first audio mode and / or the sub-tracks of the second audio mode according to a preset track switching rule.

[0135] In specific application scenarios, the generation unit can be used to obtain the transition conditions corresponding to the state of the target object, determine the transition information for switching to the target audio segment based on the transition conditions corresponding to the state of the target object, and generate audio track switching rules applicable to the sub-tracks of the first audio mode and / or the second audio mode in the target audio segment using the transition information for switching to the target audio segment.

[0136] In specific application scenarios, the audio track switching rules include at least one of the following: audio switching time, audio switching method, and audio switching position. The switching unit is specifically used to: 1. Set a time range for audio switching based on the target object's state; 2. Determine when the game running time reaches the audio mode switching time; 3. Control the target audio segment to switch between sub-tracks of the first audio mode and / or the second audio mode according to the set time range; 4. Set an effect for audio switching based on the target object's state; 5. Determine when the game running time reaches the audio mode switching time; 6. Control the target audio segment to switch between sub-tracks of the first audio mode and / or the second audio mode according to the set effect; 7. Set a spatial position for audio switching based on the target object's state; 8. Determine when the game running time reaches the audio mode switching time; 9. Control the target audio segment to switch between sub-tracks of the first audio mode and / or the second audio mode according to the set spatial position.

[0137] In specific application scenarios, the device further includes:

[0138] The second acquisition unit is used to acquire ambient sound effects in the game scene, determine a target audio mode suitable for the current audio segment in the game scene based on the ambient sound effects, and control the current audio segment to play using the target audio mode.

[0139] It should be noted that other corresponding descriptions of the functional units involved in the audio mode switching device in a game scene provided in this embodiment can be found in [reference needed]. Figures 1-2 The corresponding descriptions in [the document] will not be repeated here.

[0140] Based on the above, Figures 1-2 Accordingly, this application embodiment also provides a storage medium storing a computer program thereon, which, when executed by a processor, implements the above-described method. Figures 1-2 The method for switching audio modes in the game scene shown.

[0141] Based on this understanding, the technical solution of this application can be embodied in the form of a software product. This software product can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, or portable hard drive), and includes several instructions to cause a computer device (such as a personal computer, server, or network device) to execute the methods described in the various implementation scenarios of this application.

[0142] Based on the above, Figures 1-2 The method shown, and Figure 3To achieve the above objectives, the virtual device embodiment shown in this application also provides a physical device for switching audio modes in a game scene. Specifically, this physical device can be a computer, smartphone, tablet, smartwatch, server, or network device, etc. The physical device includes a storage medium and a processor; the storage medium stores a computer program; the processor executes the computer program to achieve the above-described functionality. Figures 1-2 The method for switching audio modes in the game scene shown.

[0143] Optionally, the physical device may also include a user interface, a network interface, a camera, radio frequency (RF) circuitry, sensors, audio circuitry, a Wi-Fi module, etc. The user interface may include a display screen, input units such as a keyboard, etc., and optional user interfaces may also include USB interfaces, card reader interfaces, etc. The network interface may optionally include standard wired interfaces, wireless interfaces (such as Wi-Fi interfaces), etc.

[0144] In an exemplary embodiment, see Figure 4 The aforementioned physical device includes a communication bus, a processor, a memory, and a communication interface. It may also include input / output interfaces and a display device. The various functional units can communicate with each other via the bus. The memory stores computer programs, and the processor executes the programs stored in the memory to perform the painting mounting method described in the above embodiments.

[0145] Those skilled in the art will understand that the physical device structure for switching audio modes in a game scene provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or combine certain components, or have different component arrangements.

[0146] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the physical device for processing store search information, supporting the operation of the information processing program and other software and / or programs. The network communication module is used to enable communication between the various components within the storage medium, as well as communication with other hardware and software within the information processing physical device.

[0147] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms, or it can be implemented by hardware. By applying the technical solution of this application, compared with the existing methods, this application controls the target audio segment to switch between the sub-tracks of the first audio mode and / or the sub-tracks of the second audio mode according to the preset audio switching rules, based on the state of the target object. Thus, for the same sound source in the game scene, especially in music, it can realize arbitrary switching between the first audio mode and the second audio mode, so that the audio in the game scene can better match the camera, bringing an immersive music experience and improving the audio playback effect in the game scene.

[0148] Those skilled in the art will understand that the accompanying drawings are merely schematic diagrams of a preferred embodiment, and the modules or processes shown in the drawings are not necessarily essential for implementing this application. Those skilled in the art will understand that the modules in the apparatus of the embodiment can be distributed within the apparatus of the embodiment as described, or can be modified to be located in one or more apparatuses different from this embodiment. The modules of the above-described embodiment can be combined into one module, or further divided into multiple sub-modules.

[0149] The serial numbers in this application are for descriptive purposes only and do not represent the superiority or inferiority of any particular implementation scenario. The above disclosures are merely a few specific implementation scenarios of this application; however, this application is not limited thereto, and any variations conceived by those skilled in the art should fall within the protection scope of this application.

Claims

1. A method for switching audio modes in a game scene, characterized in that, include: Create an audio switching container and import audio files representing different game scenes into the audio switching container; Two different sub-tracks are set for the audio switching container. The same audio segments in the audio file are placed into the two different sub-tracks respectively. The state of the target object used in the game scene is specified in the two different sub-tracks respectively. The two different sub-tracks include a sub-track of a first audio mode and a sub-track of a second audio mode. The two different sub-tracks are used for switching between different audio modes. In response to the audio mode switching caused by the change to the target object state, the target object state specified by the two different sub-tracks is called respectively to determine the target audio segment in the audio file associated with the target object state; For the target object state, control the target audio segment to switch between the sub-tracks of the first audio mode and / or the sub-tracks of the second audio mode according to the preset track switching rules.

2. The method according to claim 1, characterized in that, The step of creating an audio switching container and importing audio files representing different game scenes into the audio switching container includes: Define a state interface that responds to global events in the game scene, and create an audio switching container based on the state interface; Set audio segments associated with different object states in the game scene, summarize the audio segments into audio files that express different game scenes, and import the audio files that express different game scenes into the audio switching container.

3. The method according to claim 2, characterized in that, The process of setting audio segments associated with different object states in the game scene, summarizing these audio segments into audio files representing different game scenes, and importing these audio files representing different game scenes into the audio switching container includes: Get global events that trigger object state changes in the game scene, and set audio segments associated with different object states in the game scene based on the global events; The playback sequence of the audio segments is set according to the order of events that trigger object state changes in the game scene; The audio segments are compiled into audio files representing different game scenes according to the playback sequence of the audio segments, and the audio files representing different game scenes are imported into the audio switching container.

4. The method according to claim 1, characterized in that, The audio mode switch in response to the change to the target object state involves calling the target object state specified by the two different sub-tracks respectively, and determining the target audio segment in the audio file associated with the target object state, including: Receive calls from the game engine to initiate global events in the game scene, and monitor changes in the state of objects in the game scene based on the global events in the game scene; In response to the audio mode switching caused by the change to the target object state, the target object states specified by the two different sub-tracks are invoked respectively; By utilizing the mapping relationship between object states in the game scene and audio segments in audio files, the target audio segment in the audio file associated with the state of the target object can be determined.

5. The method according to any one of claims 1-4, characterized in that, Before controlling the target audio segment to switch between sub-tracks of the first audio mode and / or the second audio mode according to a pre-set track switching rule for the target object state, the method further includes: Obtain the spatial location information of the target object's state in the game scene, and set a three-dimensional spatial positioning effect for the target audio segment based on the spatial location information of the target object's state in the game scene; An audio attenuation curve is added to the target object state, the attribute parameters of the audio attenuation curve are adjusted using the three-dimensional spatial positioning effect, and the target audio segment is processed according to the adjusted audio attenuation curve; The process of adding an audio attenuation curve to the target object's state, adjusting the attribute parameters of the audio attenuation curve using the three-dimensional spatial positioning effect, and processing the target audio segment based on the adjusted audio attenuation curve includes: An audio attenuation curve is added to the target object state, and the three-dimensional spatial positioning effect is used to describe the distance change information and volume change information between the sound source and the listener in the target object state. The attribute parameters of the audio attenuation curve are adjusted according to the distance change information and volume change information between the sound source and the listener in the state of the target object, and the target audio segment is processed according to the adjusted audio attenuation curve.

6. The method according to any one of claims 1-4, characterized in that, Before controlling the target audio segment to switch between sub-tracks of the first audio mode and / or the second audio mode according to a pre-set track switching rule for the target object state, the method further includes: Based on the state of the target object, generate track switching rules applicable to the sub-tracks of the first audio mode and / or the second audio mode in the target audio segment.

7. The method according to claim 6, characterized in that, The step of generating audio track switching rules for the target object state, applicable to sub-tracks of the first audio mode and / or the second audio mode in the target audio segment, includes: Obtain the transition conditions corresponding to the state of the target object, and determine the transition information for switching to the target audio segment based on the transition conditions corresponding to the state of the target object; Using the transition information obtained from switching to the target audio segment, track switching rules are generated for sub-tracks of the first audio mode and / or the second audio mode in the target audio segment.

8. The method according to any one of claims 1-4, characterized in that, The audio track switching rules include at least one of the following: audio switching time, audio switching method, and audio switching position. The step of controlling the target audio segment to switch between sub-tracks of the first audio mode and / or the second audio mode according to the preset audio track switching rules, based on the target object's state, includes: For the state of the target object, a time range for audio switching is set, and it is determined that when the game running time reaches the audio mode switching time, the target audio segment is controlled to switch between the sub-tracks of the first audio mode and / or the sub-tracks of the second audio mode according to the set time range. For the state of the target object, set the audio switching effect, determine when the game running time reaches the audio mode switching time, and control the target audio segment to switch the sub-track of the first audio mode and / or the sub-track of the second audio mode according to the set effect; For the state of the target object, a spatial position for audio switching is set. When the game running time reaches the audio mode switching time, the target audio segment is controlled to switch between the sub-tracks of the first audio mode and / or the sub-tracks of the second audio mode according to the set spatial position.

9. The method according to any one of claims 1-4, characterized in that, The method further includes: The system acquires ambient sound effects from the game scene, determines a target audio mode suitable for the current audio segment in the game scene based on the ambient sound effects, and controls the current audio segment to play using the target audio mode.

10. A device for switching audio modes in a game scene, characterized in that, include: A creation unit is used to create an audio switching container and import audio files representing different game scenes into the audio switching container; The setting unit is used to set two different sub-tracks for the audio switching container, put the same audio segments in the audio file into the two different sub-tracks respectively, and specify the target object state used in the game scene in the two different sub-tracks respectively. The two different sub-tracks include a sub-track of a first audio mode and a sub-track of a second audio mode. The two different sub-tracks are used for switching between different audio modes. The determining unit is used to respond to the audio mode switching caused by the change to the target object state, respectively call the target object state specified by the two different sub-tracks, and determine the target audio segment in the audio file associated with the target object state. The switching unit is used to control the target audio segment to switch between sub-tracks of the first audio mode and / or the second audio mode according to the preset track switching rules, based on the state of the target object.

Citation Information

Patent Citations

  • Game skill sound effect processing method and device and electronic device

    CN113289340A

  • Music control method and device in game, storage medium and electronic equipment

    CN113908548A

  • Game audio processing method and device, storage medium and equipment

    CN114053709A