Method, apparatus, device, and storage medium for sound processing in a virtual scenario
By obtaining the closed attributes and receiving point positions of the virtual space in the virtual scene, determining the space type in real time and performing sound effects processing, the problems of large amount of calculation and high resource occupation caused by geometric acoustics are solved, and the sound processing efficiency in the virtual scene is improved.
Patent Information
- Application Number
- CN202111650772.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2021-11-30
- Filing Date
- 2021-12-30
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2041-12-30
AI Technical Summary
In virtual scenes, when performing sound simulation through geometric acoustics, the calculation amount is large and the resource occupancy is high, which affects the sound processing efficiency.
By obtaining the closed attributes and receiving point positions of each virtual space in the virtual scene, the space types of each virtual space are determined in real time, and the sound effect processing of the sound emitted by the sound source based on this information to avoid tracking of the sound.
The calculation process is simplified, the resource usage is reduced, and the sound processing efficiency in virtual scenes is improved.
Smart Images

Figure CN114307157B_ABST
Abstract
Description
[0001] This application claims the priority of a Chinese patent application with an application number of 202111443621.3 and an invention title of "Sound Processing Method, Device, Equipment and Storage Medium in Virtual Scenes" filed on November 30, 2021, the entire content of which is incorporated herein by reference. Technical Field
[0002] This application relates to the technical field of virtual scene technologies, and particularly relates to a sound processing method, device, equipment and storage medium in virtual scenes. Background Art
[0003] Currently, in some game applications, such as in confrontation games, sound effects in the real environment are usually simulated.
[0004] In the related art, when simulating and generating sound effects in a virtual scene, when simulating the sound emitted by a sound source in real time within the spatial model where the sound source is located, geometric acoustics is usually used for simulation. That is to say, the propagation of the sound emitted by the sound source in the virtual scene is tracked in real time using the method of geometric rays, and then various acoustic effects are simulated.
[0005] However, the acoustic regions in a virtual scene are usually complex and numerous. The method of simulation using geometric acoustics requires real-time tracking of the sound propagation route, resulting in a large amount of calculation, and thus a large amount of resource occupation, which affects the efficiency of sound processing in the virtual scene. Summary of the Invention
[0006] Embodiments of this application provide a sound processing method, device, equipment and storage medium in virtual scenes, which can improve the efficiency of sound processing in virtual scenes. The technical solutions are as follows:
[0007] On the one hand, embodiments of this application provide a sound processing method in virtual scenes. The method includes:
[0008] Obtain the closed attributes of each virtual space in the virtual scene and the position of the receiving point; the closed attribute is used to indicate whether the virtual space is a closed space; the position of the receiving point includes the position of the virtual object controlled by the target terminal in the virtual scene;
[0009] Based on the closed attributes of each virtual space and the position of the receiving point, obtain the spatial type of each virtual space;
[0010] Based on the spatial type of the virtual space where the receiving point is located and the spatial type of the virtual space where the target sound source is located, add sound effects to the sound emitted by the target sound source to obtain the target sound of the target sound source at the position of the receiving point.
[0011] On the other hand, an embodiment of the present application provides a sound processing device in a virtual scenario. The device includes:
[0012] A first acquisition module, configured to acquire the enclosure attribute of each virtual space in the virtual scenario and the receiving point position; the enclosure attribute is used to indicate whether the virtual space is an enclosed space; the receiving point position includes the position of the virtual object controlled by the target terminal in the virtual scenario;
[0013] A space type acquisition module, configured to acquire the space type of each virtual space based on the enclosure attribute of each virtual space and the receiving point position;
[0014] A sound processing module, configured to add a sound effect to the sound emitted by the target sound source based on the space type of the virtual space where the receiving point position is located and the space type of the virtual space where the target sound source is located, to obtain the target sound at the receiving point position.
[0015] In a possible implementation manner, the space type acquisition module is configured to,
[0016] In response to the enclosure attribute of the target virtual space indicating that the target virtual space is an enclosed space and the receiving point position is within the target virtual space, acquire the space type of the target virtual space as the first space type;
[0017] In response to the enclosure attribute of the target virtual space indicating that the target virtual space is an enclosed space and the receiving point position is outside the target virtual space, acquire the space type of the target virtual space as the second space type;
[0018] In response to the enclosure attribute of the target virtual space indicating that the target virtual space is a non-enclosed space, acquire the space type of the target virtual space as the third space type;
[0019] Wherein, the target virtual space is any one of the virtual spaces.
[0020] In a possible implementation manner, the sound processing module is configured to, in response to the space type of the virtual space where the receiving point position is located and the space type of the virtual space where the target sound source is located satisfying a first condition, add a first sound effect to the sound emitted by the target sound source to obtain the target sound;
[0021] Wherein, the first sound effect includes at least one of a blocking effect, a reflection effect, and a reverberation effect;
[0022] The first condition includes: the spatial type of the virtual space where the receiving point is located is the first spatial type, and the spatial type of the virtual space where the target sound source is located is the first spatial type.
[0023] In a possible implementation, the sound processing module is configured to,
[0024] add a blocking sound effect to the direct sound to obtain a blocked sound;
[0025] add a late reverberation sound effect to the early reflection sound to obtain a reverberant sound;
[0026] obtain the target sound based on the early reflection sound, the blocked sound, and the reverberant sound.
[0027] In a possible implementation, the sound processing module is configured to, in response to the spatial type of the virtual space where the receiving point is located and the spatial type of the virtual space where the target sound source is located satisfying the first condition, add a second sound effect to the sound emitted by the target sound source to obtain the target sound;
[0028] wherein the second sound effect includes at least one of a transmission effect, a diffraction effect, and a reverberation effect;
[0029] The second condition includes:
[0030] the spatial type of the virtual space where the receiving point is located is the first spatial type, and the spatial type of the virtual space where the target sound source is located is the second spatial type;
[0031] or, the spatial type of the virtual space where the receiving point is located is the third spatial type, and the spatial type of the virtual space where the target sound source is located is the second spatial type.
[0032] In a possible implementation, the sound processing module is configured to,
[0033] generate a direct sound and a reverberant sound corresponding to the target sound source;
[0034] add a transmission sound effect to the direct sound and the reverberant sound to obtain a transmitted sound;
[0035] add a diffraction sound effect to the reverberant sound to obtain a diffracted sound;
[0036] obtain the target sound based on the transmitted sound and the diffracted sound.
[0037] In a possible implementation, the sound processing module is configured to add a third sound effect to the sound emitted by the target sound source and obtain the target sound in response to the spatial type of the virtual space where the reception point is located and the spatial type of the virtual space where the target sound source is located satisfying a third condition;
[0038] wherein the third sound effect includes a blocking sound effect;
[0039] The third condition includes:
[0040] the spatial type of the virtual space where the reception point is located is the first spatial type, and the spatial type of the virtual space where the target sound source is located is the third spatial type;
[0041] or, the spatial type of the virtual space where the reception point is located is the third spatial type, and the spatial type of the virtual space where the target sound source is located is the third spatial type.
[0042] In a possible implementation, the sound processing module is configured to,
[0043] generate a direct sound corresponding to the target sound source;
[0044] add a blocking sound effect to the direct sound to obtain the target sound.
[0045] In a possible implementation, the device further includes:
[0046] a gain setting module configured to set a volume gain for the target sound source based on the spatial type of the virtual space where the target sound source is located;
[0047] the sound processing module is configured to add a sound effect to the sound emitted by the target sound source and obtain the target sound based on the spatial type of the virtual space where the reception point is located, the spatial type of the virtual space where the target sound source is located, and the volume gain of the target sound source.
[0048] In a possible implementation, the volume gain includes at least one of the following gains:
[0049] gain of the direct sound, gain of the blocking sound, gain of the reverberant sound, and gain of the diffracted sound.
[0050] In a possible implementation, the gain setting module is configured to,
[0051] in response to the spatial type of the virtual space where the target sound source is located being the first spatial type, set the volume gain of the direct sound of the target sound source to 1;
[0052] In response to the spatial type of the virtual space where the target sound source is located being the second spatial type, set the volume gain of the direct sound of the target sound source to a, where 0 < a < 1;
[0053] In response to the spatial type of the virtual space where the target sound source is located being the third spatial type, set the volume gain of the direct sound of the target sound source to b, where 0 < b < 1.
[0054] In a possible implementation manner, the gain setting module is configured to, in response to the spatial type of the virtual space where the target sound source is located being the second spatial type, and there being a connection port between the virtual space where the target sound source is located and the virtual space where the receiving point position is located, set the volume gain of at least one of the reverberant sound and the diffracted sound of the target sound source.
[0055] In a possible implementation manner, the gain setting module is configured to,
[0056] Set the volume gain of at least one of the reverberant sound and the diffracted sound of the target sound source to a fixed value;
[0057] Alternatively, based on the distance between the target sound source and the receiving point position, set the volume gain of at least one of the reverberant sound and the diffracted sound of the target sound source.
[0058] In a possible implementation manner, the gain setting module is configured to, in response to the spatial type of the virtual space where the target sound source is located being the first spatial type or the third spatial type, set the volume gain of the blocked sound of the target sound source.
[0059] In a possible implementation manner, the gain setting module is configured to,
[0060] Obtain a blocking value between the target sound source and the receiving point position, where the blocking value is used to indicate the degree of blockage between the target sound source and the receiving point position;
[0061] Based on the blocking value between the target sound source and the receiving point position, set the volume gain of the blocked sound of the target sound source.
[0062] On the other hand, an embodiment of the present application provides a computer device, where the computer device includes a processor and a memory, and at least one computer instruction is stored in the memory, and the at least one computer instruction is loaded and executed by the processor to implement the sound processing method in the virtual scenario as described in the above aspect.
[0063] On the other hand, an embodiment of the present application provides a computer-readable storage medium, in which at least one computer instruction is stored. The at least one computer instruction is loaded and executed by a processor to implement the sound processing method in the virtual scenario as described in the above aspect.
[0064] In another aspect, a computer program product or a computer program is provided. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the sound processing method in the virtual scenario provided in various optional implementations of the above aspect.
[0065] The beneficial effects of the technical solution provided by the embodiment of the present application at least include:
[0066] Combined with the closed attributes of each virtual space in the virtual scenario and the position of the receiving point in the virtual scenario, the space type of each virtual space is determined in real time. Then, based on the space type of each virtual space and the positions of the receiving point and the sound source, sound effects processing is performed on the sound emitted by the sound source. In this process, it is not necessary to track the sound emitted by the sound source, which greatly simplifies the calculation process, reduces the resource occupancy, and thus improves the efficiency of sound processing in the virtual scenario. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application.
[0068] Figure 1 is a schematic diagram of an implementation environment provided by an exemplary embodiment of the present application;
[0069] Figure 2 is a schematic diagram of a display interface of a virtual scenario provided by an exemplary embodiment of the present application;
[0070] Figure 3 is a flowchart of a sound processing method in a virtual scenario provided by an exemplary embodiment of the present application;
[0071] Figure 4 is a flowchart of a sound processing method in a virtual scenario provided by an exemplary embodiment of the present application;
[0072] Figure 5 is Figure 4 an example diagram of the virtual scenario to UVW conversion involved in the shown embodiment;
[0073] Figure 6 is Figure 4Schematic diagram of sound effects related to the illustrated embodiment;
[0074] Figure 7 is Figure 4 Interaction diagram of system modules related to the illustrated embodiment;
[0075] Figure 8 is Figure 4 System framework diagram of the UVW system related to the illustrated embodiment;
[0076] Figure 9 is Figure 4 Schematic diagram of a sound rendering process related to the illustrated embodiment;
[0077] Figure 10 is Figure 4 Another schematic diagram of a sound rendering process related to the illustrated embodiment;
[0078] Figure 11 is Figure 4 Yet another schematic diagram of a sound rendering process related to the illustrated embodiment;
[0079] Figure 12 Block diagram of a sound processing device in a virtual scene shown in an exemplary embodiment of the present application;
[0080] Figure 13 Block diagram of a computer device provided in an exemplary embodiment of the present application;
[0081] Figure 14 Block diagram of a computer device shown in an exemplary embodiment of the present application. Detailed implementation manners
[0082] Here, the exemplary embodiments will be described in detail, and the examples are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0083] It should be understood that the "several" mentioned herein refers to one or more, and "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after.
[0084] Figure 1A schematic diagram of an implementation environment provided by an exemplary embodiment of the present application is shown. The implementation environment may include: a first terminal 110, a server 120, and a second terminal 130.
[0085] The first terminal 110 installs and runs an application 111 that supports a virtual environment. The application 111 may be a multiplayer online battle program. When the first terminal runs the application 111, the user interface of the application 111 is displayed on the screen of the first terminal 110. The application 111 may be any one of multiplayer online battle arena games (MOBA), battle royale games, survival games, and simulation games (SLG). In this embodiment, it is exemplified that the application 111 is a first-person game. The first terminal 110 is a terminal used by the first user 112. The first user 112 uses the first terminal 110 to control a first virtual object located in the virtual environment to perform activities. The first virtual object may be referred to as the master virtual object of the first user 112. The activities of the first virtual object include, but are not limited to: adjusting the body posture, crawling, walking, running, cycling, flying, jumping, driving, picking up, launching virtual projectiles, attacking, throwing, releasing skills, collecting materials / resources, and building buildings. Schematically, the first virtual object is a first virtual character, such as an emulated character or an anime character.
[0086] Among them, a first-person game refers to a game in which the user can launch virtual projectiles from a first-person perspective. The picture of the virtual environment in the game is a picture of observing the virtual environment from the perspective of the first virtual object. Each virtual object in the game can cooperate in a team or fight against virtual objects controlled by other users. For example, in the battle mode of the game, at least two virtual objects conduct a single-round battle in the virtual environment. The virtual object achieves the purpose of surviving in the virtual environment by avoiding the damage initiated by other virtual objects and the dangers existing in the virtual environment (such as a poison gas circle, a swamp, etc.). When the health value of the virtual object in the virtual environment is zero, the life of the virtual object in the virtual environment ends. Optionally, the battle starts at the moment when the first client joins the battle and ends at the moment when the last client exits the battle. Each client can control one or more virtual objects in the virtual environment. Optionally, the competitive mode of the battle may include a single-player battle mode, a two-person team battle mode, or a multi-person large-group battle mode. The embodiments of the present application do not limit the battle mode.
[0087] The second terminal 130 installs and runs an application program 131 that supports a virtual environment. This application program 131 can be a multiplayer online battle program. When the second terminal 130 runs the application program 131, the user interface of the application program 131 is displayed on the screen of the second terminal 130. This client can be any one of a MOBA game, a battle royale game, a survival game, and an SLG game. In this embodiment, it is exemplified that the application program 131 is a first-person game. The second terminal 130 is a terminal used by the second user 132. The second user 132 uses the second terminal 130 to control a second virtual object located in the virtual environment to perform activities. The second virtual object can be called the main control virtual character of the second user 132. Schematically, the second virtual object is a second virtual character, such as an emulated character or an anime character.
[0088] Optionally, the first virtual object and the second virtual object are in the same virtual world. Optionally, the first virtual object and the second virtual object can belong to the same camp, the same team, the same organization, have a friendship relationship, or have temporary communication permissions. Optionally, the first virtual object and the second virtual object can belong to different camps, different teams, different organizations, or have a hostile relationship.
[0089] Among them, a virtual object refers to an activatable object in a virtual scene. This activatable object can be at least one of a virtual character, a virtual animal, and a virtual vehicle. Optionally, when the virtual scene is a three-dimensional virtual scene, the virtual object is a three-dimensional solid model created based on animation skeleton technology. Each virtual object has its own shape, volume, and orientation in the three-dimensional virtual scene and occupies a part of the space in the three-dimensional virtual scene.
[0090] Optionally, the application programs installed on the first terminal 110 and the second terminal 130 are the same, or the application programs installed on the two terminals are the same type of application programs on different operating system platforms (Android or IOS). The first terminal 110 can generally refer to one of multiple terminals, and the second terminal 130 can generally refer to another of multiple terminals. This embodiment only takes the first terminal 110 and the second terminal 130 as an example. The device types of the first terminal 110 and the second terminal 130 are the same or different. The device types include at least one of a smart phone, a tablet computer, an e-book reader, an MP3 (Moving Picture Experts Group Audio Layer III) player, an MP4 (Moving Picture Experts Group Audio Layer IV) player, a laptop computer, and a desktop computer.
[0091] Figure 1 Only two terminals are shown in the figure, but there are multiple other terminals that can access the server 120 in different embodiments. Optionally, there is also one or more terminals corresponding to the developer, and a development and editing platform for applications that support virtual environments is installed on this terminal. The developer can edit and update the application on this terminal, and transmit the updated application installation package to the server 120 through a wired or wireless network. The first terminal 110 and the second terminal 130 can download the application installation package from the server 120 to update the application.
[0092] The first terminal 110, the second terminal 130, and other terminals are connected to the server 120 through a wireless network or a wired network.
[0093] The server 120 includes at least one of a single server, a server cluster composed of multiple servers, a cloud computing platform, and a virtualization center. The server 120 is used to provide background services for applications that support three-dimensional virtual environments. Optionally, the server 120 undertakes the main computing work, and the terminal undertakes the secondary computing work; or, the server 120 undertakes the secondary computing work, and the terminal undertakes the main computing work; or, a distributed computing architecture is adopted between the server 120 and the terminal for collaborative computing.
[0094] In a schematic example, the server 120 includes a memory 121, a processor 122, a battle service module 124, and a user-oriented input / output interface (I / O interface) 125. Among them, the processor 122 is used to load the instructions stored in the server 120 and process the data in the battle service module 124; the battle service module 124 is used to provide multiple battle rooms for users to conduct battles, such as 1V1 battles, 3V3 battles, 5V5 battles, etc.; the user-oriented I / O interface 125 is used to establish communication with the first terminal 110 and / or the second terminal 130 through a wireless network or a wired network to exchange data.
[0095] Among them, the virtual scene can be a three-dimensional virtual scene, or the virtual scene can also be a two-dimensional virtual scene. The virtual scene is a virtual scene displayed (or provided) when the application runs on the terminal. The virtual scene can be a simulation environment scene of the real world, a semi-simulation and semi-fictional three-dimensional environment scene, or a purely fictional three-dimensional environment scene. The virtual scene can be any one of a two-dimensional virtual scene, a 2.5D virtual scene, and a three-dimensional virtual scene. The following embodiments take the virtual scene as a three-dimensional virtual scene as an example for illustration, but are not limited thereto. Optionally, the virtual scene can also be used for virtual scene battles between at least two virtual characters. Optionally, the virtual scene can also be used for battles between at least two virtual characters using virtual props. Optionally, the virtual scene can also be used for battles between at least two virtual characters using virtual props within a target area range, and the target area range will continuously decrease as time passes in the virtual scene.
[0096] The virtual scene is usually generated by an application in a computer device such as a terminal and is displayed based on the hardware in the terminal (such as the screen). The terminal can be a mobile terminal such as a smart phone, a tablet computer, or an e-book reader; or, the terminal can also be a personal computer device such as a notebook computer or a fixed computer.
[0097] Please refer to Figure 2 , which shows a schematic diagram of the display interface of the virtual scene provided by an exemplary embodiment of the present application. As Figure 2 shown, the display interface of the virtual scene includes a scene screen 200, and the scene screen 200 includes the currently controlled virtual object 210, the environmental screen 220 of the three-dimensional virtual scene, and the virtual object 240. Among them, the virtual object 240 can be a virtual object controlled by the corresponding user of another terminal or a virtual object controlled by the application program.
[0098] In Figure 2 , the currently controlled virtual object 210 and the virtual object 240 are three-dimensional models in the three-dimensional virtual scene, and the environmental screen of the three-dimensional virtual scene displayed in the scene screen 200 is the object observed from the perspective of the currently controlled virtual object 210. Exemplarily, as Figure 2 shown, from the perspective of the currently controlled virtual object 210, the displayed environmental screen 220 of the three-dimensional virtual scene is the ground 224, the sky 225, the horizon 223, the small hill 221, and the factory building 222.
[0099] The currently controlled virtual object 210 can release skills or use virtual items, move, and perform specified actions under the control of the user. Under the control of the user, the virtual objects in the virtual scene can display different 3D models. For example, if the screen of the terminal supports touch operations and the scene image 200 of the virtual scene contains virtual controls, when the user touches the virtual control, the currently controlled virtual object 210 can perform specified actions in the virtual scene and display the corresponding 3D model at present.
[0100] Figure 3 The flowchart of the sound processing method in the virtual scene provided by an exemplary embodiment of the present application is shown. The sound processing method in the virtual scene can be executed by a computer device, which can be a terminal, a server, or the computer device can also include the above terminal and server. As Figure 3 shown, the sound processing method in the virtual scene includes:
[0101] Step 310, obtain the closed attributes of each virtual space in the virtual scene and the position of the receiving point; the closed attribute is used to indicate whether the virtual space is a closed space; the position of the receiving point includes the position of the virtual object controlled by the target terminal in the virtual scene.
[0102] In the embodiment of the present application, the virtual space refers to the acoustical space preset in the virtual scene, and can also be called a room.
[0103] The position of the listener in the virtual scene can be called the position of the receiving point. In the virtual scene, the receiving point can be the position of a virtual object controlled by the target terminal in the virtual scene. For example, if the virtual object is a virtual character controlled by the user through the terminal, the position of the virtual character in the virtual scene is the above-mentioned position of the receiving point.
[0104] Step 320, based on the closed attributes of each virtual space and the position of the receiving point, obtain the space type of each virtual space.
[0105] In the embodiment of the present application, each virtual space in the virtual scene can respectively have corresponding closed attributes, which are used to indicate whether the virtual space is a closed acoustical space.
[0106] Step 330, based on the space type of the virtual space where the receiving point is located and the space type of the virtual space where the target sound source is located, add sound effects to the sound emitted by the target sound source to obtain the target sound of the target sound source at the position of the receiving point.
[0107] In summary, the solution shown in the embodiments of the present application combines the closed attributes of each virtual space in the virtual scene and the position of the receiving point in the virtual scene to determine the space type of each virtual space in real time. Then, based on the space type of each virtual space and the positions of the receiving point and the sound source, sound effects processing is performed on the sound emitted by the sound source. In this process, it is not necessary to track the sound emitted by the sound source, which greatly simplifies the calculation process, reduces the resource occupancy, and thus improves the efficiency of sound processing in the virtual scene.
[0108] Figure 4 The flowchart of the sound processing method in the virtual scene provided by an exemplary embodiment of the present application is shown. The sound processing method in the virtual scene can be executed by a computer device, which can be a terminal, a server, or the computer device can also include the above-mentioned terminal and server. As Figure 4 shown, the sound processing method in the virtual scene includes:
[0109] Step 410, obtain the closed attributes of each virtual space in the virtual scene; the closed attribute is used to indicate whether the virtual space is a closed space.
[0110] Among them, the closed attribute of the above virtual space can be set in advance by the developer. For example, if a virtual space is fully enclosed or semi-enclosed, the developer can set the closed attribute of the virtual space to a closed space. Correspondingly, if a virtual space is not enclosed, the developer can set the closed attribute of the virtual space to a non-closed space (or an open space).
[0111] Alternatively, the closed attribute of the above virtual space can also be set by the application program. For example, when the above virtual scene is a scene generated by the application program itself, the application program can divide the virtual scene (for example, divide it according to the terrain or spatial structure), and automatically set the closed attribute for the divided virtual space. For example, if a virtual space divided by the application program is fully enclosed or semi-enclosed, the application program can set the closed attribute of the virtual space to a closed space. Correspondingly, if a virtual space divided by the application program is not enclosed, the application program can set the closed attribute of the virtual space to a non-closed space.
[0112] Step 420, obtain the receiving point position; the receiving point position includes the position of the virtual object controlled by the target terminal in the virtual scene.
[0113] In the embodiments of the present application, the generated sound in the virtual scene usually needs to be transmitted to the terminal for playback. Moreover, for the terminals that control different virtual objects, the sound effect played depends on the position of the corresponding virtual object in the virtual scene. Therefore, for a given target terminal, the computer device can use the position of the virtual object controlled by the target terminal in the virtual scene as the above-mentioned receiving point position.
[0114] Step 430: Based on the closed attributes of each virtual space and the receiving point position, obtain the space type of each virtual space.
[0115] In the embodiments of the present application, the computer device can obtain the space type of each virtual space based on the closed attributes of each virtual space and the virtual space where the receiving point position is located (or the ownership relationship between the receiving point position and each virtual space).
[0116] In a possible implementation manner, obtaining the space type of each virtual space based on the closed attributes of each virtual space and the receiving point position includes:
[0117] In response to the closed attribute of the target virtual space indicating that the target virtual space is a closed space and the receiving point position is within the target virtual space, obtain that the space type of the target virtual space is the first space type; in the embodiments of the present application, it can be referred to as the U space;
[0118] In response to the closed attribute of the target virtual space indicating that the target virtual space is a closed space and the receiving point position is outside the target virtual space, obtain that the space type of the target virtual space is the second space type; in the embodiments of the present application, it can be referred to as the V space;
[0119] In response to the closed attribute of the target virtual space indicating that the target virtual space is a non-closed space, obtain that the space type of the target virtual space is the third space type; in the embodiments of the present application, it can be referred to as the W space;
[0120] Wherein, the target virtual space is any one of each virtual space.
[0121] In the embodiments of the present application, the space type of each closed virtual space in the virtual scene is determined by the virtual space where the receiving point is located. That is to say, as the sound source moves, the space type of each closed virtual space changes dynamically. For a certain fixed closed virtual space, since at different times, the position of the sound source may be inside the virtual space or outside the virtual space, correspondingly, the space type of this virtual space may also be different at different times.
[0122] Taking the above virtual scenario as a game scenario as an example, in the embodiments of the present application, the sound playback scenario in the game can generally be composed of three elements: a sound source, a receiver, and an acoustic space:
[0123] 1) Sound source (Source): The object that plays the sound.
[0124] Each sound source can play multiple sounds simultaneously. Generally, there are multiple sound sources in the playback scenario, and the sound sources are independent of each other.
[0125] 2) Receiver (Listener): The object that receives the sounds played by all sound sources.
[0126] For a given terminal, there is usually one receiver in the playback scenario. After the sounds played by all sound sources are processed in various ways, they are mixed and output to the receiver.
[0127] 3) Acoustic space (Room): An area with independent acoustic effects is abstracted as an acoustic space.
[0128] Any enclosed or incompletely enclosed area, such as various warehouses, houses, and caves in the scenario that need to show spatial acoustic effects, can be abstracted as a Room. At the same time, to simulate the sound diffraction effect, generally, Rooms are connected through portals (Portals).
[0129] In the embodiments of the present application, the acoustic effects of the Rooms in the virtual scenario that contain Sources need to be simulated and calculated. When the number of Sources is relatively large and they are distributed in different Rooms, the overall computational amount of spatial acoustics is particularly large. Therefore, the computational complexity of spatial acoustics in this case can be regarded as the number of Rooms containing Sources, expressed as: O(n).
[0130] According to the relative position relationship between each Source and the Room where the Listener is located, while taking into account the simulation of the spatial acoustic effects during the sound propagation process, the entire scene area can be represented by three spaces: U, V, and W. The definitions of the three spaces are as follows:
[0131] U space: The enclosed Room space where the Listener is located. In the U space, the audio played by the Source can have a reverberation effect;
[0132] V space: The enclosed Room space that does not contain the Listener. In the V space, the audio played by the Source can have reverberation and diffraction effects;
[0133] W Space: An unenclosed space. When the Listener is in the W Space, the audio played by the Source in the W Space can have a blocking effect; when the Listener is in the U Space, the audio played by the Source in the W Space can have a diffraction effect.
[0134] After the virtual scene area is represented by the UVW space, the overall computational amount of spatial effects such as reverberation and reflection is related to 3 types of Rooms. At this time, the computational complexity of spatial acoustics is reduced from O(n) to O(1), effectively reducing the performance consumption of spatial acoustics.
[0135] Please refer to Figure 5 , which shows an example diagram of the virtual scene to UVW conversion involved in the embodiments of the present application. As Figure 5 shown, in Figure 5 the upper part, the Listener is in an unenclosed space, and there are four spaces in the scene. Each space needs to perform independent acoustic effect calculations. After UVW conversion, the entire scene only contains two spaces, V and W; in Figure 5 the lower part, the Listener is in an enclosed space. After UVW conversion, the entire scene contains three spaces, U, V, and W. When the scene is particularly complex, the number of independent spaces is uncontrollable and the computational amount is particularly large. After UVW conversion, the number of spaces can be maintained at a maximum of 3, ensuring that the computational amount of acoustic effects is controllable.
[0136] Step 440, based on the spatial type of the virtual space where the receiving point is located and the spatial type of the virtual space where the target sound source is located, add sound effects to the sound emitted by the target sound source to obtain the target sound at the receiving point location.
[0137] In a possible implementation, based on the spatial type of the virtual space where the receiving point is located and the spatial type of the virtual space where the target sound source is located, adding sound effects to the sound emitted by the target sound source to obtain the target sound at the receiving point location includes:
[0138] In response to the spatial type of the virtual space where the receiving point is located and the spatial type of the virtual space where the target sound source is located satisfying the first condition, add the first sound effect to the sound emitted by the target sound source to obtain the target sound;
[0139] wherein, the first sound effect includes at least one of a blocking effect, a reflection effect, and a reverberation effect;
[0140] The first condition includes: the spatial type of the virtual space where the receiving point is located is the first spatial type, and the spatial type of the virtual space where the target sound source is located is the first spatial type.
[0141] In an embodiment of the present application, when the receiving point position and the sound source position are in the same enclosed virtual space, for example, when the virtual object controlled by the target terminal and the sound source are in the same room, the sound emitted by the sound source can be reflected by the room wall, and the reflected sound and the sound emitted by the sound source may be mixed to form reverberation. At the same time, factors such as obstacles between the sound source and the virtual object controlled by the target terminal will also weaken the sound emitted by the sound source. In this regard, in the solution shown in the embodiment of the present application, for the case where the sound source and the receiving point position are in the same enclosed virtual space, the computer device can process the sound emitted by the sound source to simulate at least one of the sound effects of blocking, reflection, and reverberation.
[0142] In one possible implementation, adding a first sound effect to the sound emitted by the target sound source to obtain a target sound includes:
[0143] Adding a blocking sound effect to the direct sound to obtain a blocked sound;
[0144] Adding a late reverberation sound effect to the early reflected sound to obtain a reverberant sound;
[0145] Obtaining the target sound based on the early reflected sound, the blocked sound, and the reverberant sound.
[0146] Wherein, the above-mentioned direct sound may refer to the sound that directly propagates to the receiving point position after being emitted by the sound source; the above-mentioned early reflected sound may refer to the sound after being early reflected by an obstacle (such as a wall) after being emitted by the sound source.
[0147] In one possible implementation, adding a sound effect to the sound emitted by the target sound source based on the space type of the virtual space where the receiving point position is located and the space type of the virtual space where the target sound source is located to obtain the target sound at the receiving point position of the target sound source includes:
[0148] In response to the space type of the virtual space where the receiving point position is located and the space type of the virtual space where the target sound source is located satisfying the first condition, adding a second sound effect to the sound emitted by the target sound source to obtain a target sound;
[0149] Wherein, the second sound effect includes at least one of a transmission effect, a diffraction effect, and a reverberation effect;
[0150] The first condition includes:
[0151] The space type of the virtual space where the receiving point position is located is the first space type, and the space type of the virtual space where the target sound source is located is the second space type;
[0152] Or, the space type of the virtual space where the receiving point position is located is the third space type, and the space type of the virtual space where the target sound source is located is the second space type.
[0153] In the embodiments of the present application, when the receiving point position and the sound source position are respectively in different enclosed virtual spaces, or when the receiving point position is in an open virtual space while the sound source position is in an enclosed virtual space, the direct sound / reflected sound emitted by the sound source may need to pass through wall transmission and diffraction at the channel opening / doorway to reach the receiving point position. In this regard, in the solution shown in the embodiments of the present application, for the case where the sound source is in an enclosed virtual space and the receiving point position is in another enclosed or open virtual space, the computer device can process the sound emitted by the sound source to simulate at least one of the sound effects of transmission effect, diffraction effect, and reverberation effect.
[0154] In one possible implementation, adding a second sound effect to the sound emitted by the target sound source to obtain the target sound includes:
[0155] Generating the direct sound and reverberant sound corresponding to the target sound source;
[0156] Adding a transmission sound effect to the direct sound and reverberant sound to obtain the transmitted sound;
[0157] Adding a diffraction sound effect to the reverberant sound to obtain the diffracted sound;
[0158] Obtaining the target sound based on the transmitted sound and the diffracted sound.
[0159] In one possible implementation, adding a sound effect to the sound emitted by the target sound source based on the spatial type of the virtual space where the receiving point position is located and the spatial type of the virtual space where the target sound source is located to obtain the target sound of the target sound source at the receiving point position includes:
[0160] In response to the spatial type of the virtual space where the receiving point position is located and the spatial type of the virtual space where the target sound source is located satisfying a third condition, adding a third sound effect to the sound emitted by the target sound source to obtain the target sound;
[0161] Wherein, the third sound effect includes a blocking sound effect;
[0162] The third condition includes:
[0163] The spatial type of the virtual space where the receiving point position is located is the first spatial type, and the spatial type of the virtual space where the target sound source is located is the third spatial type;
[0164] Or, the spatial type of the virtual space where the receiving point position is located is the third spatial type, and the spatial type of the virtual space where the target sound source is located is the third spatial type.
[0165] In the embodiments of the present application, when the sound source is in an open virtual space and the receiving point is in an open or closed virtual space, the direct sound emitted by the sound source may need to be weakened by obstacles before reaching the receiving point. In this regard, in the solution shown in the embodiments of the present application, for the case where the sound source is in an open virtual space and the receiving point is in another closed or open virtual space, the computer device can process the sound emitted by the sound source to simulate the blocking effect.
[0166] In a possible implementation, adding a third sound effect to the sound emitted by the target sound source to obtain the target sound includes:
[0167] Generating a direct sound corresponding to the target sound source;
[0168] Adding a blocking sound effect to the direct sound to obtain the target sound.
[0169] In the embodiments of the present application, the sound effects in the above various cases are only introduced by way of example and do not limit the specific sound effects in various cases; that is to say, the sound effects in the above various cases can be set by developers themselves according to requirements.
[0170] In a possible implementation, the computer device can also set a volume gain for the target sound source based on the space type of the virtual space where the target sound source is located;
[0171] The above adding a sound effect to the sound emitted by the target sound source based on the space type of the virtual space where the receiving point is located and the space type of the virtual space where the target sound source is located to obtain the target sound at the receiving point position of the target sound source includes:
[0172] Adding a sound effect to the sound emitted by the target sound source based on the space type of the virtual space where the receiving point is located, the space type of the virtual space where the target sound source is located, and the volume gain of the target sound source to obtain the target sound.
[0173] After the sound emitted by the sound source is affected by reflection, blocking, reverberation, diffraction, etc., its volume will have a certain loss. In this regard, in the embodiments of the present application, when the computer device adds a sound effect to the sound emitted by the target sound source, it can determine the volume gain of the target sound source in combination with the sound source, the receiving point position, and the space type of the virtual space where the sound source and the receiving point are located, and add the sound effect in combination with the volume gain.
[0174] Among them, the above volume gain can be the volume coefficient of the sound corresponding to the target sound source when adding the sound effect. That is to say, when adding a sound effect to the sound emitted by the target sound source, the computer device can multiply the volume of the sound corresponding to the target sound source by the above volume gain.
[0175] In a possible implementation, the volume gain includes at least one of the following gains:
[0176] The gain of the direct sound, the gain of the blocked sound, the gain of the reverberant sound, and the gain of the diffracted sound.
[0177] Among them, for different sound components in the sound corresponding to the sound source received at the receiving point position, the computer device can separately set the corresponding volume gain.
[0178] In a possible implementation, based on the spatial type of the virtual space where the target sound source is located, setting the volume gain for the target sound source includes:
[0179] In response to the spatial type of the virtual space where the target sound source is located being the first spatial type, setting the volume gain of the direct sound of the target sound source to 1;
[0180] In response to the spatial type of the virtual space where the target sound source is located being the second spatial type, setting the volume gain of the direct sound of the target sound source to a, where 0 < a < 1;
[0181] In response to the spatial type of the virtual space where the target sound source is located being the third spatial type, setting the volume gain of the direct sound of the target sound source to b, where 0 < b < 1.
[0182] In the embodiments of the present application, for the direct sound of the sound source, when the sound source and the receiving point position are in the same closed virtual space, the distance between the sound source and the receiving point position is relatively close. At this time, the blocking effect can be not considered, and the volume gain can be set to 1; when the sound source and the receiving point position are in different closed virtual spaces, or when the sound source is in an open virtual space, the distance between the sound source and the receiving point position may be relatively far. At this time, the blocking effect can be considered, and the volume gain can be set to less than 1.
[0183] Among them, the values of a and b above can be the same or different.
[0184] In a possible implementation, based on the spatial type of the virtual space where the target sound source is located, setting the volume gain for the target sound source includes:
[0185] In response to the spatial type of the virtual space where the target sound source is located being the second spatial type, and there being a connection port between the virtual space where the target sound source is located and the virtual space where the receiving point position is located, setting the volume gain of at least one of the reverberant sound and the diffracted sound of the target sound source.
[0186] In an embodiment of the present application, for the case where the positions of the sound source and the receiving point are respectively located in two closed virtual spaces, and there is a connection opening between the two closed virtual spaces, reverberant sound and diffracted sound will be generated during the process of the sound emitted by the sound source propagating to the receiving point position. In this regard, the computer device can set the volume gain for the reverberant sound and the diffracted sound.
[0187] In a possible implementation manner, setting the volume gain of the reverberant sound of the target sound source includes:
[0188] Setting the volume gain of at least one of the reverberant sound and the diffracted sound of the target sound source to a fixed value;
[0189] Or, based on the distance between the target sound source and the receiving point position, setting the volume gain of at least one of the reverberant sound and the diffracted sound of the target sound source.
[0190] Among them, the volume gain of the reverberant sound / diffracted sound can be set to a fixed value (such as set by a developer), or the volume gain of the reverberant sound / diffracted sound can also be determined based on the distance between the target sound source and the receiving point position. For example, the above-mentioned volume gain of the reverberant sound / diffracted sound can be inversely correlated with the distance between the sound source and the receiving point position. That is to say, the greater the distance between the sound source and the receiving point position, the smaller the volume gain.
[0191] In a possible implementation manner, setting the volume gain for the target sound source based on the space type of the virtual space where the target sound source is located includes:
[0192] In response to the space type of the virtual space where the target sound source is located being the first space type or the third space type, setting the volume gain of the blocked sound of the target sound source.
[0193] In an embodiment of the present application, when the sound source and the receiving point position are in the same closed virtual space, or when the sound source is in an open virtual space, there will be a blockage during the process of the sound emitted by the sound source propagating to the receiving point position. In this regard, the computer device can set the volume gain for the blocked sound.
[0194] In a possible implementation manner, setting the volume gain of the blocked sound of the target sound source includes:
[0195] Obtaining the blocking value between the target sound source and the receiving point position, where the blocking value is used to indicate the degree of blockage between the target sound source and the receiving point position;
[0196] Based on the blocking value between the target sound source and the receiving point position, setting the volume gain of the blocked sound of the target sound source.
[0197] In the embodiments of the present application, the above-mentioned blocking value can be determined by the distance between the sound source and the receiving point and the material of the obstacle. For example, the computer device can obtain the distance between the sound source and the receiving point, as well as the obstacle information between the sound source and the receiving point (such as the material of the obstacle, the thickness of the obstacle, the identifier of the obstacle, etc.), and determine the blocking value between the target sound source and the receiving point according to the obtained distance and obstacle information.
[0198] Among them, the algorithm for determining the blocking value through the distance and obstacle information, and the conversion method between the blocking value and the volume gain can be preset by the developer, and the embodiments of the present application do not limit the specific formula or process of the algorithm / conversion method.
[0199] In a virtual scene, when the sound source Source and the Listener play sounds in the same Room space, there will be a spatial reverberation acoustic effect. Please refer to Figure 6 , which shows the schematic diagram of the sound effect involved in the embodiments of the present application. As Figure 6 shown on the left: The reverberation effect in the space can be simulated by relying on the early reflected sound that depends on the space geometry and position, and then superimposing the late reverberation related to the space size. If there is also a block between the two, a sound blocking effect will also occur. As Figure 6 shown on the right: When the Listener and the Source are not in the same Room, in the process of the sound played by the Source propagating to the Listener, in addition to the indoor effect, there are also acoustic effects such as sound cage / blocking or diffraction.
[0200] The elements such as the sound source Source, the receiver Listener, and the acoustic space Room are generally placed and set during scene editing. The solution shown in the embodiments of the present application is to perform real-time processing during the operation of the virtual scene, so it does not affect the placement and setting process of the acoustic model of the traditional scene space. Please refer to Figure 7 , which shows the interaction diagram of the system modules involved in the embodiments of the present application. Taking a game as an example, as Figure 7 shown: The audio designer edits the game scene 71, and places the corresponding acoustic models 72 according to the effect requirements, mainly including the space Room and the connection port (also called the connected porch) Portal between Rooms. During the game operation, the UVW system 73 automatically manages the loaded Rooms and Portals, makes UVW judgments by tracking the positions of the sound source Source and the receiver Listener and Room switching, and finally controls the audio engine 74 to perform the rendering of the corresponding spatial acoustic effects according to the current UVW state.
[0201] In the embodiments of the present application, the UVW system works during the game operation. Please refer to Figure 8, which shows the system framework diagram of the UVW system involved in the embodiments of the present application. As Figure 8 shown, the system consists of a UVW detection module 81, a UVW management module 82, and a UVW rendering module 83.
[0202] In Figure 8 , the game scene includes Source, Listener, Room, and the geometric surface Geometry that constitutes the Room. The Portals between Rooms constitute the sound playback elements of the entire game scene.
[0203] The UVW detection module 81 is used to track the real-time movement of the positions of Source and Listener and the Room switching, and perform UVW conversion.
[0204] The UVW management module 82 is responsible for managing the queue elements corresponding to each Room.
[0205] The UVW rendering module 83 is used to perform spatial acoustic effect rendering according to the UVW states of each Source. While controlling the performance consumption, the UVW system ensures the spatial acoustic effect, especially the spatial effect in the first person view.
[0206] Based on Figure 8 the system framework shown, the specific process of the UVW system running is as follows:
[0207] 1) Register VRoom and W Room. The ID of VRoom = 1, and the ID of WRoom = 2. V Room is used as a reverberation space, adding a preset reverberation effect, and setting partial blockage to other Rooms, without size and dimensions. W Room has no reverberation and no blockage to other Rooms. Initialize the ID of U Room = -1. Among them, the above IDs of V Room, WRoom, and U Room are used to identify V Room, WRoom, and U Room.
[0208] 2) When the Rooms in the scene are loaded, add them to the Room table: R = <RoomID, Room>. These Rooms do not produce actual spatial acoustic effects and are mainly used for the spatial determination of Source. When a Room is unloaded, remove it from the Room table. Among them, RoomID uniquely represents the corresponding Room in the virtual scene. The above IDs of V Room, WRoom, and U Room are used to represent the Room type to which a specific Room belongs.
[0209] 3) When a Portal within the scene is loaded, associate it with the corresponding Room and add it to the Portal table: P = <Room ID, Portal>. When the Portal is unloaded, remove it from the Portal table.
[0210] 4) When a Source within the scene is created, add it to the Source queue S = {s1,..., Sn}. Usually, the Listener itself is a Source, so they can be managed uniformly. Each Source will independently track its position movement and detect the corresponding Room ID it is in, forming the Source table: S = <source ID,Room ID> . When the Source is destroyed, remove it from the Source table.
[0211] 5) By traversing the Source table S, the corresponding Listener can be obtained, and at the same time, the Room ID where the Listener is located can be obtained.
[0212] 6) Determine whether the Room ID where the Listener is located has changed. If the Listener has changed, re-register the Listener corresponding to U and VRoom. If the Room has changed, first unregister the old Room ID and the corresponding geometric plane, update the U Room ID. If the Listener has a new Room, then re-register the new Room ID and set the geometric plane of the Room.
[0213] 7) Classify and manage the Source by UVW:
[0214] (a) If URoom ID >= 0, the Sources in the same Room as the Listener are in URoom, and the corresponding Source queue is US; the Sources in a different Room from the Listener are in VRoom, and the corresponding Source queue is VS; other Sources not in a Room are in W Room, and the corresponding Source queue is WS;
[0215] (b) If U Room ID < 0, the US queue is empty, the Sources in a Room are in VRoom, and the corresponding Source queue is VS. The non-Room Sources that are the same as the Listener are all in WRoom, and the corresponding Source queue is WS.
[0216] 8) Traverse the US queue, set the Source to be within URoom, and restore the Source playback volume gain gain = 1.0.
[0217] 9) Traverse the VS queue, set the Source to be inside the V Room, and set the playback volume gain of the Source to gain = a, where 0 < a < 1.
[0218] 10) Traverse the WS queue, set the Source to be inside the W Room. If the US is empty, set the playback volume gain of the Source to 1.0. If the US is not empty, set the playback volume gain of the Source to gain = b, where 0 < b < 1.
[0219] 11) Traverse the VS queue, look up the corresponding Portal according to the Room ID of the Source and the Portal table. If found, check whether the Listener is inside the associated Portal area. If so, add the Source to the diffraction table D: <Source, Distance>, where Distance is the distance between the Listener and the Portal area.
[0220] 12) If the diffraction table D is not empty, traverse and set the auxiliary transmission channel, that is, additional audio propagation between the Source and the Listener. This channel is set with a reverberation effect, and at the same time, set the volume gain level = c, where 0 < c < 1. It is also possible to associate the Distance to control the gain to simulate the diffraction effect.
[0221] 13) If the US is not empty, traverse the US queue to detect the blocking value between the Listener and the Source; otherwise, traverse the WS queue to detect the blocking value between the Listener and the Source, and use the blocking value to set the blocking volume attenuation.
[0222] 14) If the game continues to run, jump to step 5) to continue the iterative operation. Otherwise, exit.
[0223] Based on Figure 8 the system framework shown, in the UVM system rendering, there can be the following spatial acoustic rendering situations in several different states:
[0224] 1) The Listener and the Source are inside the U Room. At this time, there are three spatial acoustic effects: early reflection, late reverberation, and blocking. The schematic diagram of its sound rendering process is as Figure 9 shown.
[0225] 2) The Listener is inside the U Room and the Source is inside the V Room; or, the Listener is inside the W Room and the Source is inside the V Room. At this time, there are three spatial acoustic effects: reverberation, acoustic cage (transmission), and diffraction. The schematic diagram of its sound rendering process is Figure 10 shown.
[0226] 3) The Listener is located in the U Room and the Source is located in the W Room; or, the Listener is located in the W Room and the Source is located in the W Room. In this case, there is an acoustic blocking effect. The schematic diagram of sound rendering processing is as follows: Figure 11 as shown.
[0227] In summary, the solution shown in the embodiments of the present application combines the closed attributes of each virtual space in the virtual scene and the position of the receiving point in the virtual scene to determine the spatial type of each virtual space in real time. Then, based on the spatial type of each virtual space, as well as the positions of the receiving point and the sound source, sound effects processing is performed on the sound emitted by the sound source. During this process, it is not necessary to track the sound emitted by the sound source, which greatly simplifies the calculation process, reduces the resource occupancy, and thus improves the efficiency of sound processing in the virtual scene.
[0228] The solution shown in the present application proposes an algorithm and system for optimizing the playback of virtual space acoustic effects. Without affecting the spatial acoustic editing function, through the UVW conversion and management of the acoustic model of the virtual space, and according to the UVW spatial information of the playback sound source and the receiver, spatial acoustic effect rendering is performed. On the premise of ensuring the spatial audio effect, the overall performance consumption of the spatial acoustic effect is effectively controlled, so that the spatial audio technology can be applied to devices such as mobile terminals, greatly enhancing the audio immersion experience of mobile terminals, etc.
[0229] Figure 12 The block diagram of the sound processing device in the virtual scene provided by an exemplary embodiment of the present application is shown. The sound processing device in the virtual scene can be applied in a computer device to execute all or part of the steps in the method as Figure 3 or Figure 4 shown. As Figure 12 shown, the sound processing device in the virtual scene includes:
[0230] A first acquisition module 1201, configured to acquire the closed attributes of each virtual space in the virtual scene and the position of the receiving point; the closed attribute is used to indicate whether the virtual space is a closed space; the position of the receiving point includes the position of the virtual object controlled by the target terminal in the virtual scene;
[0231] A spatial type acquisition module 1202, configured to acquire the spatial type of each virtual space based on the closed attributes of each virtual space and the position of the receiving point;
[0232] A sound processing module 1203, configured to add a sound effect to the sound emitted by the target sound source based on the spatial type of the virtual space where the receiving point is located and the spatial type of the virtual space where the target sound source is located, so as to obtain a target sound at the receiving point position.
[0233] In a possible implementation manner, the spatial type acquisition module 1202 is configured to,
[0234] In response to the closed attribute of the target virtual space indicating that the target virtual space is a closed space and the receiving point position is within the target virtual space, obtain that the spatial type of the target virtual space is a first spatial type;
[0235] In response to the closed attribute of the target virtual space indicating that the target virtual space is a closed space and the receiving point position is outside the target virtual space, obtain that the spatial type of the target virtual space is a second spatial type;
[0236] In response to the closed attribute of the target virtual space indicating that the target virtual space is a non-closed space, obtain that the spatial type of the target virtual space is a third spatial type;
[0237] Wherein, the target virtual space is any one of the virtual spaces.
[0238] In a possible implementation manner, the sound processing module 1203 is configured to, in response to the spatial type of the virtual space where the receiving point is located and the spatial type of the virtual space where the target sound source is located satisfying a first condition, add a first sound effect to the sound emitted by the target sound source to obtain the target sound;
[0239] Wherein, the first sound effect includes at least one of a blocking effect, a reflection effect, and a reverberation effect;
[0240] The first condition includes: the spatial type of the virtual space where the receiving point is located is the first spatial type, and the spatial type of the virtual space where the target sound source is located is the first spatial type.
[0241] In a possible implementation manner, the sound processing module 1203 is configured to,
[0242] Add a blocking sound effect to the direct sound to obtain a blocked sound;
[0243] Add a late reverberation sound effect to the early reflection sound to obtain a reverberated sound;
[0244] Obtain the target sound based on the early reflection sound, the blocked sound, and the reverberated sound.
[0245] In a possible implementation, the sound processing module 1203 is configured to add a second sound effect to the sound emitted by the target sound source and obtain the target sound in response to that the space type of the virtual space where the receiving point is located and the space type of the virtual space where the target sound source is located satisfy a first condition;
[0246] wherein the second sound effect includes at least one of a transmission effect, a diffraction effect, and a reverberation effect;
[0247] The first condition includes:
[0248] the space type of the virtual space where the receiving point is located is the first space type, and the space type of the virtual space where the target sound source is located is the second space type;
[0249] or, the space type of the virtual space where the receiving point is located is the third space type, and the space type of the virtual space where the target sound source is located is the second space type.
[0250] In a possible implementation, the sound processing module 1203 is configured to:
[0251] generate a direct sound and a reverberant sound corresponding to the target sound source;
[0252] add a transmission sound effect to the direct sound and the reverberant sound to obtain a transmitted sound;
[0253] add a diffraction sound effect to the reverberant sound to obtain a diffracted sound;
[0254] obtain the target sound based on the transmitted sound and the diffracted sound.
[0255] In a possible implementation, the sound processing module 1203 is configured to add a third sound effect to the sound emitted by the target sound source and obtain the target sound in response to that the space type of the virtual space where the receiving point is located and the space type of the virtual space where the target sound source is located satisfy a third condition;
[0256] wherein the third sound effect includes a blocking sound effect;
[0257] The third condition includes:
[0258] the space type of the virtual space where the receiving point is located is the first space type, and the space type of the virtual space where the target sound source is located is the third space type;
[0259] Alternatively, the spatial type of the virtual space where the receiving point position is located is the third spatial type, and the spatial type of the virtual space where the target sound source is located is the third spatial type.
[0260] In a possible implementation, the sound processing module 1203 is configured to
[0261] generate a direct sound corresponding to the target sound source;
[0262] add a blocking sound effect to the direct sound to obtain the target sound.
[0263] In a possible implementation, the device further includes:
[0264] a gain setting module, configured to set a volume gain for the target sound source based on the spatial type of the virtual space where the target sound source is located;
[0265] The sound processing module 1203 is configured to add a sound effect to the sound emitted by the target sound source based on the spatial type of the virtual space where the receiving point position is located, the spatial type of the virtual space where the target sound source is located, and the volume gain of the target sound source to obtain the target sound.
[0266] In a possible implementation, the volume gain includes at least one of the following gains:
[0267] gain of the direct sound, gain of the blocking sound, gain of the reverberant sound, and gain of the diffracted sound.
[0268] In a possible implementation, the gain setting module is configured to
[0269] in response to the spatial type of the virtual space where the target sound source is located being the first spatial type, set the volume gain of the direct sound of the target sound source to 1;
[0270] in response to the spatial type of the virtual space where the target sound source is located being the second spatial type, set the volume gain of the direct sound of the target sound source to a, where 0 < a < 1;
[0271] in response to the spatial type of the virtual space where the target sound source is located being the third spatial type, set the volume gain of the direct sound of the target sound source to b, where 0 < b < 1.
[0272] In a possible implementation, the gain setting module is configured to set the volume gain of at least one of the reverberant sound and the diffracted sound of the target sound source in response to the spatial type of the virtual space where the target sound source is located being the second spatial type, and there being a connection port between the virtual space where the target sound source is located and the virtual space where the receiving point position is located.
[0273] In a possible implementation, the gain setting module is configured to,
[0274] set the volume gain of at least one of the reverberant sound and the diffracted sound of the target sound source to a fixed value;
[0275] or, set the volume gain of at least one of the reverberant sound and the diffracted sound of the target sound source based on the distance between the target sound source and the receiving point position.
[0276] In a possible implementation, the gain setting module is configured to set the volume gain of the blocked sound of the target sound source in response to the spatial type of the virtual space where the target sound source is located being the first spatial type or the third spatial type.
[0277] In a possible implementation, the gain setting module is configured to,
[0278] obtain a blocking value between the target sound source and the receiving point position, where the blocking value is used to indicate the degree of blockage between the target sound source and the receiving point position;
[0279] set the volume gain of the blocked sound of the target sound source based on the blocking value between the target sound source and the receiving point position.
[0280] In summary, the solution shown in the embodiments of the present application combines the closed attributes of each virtual space in the virtual scene and the position of the receiving point in the virtual scene to determine the spatial type of each virtual space in real time, and then based on the spatial type of each virtual space and the positions of the receiving point and the sound source, perform sound effect processing on the sound emitted by the sound source. During this process, it is not necessary to track the sound emitted by the sound source, which greatly simplifies the calculation process, reduces the resource occupancy, and thus improves the efficiency of sound processing in the virtual scene.
[0281] Figure 13The structural block diagram of a computer device 1300 provided by an exemplary embodiment of the present application is shown. The computer device 1300 may be a portable mobile terminal, such as: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV) player, a notebook computer or a desktop computer. The computer device 1300 may also be referred to by other names such as user equipment, portable terminal, laptop terminal, desktop terminal, etc.
[0282] Generally, the computer device 1300 includes: a processor 1301 and a memory 1302.
[0283] The processor 1301 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1301 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), PLA (Programmable Logic Array).
[0284] The memory 1302 may include one or more computer-readable storage media, and the computer-readable storage media may be non-transitory. The memory 1302 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices, flash storage devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1302 is used to store at least one computer instruction, and the at least one computer instruction is used to be executed by the processor 1301 to implement the method provided by the method embodiment of the present application.
[0285] In some embodiments, the computer device 1300 may also optionally include: a peripheral device interface 1303 and at least one peripheral device. The processor 1301, the memory 1302, and the peripheral device interface 1303 may be connected through a bus or signal lines. Each peripheral device may be connected to the peripheral device interface 1303 through a bus, signal lines, or a circuit board. Specifically, the peripheral devices include: at least one of a radio frequency circuit 1304, a display screen 1305, a camera assembly 1306, an audio circuit 1307, and a power supply 1309.
[0286] In some embodiments, the computer device 1300 further includes one or more sensors 1310. The one or more sensors 1310 include, but are not limited to: an acceleration sensor 1311, a gyroscope sensor 1312, a pressure sensor 1313, an optical sensor 1315, and a proximity sensor 1316.
[0287] Those skilled in the art can understand that Figure 13 the structure shown in does not constitute a limitation on the computer device 1300, and it may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.
[0288] Figure 14 FIG. shows a block diagram of a computer device 1400 according to an exemplary embodiment of the present application. The computer device may be implemented as the protection and blocking device in the above solution of the present application. The computer device 1400 includes a central processing unit (CPU) 1401, a system memory 1404 including a random access memory (RAM) 1402 and a read-only memory (ROM) 1403, and a system bus 1405 connecting the system memory 1404 and the central processing unit 1401. The computer device 1400 further includes a basic input / output system (Input / Output system, I / O system) 1406 for facilitating information transmission between various components within the computer, and a mass storage device 1407 for storing an operating system 1413, application programs 1414, and other program modules 1415.
[0289] The basic input / output system 1406 includes a display 1408 for displaying information and input devices 1409 such as a mouse and a keyboard for user input of information. The display 1408 and the input devices 1409 are both connected to the central processing unit 1401 through an input / output controller 1410 connected to the system bus 1405. The basic input / output system 1406 may further include an input / output controller 1410 for receiving and processing inputs from multiple other devices such as a keyboard, a mouse, or an electronic stylus. Similarly, the input / output controller 1410 also provides output to a display screen, a printer, or other types of output devices.
[0290] The large-capacity storage device 1407 is connected to the central processing unit 1401 through a large-capacity storage controller (not shown) connected to the system bus 1405. The large-capacity storage device 1407 and its associated computer-readable medium provide non-volatile storage for the computer device 1400. That is to say, the large-capacity storage device 1407 may include a computer-readable medium (not shown) such as a hard disk or a compact disc read-only memory (CD-ROM) drive.
[0291] Without loss of generality, the computer-readable medium may include computer storage media and communication media. Computer storage media includes volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer-readable instructions, data structures, program modules, or other data. Computer storage media includes RAM, ROM, erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other solid-state storage technologies, CD-ROM, digital versatile disc (DVD), or other optical storage, magnetic tape cartridges, tapes, magnetic disk storage, or other magnetic storage devices. Of course, those skilled in the art will understand that the computer storage media is not limited to the above several types. The above system memory 1404 and large-capacity storage device 1407 may be collectively referred to as memory.
[0292] According to various embodiments of the present disclosure, the computer device 1400 may also be run by connecting to a remote computer on a network such as the Internet. That is, the computer device 1400 may be connected to the network 1412 through a network interface unit 1411 connected to the system bus 1405, or in other words, the network interface unit 1411 may also be used to connect to other types of networks or remote computer systems (not shown).
[0293] The memory further includes at least one computer instruction, and the at least one computer instruction is stored in the memory. The central processing unit 1401 implements all or part of the steps in the methods shown in the above various embodiments by executing the at least one computer instruction.
[0294] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory including at least one computer instruction, and the at least one computer instruction can be executed by a processor to complete the aboveFigure 3 or Figure 4 all or part of the steps of the method shown in any of the embodiments. For example, the non-transitory computer-readable storage medium may be ROM, RAM, CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0295] In an exemplary embodiment, a computer program product or a computer program is further provided. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above Figure 3 or Figure 4 all or part of the steps of the method shown in any of the embodiments.
[0296] Those skilled in the art will readily conceive of other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any variations, uses, or adaptations of the present application, which follow the general principles of the present application and include known common knowledge or conventional technical means in the technical field not disclosed in the present application. The specification and the embodiments are only regarded as exemplary, and the true scope and spirit of the present application are pointed out by the following claims.
[0297] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present application is only limited by the appended claims.
Claims
1. A method for processing sound in a virtual scenario, characterized in that, the method includes: obtaining the enclosure attribute of each virtual space in the virtual scenario and the receiving point position; the enclosure attribute is used to indicate whether the virtual space is an enclosed space; the receiving point position includes the position of the virtual object controlled by the target terminal in the virtual scenario; in response to the enclosure attribute of the target virtual space indicating that the target virtual space is an enclosed space and the receiving point position is within the target virtual space, obtaining that the space type of the target virtual space is the first space type; in response to the enclosure attribute of the target virtual space indicating that the target virtual space is an enclosed space and the receiving point position is outside the target virtual space, obtaining that the space type of the target virtual space is the second space type; in response to the enclosure attribute of the target virtual space indicating that the target virtual space is a non-enclosed space, obtaining that the space type of the target virtual space is the third space type; wherein, the target virtual space is any one of the virtual spaces; the entire scene area of the virtual scenario is represented by the first space type, the second space type, and the third space type; adding a sound effect to the sound emitted by the target sound source based on the space type of the virtual space where the receiving point position is located and the space type of the virtual space where the target sound source is located, to obtain the target sound of the target sound source at the receiving point position.
2. The method according to claim 1, characterized in that, the adding a sound effect to the sound emitted by the target sound source based on the space type of the virtual space where the receiving point position is located and the space type of the virtual space where the target sound source is located, to obtain the target sound of the target sound source at the receiving point position includes: in response to the space type of the virtual space where the receiving point position is located and the space type of the virtual space where the target sound source is located satisfying a first condition, adding a first sound effect to the sound emitted by the target sound source to obtain the target sound; wherein, the first sound effect includes at least one of a blocking effect, a reflection effect, and a reverberation effect; the first condition includes: the space type of the virtual space where the receiving point position is located is the first space type, and the space type of the virtual space where the target sound source is located is the first space type.
3. The method according to claim 2, characterized in that, the adding a first sound effect to the sound emitted by the target sound source to obtain the target sound includes: adding a blocking sound effect to the direct sound to obtain a blocked sound; adding a late reverberation sound effect to the early reflection sound to obtain a reverberated sound; obtaining the target sound based on the early reflection sound, the blocked sound, and the reverberated sound.
4. The method according to claim 1, characterized in that, Adding sound effects to the sound emitted by the target sound source based on the spatial type of the virtual space where the receiving point is located and the spatial type of the virtual space where the target sound source is located, to obtain the target sound at the receiving point position of the target sound source, includes: In response to the spatial type of the virtual space where the receiving point is located and the spatial type of the virtual space where the target sound source is located satisfying a second condition, adding a second sound effect to the sound emitted by the target sound source to obtain the target sound; Wherein, the second sound effect includes at least one of a transmission effect, a diffraction effect, and a reverberation effect; The second condition includes: The spatial type of the virtual space where the receiving point is located is the first spatial type, and the spatial type of the virtual space where the target sound source is located is the second spatial type; Or, the spatial type of the virtual space where the receiving point is located is the third spatial type, and the spatial type of the virtual space where the target sound source is located is the second spatial type.
5. The method according to claim 4, Characterized in that, The adding a second sound effect to the sound emitted by the target sound source to obtain the target sound includes: Generating a direct sound and a reverberant sound corresponding to the target sound source; Adding a transmission sound effect to the direct sound and the reverberant sound to obtain a transmitted sound; Adding a diffraction sound effect to the reverberant sound to obtain a diffracted sound; Obtaining the target sound based on the transmitted sound and the diffracted sound.
6. The method according to claim 1, Characterized in that, The adding sound effects to the sound emitted by the target sound source based on the spatial type of the virtual space where the receiving point is located and the spatial type of the virtual space where the target sound source is located, to obtain the target sound at the receiving point position of the target sound source, includes: In response to the spatial type of the virtual space where the receiving point is located and the spatial type of the virtual space where the target sound source is located satisfying a third condition, adding a third sound effect to the sound emitted by the target sound source to obtain the target sound; Wherein, the third sound effect includes a blocking sound effect; The third condition includes: The spatial type of the virtual space where the receiving point is located is the first spatial type, and the spatial type of the virtual space where the target sound source is located is the third spatial type; Or, the spatial type of the virtual space where the receiving point is located is the third spatial type, and the spatial type of the virtual space where the target sound source is located is the third spatial type.
7. The method according to claim 6, Characterized in that, The adding a third sound effect to the sound emitted by the target sound source to obtain the target sound includes: Generating a direct sound corresponding to the target sound source; Adding a blocking sound effect to the direct sound to obtain the target sound.
8. The method according to any one of claims 1 to 7, Characterized in that, The method further includes: Setting a volume gain for the target sound source based on the spatial type of the virtual space where the target sound source is located; Adding sound effects to the sound emitted by the target sound source based on the spatial type of the virtual space where the receiving point is located and the spatial type of the virtual space where the target sound source is located to obtain the target sound at the receiving point position, includes: Adding sound effects to the sound emitted by the target sound source based on the spatial type of the virtual space where the receiving point is located, the spatial type of the virtual space where the target sound source is located, and the volume gain of the target sound source to obtain the target sound.
9. The method according to claim 8, wherein, the volume gain includes at least one of the following gains: Gain of direct sound, gain of blocked sound, gain of reverberant sound, and gain of diffracted sound.
10. The method according to claim 9, wherein, setting the volume gain for the target sound source based on the spatial type of the virtual space where the target sound source is located includes: In response to the spatial type of the virtual space where the target sound source is located being the first spatial type, setting the volume gain of the direct sound of the target sound source to 1; In response to the spatial type of the virtual space where the target sound source is located being the second spatial type, setting the volume gain of the direct sound of the target sound source to a, where 0 < a < 1; In response to the spatial type of the virtual space where the target sound source is located being the third spatial type, setting the volume gain of the direct sound of the target sound source to b, where 0 < b < 1.
11. The method according to claim 9, wherein, setting the volume gain for the target sound source based on the spatial type of the virtual space where the target sound source is located includes: In response to the spatial type of the virtual space where the target sound source is located being the second spatial type and there being a connection opening between the virtual space where the target sound source is located and the virtual space where the receiving point is located, setting the volume gain of at least one of the reverberant sound and the diffracted sound of the target sound source.
12. The method according to claim 11, wherein, setting the volume gain of the reverberant sound of the target sound source includes: Setting the volume gain of at least one of the reverberant sound and the diffracted sound of the target sound source to a fixed value; Or, setting the volume gain of at least one of the reverberant sound and the diffracted sound of the target sound source based on the distance between the target sound source and the receiving point position.
13. The method according to claim 9, wherein, setting the volume gain for the target sound source based on the spatial type of the virtual space where the target sound source is located includes: In response to the spatial type of the virtual space where the target sound source is located being the first spatial type or the third spatial type, setting the volume gain of the blocked sound of the target sound source.
14. The method according to claim 13, wherein, setting the volume gain of the blocked sound of the target sound source includes: Obtain a blocking value between the target sound source and the receiving point position, where the blocking value is used to indicate the degree of blockage between the target sound source and the receiving point position; Based on the blocking value between the target sound source and the receiving point position, set the volume gain of the blocked sound of the target sound source.
15. A sound processing device in a virtual scene, characterized in that, the device includes: A first acquisition module, configured to acquire the closed attribute of each virtual space in the virtual scene and the receiving point position; the closed attribute is used to indicate whether the virtual space is a closed space; the receiving point position includes the position of the virtual object controlled by the target terminal in the virtual scene; A space type acquisition module, configured to, in response to the closed attribute of the target virtual space indicating that the target virtual space is a closed space and the receiving point position is within the target virtual space, acquire the space type of the target virtual space as the first space type; in response to the closed attribute of the target virtual space indicating that the target virtual space is a closed space and the receiving point position is outside the target virtual space, acquire the space type of the target virtual space as the second space type; in response to the closed attribute of the target virtual space indicating that the target virtual space is a non-closed space, acquire the space type of the target virtual space as the third space type; wherein, the target virtual space is any one of the virtual spaces; the entire scene area of the virtual scene is represented by the first space type, the second space type, and the third space type; A sound processing module, configured to add sound effects to the sound emitted by the target sound source based on the space type of the virtual space where the receiving point position is located and the space type of the virtual space where the target sound source is located, to obtain the target sound of the target sound source at the receiving point position.
16. The device according to claim 15, characterized in that, the sound processing module is configured to: In response to the space type of the virtual space where the receiving point position is located and the space type of the virtual space where the target sound source is located satisfying a first condition, add a first sound effect to the sound emitted by the target sound source to obtain the target sound; wherein, the first sound effect includes at least one of a blocking effect, a reflection effect, and a reverberation effect; The first condition includes: the space type of the virtual space where the receiving point position is located is the first space type, and the space type of the virtual space where the target sound source is located is the first space type.
17. The device according to claim 16, characterized in that, the sound processing module is configured to: Add a blocking sound effect to the direct sound to obtain a blocked sound; Add a late reverberation sound effect to the early reflection sound to obtain a reverberated sound; Obtain the target sound based on the early reflection sound, the blocked sound, and the reverberated sound.
18. The device according to claim 15, characterized in that, the sound processing module is configured to: In response to the spatial type of the virtual space where the receiving point position is located and the spatial type of the virtual space where the target sound source is located satisfying a second condition, add a second sound effect to the sound emitted by the target sound source to obtain the target sound; wherein, the second sound effect includes at least one of a transmission effect, a diffraction effect, and a reverberation effect; The second condition includes: The spatial type of the virtual space where the receiving point position is located is the first spatial type, and the spatial type of the virtual space where the target sound source is located is the second spatial type; Or, the spatial type of the virtual space where the receiving point position is located is the third spatial type, and the spatial type of the virtual space where the target sound source is located is the second spatial type.
19. The apparatus according to claim 18, characterized in that, The sound processing module is configured to: Generate a direct sound and a reverberant sound corresponding to the target sound source; Add a transmission sound effect to the direct sound and the reverberant sound to obtain a transmitted sound; Add a diffraction sound effect to the reverberant sound to obtain a diffracted sound; Obtain the target sound based on the transmitted sound and the diffracted sound.
20. The apparatus according to claim 15, characterized in that, The sound processing module is configured to: In response to the spatial type of the virtual space where the receiving point position is located and the spatial type of the virtual space where the target sound source is located satisfying a third condition, add a third sound effect to the sound emitted by the target sound source to obtain the target sound; wherein, the third sound effect includes a blocking sound effect; The third condition includes: The spatial type of the virtual space where the receiving point position is located is the first spatial type, and the spatial type of the virtual space where the target sound source is located is the third spatial type; Or, the spatial type of the virtual space where the receiving point position is located is the third spatial type, and the spatial type of the virtual space where the target sound source is located is the third spatial type.
21. The apparatus according to claim 20, characterized in that, The sound processing module is configured to: Generate a direct sound corresponding to the target sound source; Add a blocking sound effect to the direct sound to obtain the target sound.
22. The apparatus according to any one of claims 15 to 21, characterized in that, The apparatus further includes: A gain setting module for setting a volume gain for the target sound source based on the spatial type of the virtual space where the target sound source is located; The sound processing module is configured to add a sound effect to the sound emitted by the target sound source based on the spatial type of the virtual space where the receiving point position is located, the spatial type of the virtual space where the target sound source is located, and the volume gain of the target sound source to obtain the target sound.
23. The apparatus according to claim 22, characterized in that, The volume gain includes at least one of the following gains: Gain of the direct sound, gain of the blocking sound, gain of the reverberant sound, and gain of the diffracted sound.
24. The apparatus according to claim 23, characterized in that, The gain setting module is configured to: In response to the spatial type of the virtual space where the target sound source is located being the first spatial type, set the volume gain of the direct sound of the target sound source to 1; In response to the spatial type of the virtual space where the target sound source is located being the second spatial type, set the volume gain of the direct sound of the target sound source to a, where 0 < a < 1; In response to the spatial type of the virtual space where the target sound source is located being the third spatial type, set the volume gain of the direct sound of the target sound source to b, where 0 < b < 1.
25. The apparatus according to claim 23, wherein, The gain setting module is configured to: In response to the spatial type of the virtual space where the target sound source is located being the second spatial type, and there being a connection port between the virtual space where the target sound source is located and the virtual space where the receiving point position is located, set the volume gain of at least one of the reverberant sound and the diffracted sound of the target sound source.
26. The apparatus according to claim 25, wherein, The gain setting module is configured to: Set the volume gain of at least one of the reverberant sound and the diffracted sound of the target sound source to a fixed value; Or, based on the distance between the target sound source and the receiving point position, set the volume gain of at least one of the reverberant sound and the diffracted sound of the target sound source.
27. The apparatus according to claim 23, wherein, The gain setting module is configured to: In response to the spatial type of the virtual space where the target sound source is located being the first spatial type or the third spatial type, set the volume gain of the blocked sound of the target sound source.
28. The apparatus according to claim 27, wherein, The gain setting module is configured to: Obtain a blocking value between the target sound source and the receiving point position, where the blocking value is used to indicate the degree of blockage between the target sound source and the receiving point position; Based on the blocking value between the target sound source and the receiving point position, set the volume gain of the blocked sound of the target sound source.
29. A computer device, wherein, The computer device includes a processor and a memory, and at least one computer instruction is stored in the memory, and the at least one computer instruction is loaded and executed by the processor to implement the sound processing method in the virtual scenario according to any one of claims 1 to 14.
30. A computer-readable storage medium, wherein, At least one computer instruction is stored in the storage medium, and the at least one computer instruction is loaded and executed by a processor to implement the sound processing method in the virtual scenario according to any one of claims 1 to 14.
31. A computer program product, wherein, The computer program product includes computer instructions, and the computer instructions are read and executed by the processor of the computer device, so that the computer device executes the sound processing method in the virtual scenario according to any one of claims 1 to 14.
Citation Information
Patent Citations
Control of audio effects using volumetric data
US20170165576A1