Volume control method and device

By calculating the angle information between the sound source and the virtual camera, and combining linear and nonlinear mapping algorithms to adjust the volume, the defects of volume control in traditional 3D games are solved, the consistency between the sound source direction and visual information is achieved, and the user experience is improved.

CN120242458APending Publication Date: 2025-07-04ZHUHAI KINGSOFT ONLINE GAME TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510721381.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-30
Publication Date
2025-07-04

AI Technical Summary

Technical Problem

In traditional 3D game sound effect design, volume control relies on the physical distance between the sound source and the virtual camera, resulting in high volumes still being generated when the sound source is outside the field of view, and the direction of the sound source is not accurately positioned, there is a lack of dynamic simulation, insufficient immersion, and the sound effect is out of touch with visual information.

Method used

By obtaining the camera attribute information and sound source attribute information of the target virtual scene, calculating the angle information between the sound source and the virtual camera, adjusting the volume in combination with the sound source parameters, and using linear and nonlinear mapping algorithms to dynamically adjust the sound source volume to achieve the consistency of the sound source direction and visual information.

Benefits of technology

It improves the user's immersive experience, enhances the coordination between sound effects and visual information, and improves the user's user experience and immersion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120242458A_ABST
    Figure CN120242458A_ABST
Patent Text Reader

Abstract

The invention provides a volume control method and device.The volume control method comprises the steps that camera attribute information and at least one piece of sound source attribute information corresponding to a target virtual scene are obtained, and the sound source attribute information comprises sound source position information and sound source parameters; calculating included angle information between each sound source and a virtual camera according to the camera attribute information and the position information of each sound source; calculating initial volume information corresponding to each sound source according to the included angle information corresponding to each sound source and the sound source parameters; and synthesizing target volume information corresponding to the target virtual scene according to the initial volume information corresponding to each sound source. Through the method, the included angle information between each sound source and the virtual camera is calculated according to the camera attribute information and the sound source position information, the volume information of each sound source is adjusted through the included angle information, the function that the sound source direction is consistent with the visual information is achieved, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a volume control method, a volume control device, a computing device, a computer-readable storage medium, and a computer program product. Background Art

[0002] With the development of computer technology, the development of software has been driven, which in turn has promoted the progress of the game industry. In recent years, various games have emerged in an endless stream, and the competition in the game industry has become increasingly fierce.

[0003] In all kinds of games, the effect of game audio is a very important component. In traditional 3D game sound effect design, volume control mainly depends on the physical distance between the sound source and the virtual camera. Such a setting will have the following defects: when the sound source is outside the virtual camera, if the distance is close, it will still produce a high volume, resulting in the player being unable to accurately locate the direction of the sound source. At the same time, there is a lack of dynamic simulation of the direction of the sound source, which makes the sound effect disconnected from the visual information, and the player's user experience is poor. Therefore, a new processing method is needed to solve the above problems. Summary of the invention

[0004] In view of this, the embodiment of the present application provides a volume control method. The present application also relates to a volume control device, a computing device, a computer-readable storage medium and a computer program product to solve the above problems existing in the prior art.

[0005] According to a first aspect of an embodiment of the present application, a volume control method is provided, including: Acquire camera attribute information and at least one sound source attribute information corresponding to the target virtual scene, wherein the sound source attribute information includes sound source position information and sound source parameters; Calculate the angle information between each sound source and the virtual camera according to the camera attribute information and the position information of each sound source; Calculate the initial volume information corresponding to each sound source according to the angle information and sound source parameters corresponding to each sound source; The target volume information corresponding to the target virtual scene is synthesized according to the initial volume information corresponding to each sound source.

[0006] According to a second aspect of an embodiment of the present application, a volume control device is provided, comprising: An acquisition module is configured to acquire camera attribute information and at least one sound source attribute information corresponding to a target virtual scene, wherein the sound source attribute information includes sound source position information and sound source parameters; A first calculation module is configured to calculate the angle information between each sound source and the virtual camera according to the camera attribute information and the position information of each sound source; A second calculation module, configured to calculate initial volume information corresponding to each sound source according to the included angle information and sound source parameters corresponding to each sound source; A generation module, configured to synthesize target volume information corresponding to the target virtual scene according to the initial volume information corresponding to each sound source.

[0007] According to a third aspect of the embodiments of the present application, there is provided a computing device, including: A memory and a processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor, the steps of the above volume control method are implemented.

[0008] According to a fourth aspect of the embodiments of the present application, there is provided a computer-readable storage medium, which stores computer programs / instructions. When the computer programs / instructions are executed by a processor, the steps of the above volume control method are implemented.

[0009] According to a fifth aspect of the embodiments of the present application, there is provided a computer program product, including computer programs / instructions. When the computer programs / instructions are executed by a processor, the steps of the above volume control method are implemented.

[0010] The volume control method provided by the present application obtains camera attribute information and at least one sound source attribute information corresponding to a target virtual scene, where the sound source attribute information includes sound source position information and sound source parameters; calculates the included angle information between each sound source and the virtual camera according to the camera attribute information and each sound source position information; calculates the initial volume information corresponding to each sound source according to the included angle information and sound source parameters corresponding to each sound source; synthesizes the target volume information corresponding to the target virtual scene according to the initial volume information corresponding to each sound source.

[0011] The volume control method provided by the embodiments of the present application calculates the included angle information between each sound source and the virtual camera according to the camera attribute information and sound source position information corresponding to the target virtual scene, adjusts the volume information of each sound source through the included angle information, realizes the function of making the sound source direction consistent with the visual information, and improves the user experience. In addition, during the volume adjustment process, the sound source mapping type is referred to, and different adjustment methods are provided for different sound sources, enhancing the user's immersive experience. Description of the Drawings

[0012] Figure 1 is a flowchart of a volume control method provided by an embodiment of the present application; Figure 2 is a processing flowchart of a volume control method applied to a game scene provided by an embodiment of the present application; Figure 3It is a schematic structural diagram of a volume control device provided by an embodiment of the present application; Figure 4 It is a structural block diagram of a computing device provided by an embodiment of the present application. Detailed implementation manners

[0013] In the following description, many specific details are set forth in order to provide a thorough understanding of the present application. However, the present application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar generalizations without departing from the connotation of the present application. Therefore, the present application is not limited by the specific implementations disclosed below.

[0014] The terms used in one or more embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present application. The singular forms "a", "the", and "said" used in one or more embodiments of the present application and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in one or more embodiments of the present application refers to and includes any or all possible combinations of one or more of the associated listed items.

[0015] It should be understood that although the terms first, second, etc. may be used in one or more embodiments of the present application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present application, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "when" or "while" or "in response to determining".

[0016] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data that have been authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards in the relevant regions, and corresponding operation entrances are provided for the user to select authorization or rejection.

[0017] In traditional 3D game sound effect design, volume control mainly depends on the physical distance between the sound source and the camera, and there are the following defects: 1. Direction perception distortion: When the sound source is outside the camera's field of view, if the distance is relatively close, a high volume will still be generated, resulting in the player being unable to accurately locate the direction of the sound source; 2. Lack of immersion: There is a lack of dynamic simulation of the directionality of the sound source, and the sound effect is disconnected from the visual information; 3. Insufficient sound effect authenticity: The non-linear characteristics of the human ear's sensitivity to direction are not fully considered.

[0018] Based on this, in the present application, a volume control method is provided. The present application also relates to a volume control device, a computing device, a computer-readable storage medium, and a computer program product, which will be described in detail one by one in the following embodiments.

[0019] Figure 1 The flowchart of a volume control method according to an embodiment of the present application is shown, which specifically includes the following steps: Step 102: Obtain the camera attribute information corresponding to the target virtual scene and at least one sound source attribute information, where the sound source attribute information includes sound source position information and sound source parameters.

[0020] Among them, the target virtual scene can be understood as a scene generated according to a virtual engine, such as a game scene, a virtual animation, etc. The target virtual scene is usually simulated and generated by a virtual camera, that is, the target virtual scene is generated from the perspective of the virtual camera. Therefore, after determining the target virtual scene, the camera attribute information corresponding to the target virtual scene can be obtained. Here, the camera attribute information can be understood as the camera attribute information of the virtual camera. The camera attribute information may include attribute information related to the virtual camera generating the target virtual scene.

[0021] The sound source attribute information can be understood as the attribute information corresponding to the sound source that can generate sound in the target virtual scene. There may be multiple sound sources in the target virtual scene, and each sound source corresponds to sound source attribute information. In the method provided in the embodiment of the present application, the sound source attribute information may include sound source position information, sound source parameters, etc. Among them, the sound source position information can be understood as the position of the sound source in the target virtual scene. The sound source parameters may include sound source volume information, sound source mapping type, etc. The sound source volume information can be understood as the size of the sound emitted by the sound source. The sound source mapping type can be understood as the volume adjustment function of the sound source in the target virtual scene.

[0022] In practical applications, different sound sources correspond to different sound source mapping types. For example, for some background sound effects (such as the sound of wind and rain), sudden sound effects (such as explosions), or for low-configured terminals, linear mapping can be used. Linear mapping is simple to calculate and only requires one angle division operation, which can respond quickly. For some complex sound effects (such as VR games), direction-sensitive sound effects (such as footsteps, NPC conversations, etc.), non-linear mapping can be used to simulate the sensitivity attenuation of the human ear to lateral sound sources by adjusting the attenuation rate and the intermediate threshold.

[0023] In the method provided in the embodiments of the present application, during the process of adjusting the volume in the virtual scene, camera attribute information corresponding to the target virtual scene and at least one sound source attribute information are obtained, which are used for subsequent processing according to the sound source attribute information and the camera attribute information.

[0024] In a specific embodiment provided by the present application, obtaining the camera attribute information corresponding to the target virtual scene and at least one sound source attribute information includes S1022 - S1024: S1022. Obtain the camera attribute information corresponding to the target virtual scene, and determine the camera visible area according to the camera attribute information.

[0025] In practical applications, there may be multiple sound sources in the target virtual scene. Due to the angle problem of the virtual camera, not all sound sources in the target virtual scene will have an impact. For example, if a sound source is far from the virtual camera, the sound of this sound source is small and will not affect the overall sound effect. Another example is that if a sound source is behind the virtual camera, its impact on the overall sound effect is also small.

[0026] Based on this, first obtain the camera attribute information corresponding to the target virtual scene, and determine the camera visible area according to the camera attribute information. In practical applications, the target virtual scene is in a large three-dimensional space and is determined according to the shooting angle of the virtual camera. The camera visible area can be determined according to the camera attribute information. The camera visible area can be understood as the area where the distance from the virtual camera is less than the preset screening distance.

[0027] It should be noted that in practical applications, since the sound emitted by the sound source is propagative, even if the sound source is not within the field of view of the virtual camera, the sound it emits will still be collected by the virtual camera. Therefore, the camera visible area provided in the embodiments of the present application does not refer to the field of view of the virtual camera, but refers to the range where the distance to the virtual camera is less than the preset distance. For example, the range within 10 meters from the virtual camera is the camera visible area.

[0028] Among them, determining the camera visible area according to the camera attribute information includes: Obtain the scene partition corresponding to the virtual world; Determine the camera visible area according to the camera attribute information and the scene partition.

[0029] In practical applications, in order to manage the virtual scene, the virtual world can be divided. For example, a two-dimensional space can be partitioned using a quadtree, or a three-dimensional space can be partitioned using an octree to obtain the scene partition corresponding to the virtual world.

[0030] A quadtree is a tree - like data structure used for the organization and management of data in a two - dimensional space. Its basic idea is to recursively divide the two - dimensional space into four sub - regions (nodes), and each node can have at most four child nodes. An octree is also a tree - like data structure used for the organization and management of data in a three - dimensional space. Its basic idea is to recursively divide the three - dimensional space into eight cubic regions (nodes), and each node has at most eight child nodes. Octrees are mainly used for three - dimensional space processing, data storage, and query, etc.

[0031] Recursively divide the virtual world to which the target virtual scene belongs to obtain scene partitions, and store the sound sources to which each node in the scene partition belongs.

[0032] After determining the scene partitions, the camera visible area can be further determined based on the camera attribute information and the scene partitions. By delimiting the camera visible area through the scene partitions, it is possible to avoid calculating all the sound sources in the virtual world, reduce the amount of calculation data, and improve the calculation and processing efficiency.

[0033] S1024: Determine at least one target sound source according to the camera visible area, and obtain the sound source attribute information corresponding to each target sound source.

[0034] After determining the camera visible area, at least one target sound source can be determined within the camera visible area, and at the same time, the sound source attribute information corresponding to each target sound source is obtained. The target sound source can be understood as the sound source within the visible area.

[0035] In a specific embodiment provided by the present application, the scene partition includes at least one node; Determining at least one target sound source according to the camera visible area includes: Determine the sound source stored in the target node in the camera visible area as the target sound source.

[0036] As determined in the above steps, after partitioning the virtual scene, there will be multiple nodes, and corresponding sound sources will be stored in each node. Through the camera visible area, the target nodes can be determined among the multiple nodes, and then the sound source stored in the target node is determined as the target sound source.

[0037] In practical applications, the method provided by the embodiments of the present application can also set the update frequency of the volume according to the distance from each sound source to the virtual camera. Specifically, in another specific embodiment provided by the present application, it further includes: Obtain the sound source distance from each target sound source to the virtual camera; Determine the update frequency of each target sound source in the target virtual scene according to each sound source distance.

[0038] In this embodiment, if the distance from the sound source to the virtual camera is relatively close and the resulting sound impact is relatively large, the update frequency of its sound can be set relatively high, such as updating once per frame; if the distance from the sound source to the virtual camera is relatively far and the resulting sound impact is relatively small, the update frequency of its sound can be set relatively low, such as updating once every 5 frames. By determining the update frequency of each sound source according to the distance from the sound source to the virtual camera in this embodiment, the hardware resources of the device can be fully utilized and the calculation efficiency can be improved.

[0039] Step 104: Calculate the included angle information between each sound source and the virtual camera according to the camera attribute information and each sound source position information.

[0040] After obtaining the camera attribute information and the sound source position information, the included angle information between each sound source and the virtual camera can be further calculated. Among them, the included angle information can be understood as the included angle between the sound source and the orientation of the virtual camera.

[0041] In the method provided in the embodiments of the present application, the sound source exists in the virtual scene, and the included angle between the sound source and the virtual camera is an important factor affecting the sound volume of the sound source. In this embodiment, in order to better reflect the positional relationship between each sound source and the virtual camera, the included angle information between the sound source and the virtual camera needs to be calculated according to the camera attribute information and the sound source position information.

[0042] In a specific embodiment provided by the present application, the camera attribute information includes virtual camera position information and camera orientation information; Calculating the included angle information between each sound source and the virtual camera according to the camera attribute information and each sound source position information includes: Calculating the included angle information between each sound source and the virtual camera according to the virtual camera position information, the camera orientation information and each sound source position information.

[0043] Specifically, the camera attribute information specifically includes virtual camera position information and camera orientation information. Among them, the virtual camera position information can be understood as the coordinate information of the virtual camera in the virtual world, and the camera orientation information can be understood as the orientation information of the virtual camera in the virtual world. Further, the camera orientation information can specifically be understood as the orientation vector of the virtual camera in the virtual world.

[0044] In this embodiment, the included angle information between the sound source and the virtual camera is calculated according to the virtual camera position information, the camera orientation information and the sound source position information. Specifically, refer to the following formula 1: Formula 1 Wherein, A is the sound source position information, C is the virtual camera position information, and B is the camera orientation information. The included angle information. Through the above formula 1, the included angle information between the sound source and the virtual camera can be calculated.

[0045] Step 106: Calculate the initial volume information corresponding to each sound source according to the included angle information and sound source parameters corresponding to each sound source.

[0046] After determining the included angle information corresponding to each sound source, combined with the sound source parameters of each sound source, calculate the initial volume information corresponding to each sound source respectively. Among them, the initial volume information can be understood as the volume information of the sound produced by each sound source in the current state.

[0047] In the method provided in the embodiments of the present application, calculate the included angle information between the sound source and the virtual camera, and dynamically adjust the volume information of each sound according to the included angle information.

[0048] Specifically, in a specific implementation manner provided in the present application, the sound source parameters include sound source volume information and sound source mapping type; Calculating the initial volume information corresponding to each sound source according to the included angle information and sound source parameters corresponding to each sound source includes: Calculate the initial volume information corresponding to each sound source according to the included angle information, sound source volume information and sound source mapping type corresponding to each sound source.

[0049] In practical applications, the sound source parameters include sound source volume, sound source mapping type, etc. In this implementation manner, after obtaining the included angle information, further calculate the initial volume information corresponding to each sound source according to the sound source parameters, that is, according to the sound source volume information, sound source mapping type, etc. corresponding to each sound source.

[0050] Furthermore, the sound source mapping type includes linear mapping and non-linear mapping; Calculating the initial volume information corresponding to each sound source according to the included angle information, sound source volume information and sound source mapping type corresponding to each sound source includes: When it is determined that the sound source mapping type corresponding to the sound source to be processed is non-linear mapping, obtain the non-linear mapping parameters, and calculate the initial volume information corresponding to the sound source to be processed according to the non-linear mapping parameters, included angle information and sound source volume information; When it is determined that the sound source mapping type corresponding to the sound source to be processed is linear mapping, obtain the linear mapping rule, and calculate the initial volume information corresponding to the sound source to be processed according to the linear mapping rule, included angle information and sound source volume information.

[0051] In practical applications, different sound sources correspond to different sound source mapping types. The sound source mapping type of the sound source can be set in advance by the user, or can be configured according to the type of the sound source. In the present application, the specific setting method of the sound source mapping type is not limited.

[0052] Specifically, the sound source mapping types include linear mapping and non-linear mapping. The linear mapping and non-linear mapping correspond to different volume adjustment functions, and the initial volume information corresponding to each sound source is calculated through different volume adjustment functions. In this embodiment, the sound source to be processed can be determined from each sound source. Among them, the sound source to be processed can be any one of the sound sources. Taking the sound source to be processed as an example, different sound source mapping types will be explained.

[0053] If the sound source mapping type corresponding to the sound source to be processed is non-linear mapping, its corresponding non-linear mapping parameters can be obtained. The non-linear mapping parameters can be understood as the parameters of the volume adjustment function corresponding to the non-linear mapping. For example, the volume adjustment parameters corresponding to the non-linear mapping are shown in Formula 2 below: Formula 2 Where k and m are non-linear mapping parameters; k is the attenuation rate; m is the intermediate threshold (such as 90°), and e is a constant in mathematics, an infinite non-recurring decimal; is the included angle information. Through the above Formula 2, the initial volume information corresponding to the sound source to be processed in the case of non-linear mapping of the sound source to be processed can be calculated. In the volume adjustment function corresponding to the non-linear mapping, the sensitivity attenuation of the human ear to the lateral sound source can be simulated. In practical applications, the non-linear mapping parameters can be pre-set by developers, or a UI adjustment interface can be provided for players to receive adjustment instructions for the non-linear mapping parameters from players. Such processing can not only ensure the normal gaming experience of ordinary players, but also provide personalized settings for users who are sensitive to sound and have hands-on ability, meeting the gaming experience needs of different players and enhancing the user's usage experience.

[0054] If the sound source mapping type corresponding to the sound source to be processed is linear mapping, the volume information can be directly calculated according to its corresponding volume adjustment function. Specifically, see Formula 3 below: Formula 3 Where, is the included angle information. In the volume adjustment function corresponding to the linear mapping, the calculation is simple, and only angle division operation is required to quickly respond to sudden sound effects.

[0055] In practical applications, if the device performance of the terminal device cannot reach better computing resources, the non-linear mapping can also be adjusted to linear mapping to reduce the computing overhead. Specifically, in a specific embodiment provided in this application, the method further includes: Detecting the device load information of the device; In the case where the device load information is greater than the preset load threshold, determining the sound source to be processed with the sound source mapping type of non-linear mapping as the sound source to be adjusted; Adjust the sound source mapping type of the sound source to be adjusted to linear mapping.

[0056] In this embodiment, it is possible to implement the detection of the device load information of the terminal device. In practical applications, when the device calculates various information, it mainly uses the central processing unit of the device (i.e., the CPU). Therefore, when the CPU information load of the device is relatively high, the calculation efficiency of the device will decrease. Therefore, in a specific embodiment provided in this application, the device load information of the device can be understood as the CPU load of the terminal device. When the CPU load is greater than the preset load threshold, it indicates that the load of the terminal is relatively heavy at this time. In order to maintain the adjustment of the sound, the sound source with non-linear mapping can be switched to linear mapping, thereby reducing the calculation overhead, maintaining the rendering of the virtual scene, and ensuring the user experience.

[0057] During the switching process, the sound source to be processed with a non-linear mapping type of the sound source mapping can be first determined as the sound source to be adjusted, and then the sound source mapping type corresponding to the sound source to be adjusted is adjusted to linear mapping.

[0058] Determining the sound source to be processed that needs to be adjusted as the sound source to be adjusted can more accurately record the sound source whose sound source mapping type has changed, which is convenient for subsequent processing. When the device load information is lower than the preset load threshold, the sound source whose sound source mapping type has been switched can be changed back to non-linear mapping.

[0059] In practical applications, developers can also set different sound source mapping types for the sound source to cope with different terminal devices. In addition, mixing the two mapping types in the same scene can also balance the device performance and the sound effect quality, and bring a better sound effect experience to users while making full use of the performance of the terminal device.

[0060] In another specific embodiment provided in this application, the method further includes: When the device load information is less than the preset load threshold, adjust the sound source mapping type of the sound source to be adjusted from linear mapping to non-linear mapping.

[0061] In this embodiment, the device load information of the device is detected in real time. If the device load information is less than the preset load threshold, the sound source to be adjusted whose sound source mapping type has been switched can be switched back from linear mapping to non-linear mapping.

[0062] In the solution provided by the embodiments of the present application, the included angle information between the virtual camera and each sound source can be calculated in real time, and then the initial volume information corresponding to each sound source can be calculated according to the included angle information corresponding to each sound source and the sound source mapping type. Thus, it is updated in real time in each frame corresponding to the target virtual scene. The user experience is improved. Considering that the hardware performances of different devices are different, the update frequency can also be set for each sound source according to the distance between each sound source and the virtual camera. For example, the update frequency of the sound source closer to the virtual camera is updated per frame, and the update frequency of the sound source farther from the virtual camera is updated every five frames, etc. Thus, different terminal devices are adapted to provide a better user experience for users using various devices.

[0063] Step 108: Synthesize the target volume information corresponding to the target virtual scene according to the initial volume information corresponding to each sound source.

[0064] In the method provided by the embodiments of the present application, after calculating the initial volume information of each sound source, the audio API (Application Programming Interface) can be further called to fuse the initial volume information of each sound source, so as to generate the target volume information corresponding to the target virtual scene.

[0065] In practical applications, calculating the included angle information between the sound source and the virtual camera, and calculating the initial volume information of each sound source according to the included angle information of each sound source will be processed in their respective independent threads, and the results will be transmitted through a double-buffer mechanism to avoid the situation where the main thread is blocked due to the blockage of a certain thread, and to ensure the normal rendering of the target virtual scene.

[0066] The volume control method provided by the embodiments of the present application calculates the included angle information between each sound source and the virtual camera according to the camera attribute information and the sound source position information corresponding to the target virtual scene, adjusts the volume information of each sound source through the included angle information, realizes the function of making the sound source direction consistent with the visual information, and improves the user experience. In addition, during the volume adjustment process, the sound source mapping type is referred to, and different adjustment methods are provided for different sound sources, enhancing the user's immersive experience.

[0067] Secondly, in the process of determining the sound source, a spatial partitioning algorithm is adopted, which can avoid unnecessary calculations. When processing data, an asynchronous calculation method is adopted to ensure the efficient processing of data. Thus, it is ensured that the target virtual scene can be updated at a high frame rate.

[0068] See Figure 2 , Figure 2 shows the processing flow chart of the volume control method applied to the game scene provided by an embodiment of the present application. As Figure 2 shown, the method includes the following steps: Step 202: Obtain the camera attribute information of the forest environment in the game scene, as well as the bird chirping sound source and the water flow sound source.

[0069] Among them, the bird chirping sound source is in the tree crown on the left side of the virtual camera, and its sound source mapping type is non-linear mapping. For the non-linear mapping layer eucalyptus, k = 0.1 and m = 90°. The water flow sound source is the stream on the right side of the virtual camera, and its sound source mapping type is linear mapping.

[0070] Step 204: Calculate the first included angle information corresponding to the bird chirping sound source and the second included angle information corresponding to the water flow sound source according to the coordinates of the virtual camera, the coordinates of the bird chirping sound source, and the coordinates of the water flow sound source in the game scene.

[0071] Among them, in this method, the included angle between the detection camera and each sound source will be implemented and updated in real time for each game screen frame.

[0072] Step 206: Calculate the initial volume information corresponding to each sound source according to the included angle information, the sound source volume information, and the sound source mapping type corresponding to each sound source.

[0073] Among them, when the virtual camera rotates to the right and turns away from the bird chirping and faces the stream, the volume of the bird chirping decays according to the volume adjustment function corresponding to the non-linear mapping, and the volume of the stream increases according to the volume adjustment function corresponding to the linear mapping.

[0074] When the virtual camera rotates to the left, faces the bird chirping, and turns away from the stream, the volume of the bird chirping increases according to the volume adjustment function corresponding to the linear mapping, while the volume of the stream decays according to the volume adjustment function corresponding to the linear mapping.

[0075] Step 208: Detect the CPU load information of the terminal. When the CPU load information exceeds 80%, switch the sound source mapping type corresponding to the bird chirping sound source to linear mapping.

[0076] Step 210: When the CPU load information is less than 80% and maintains a preset duration, switch the sound source mapping type corresponding to the bird chirping sound source back to non-linear mapping.

[0077] Step 212: Integrate the initial volume information of each sound source in the forest environment of the game scene to obtain the target volume information, and call the audio API to set and output according to the target volume information.

[0078] The volume control method provided by the embodiments of the present application calculates the included angle information between each sound source and the virtual camera according to the camera attribute information and the sound source position information corresponding to the game scene, and adjusts the volume information of each sound source through the included angle information, realizing the function of making the sound source direction consistent with the visual information and improving the user experience. In addition, during the volume adjustment process, the sound source mapping type is referred to, and different adjustment methods are provided for different sound sources, enhancing the user's immersive experience.

[0079] Corresponding to the above method embodiment, the present application also provides an embodiment of a volume control device. Figure 3 The structural schematic diagram of a volume control device provided by an embodiment of the present application is shown. As Figure 3 shown, the device includes: An acquisition module 302, configured to acquire the camera attribute information corresponding to the target virtual scene and at least one sound source attribute information, where the sound source attribute information includes the sound source position information and the sound source parameters; A first calculation module 304, configured to calculate the included angle information between each sound source and the virtual camera according to the camera attribute information and each sound source position information; A second calculation module 306, configured to calculate the initial volume information corresponding to each sound source according to the included angle information corresponding to each sound source and the sound source parameters; A generation module 308, configured to synthesize the target volume information corresponding to the target virtual scene according to the initial volume information corresponding to each sound source.

[0080] Optionally, the camera attribute information includes virtual camera position information and camera orientation information; The first calculation module 304 is further configured to: Calculate the included angle information between each sound source and the virtual camera according to the virtual camera position information, the camera orientation information and each sound source position information.

[0081] Optionally, the acquisition module 302 is further configured to: Acquire the camera attribute information corresponding to the target virtual scene, and determine the camera visible area according to the camera attribute information; Determine at least one target sound source according to the camera visible area, and acquire the sound source attribute information corresponding to each target sound source.

[0082] Optionally, the acquisition module 302 is further configured to: Acquire the scene partition corresponding to the virtual world; Determine the camera visible area according to the camera attribute information and the scene partition.

[0083] Optionally, the scene partition includes at least one node; The obtaining module 302 is further configured to: Determine the sound source stored in the target node in the visible area of the camera as the target sound source.

[0084] Optionally, the obtaining module 302 is further configured to: Obtain the sound source distances from each target sound source to the virtual camera; Determine the update frequencies of the respective target sound sources in the target virtual scene according to the respective sound source distances.

[0085] Optionally, the sound source parameters include sound source volume information and sound source mapping type; The second calculation module 306 is further configured to: Calculate the initial volume information corresponding to each sound source according to the included angle information, sound source volume information, and sound source mapping type corresponding to each sound source.

[0086] Optionally, the sound source mapping type includes linear mapping and non - linear mapping; The second calculation module 306 is further configured to: When it is determined that the sound source mapping type corresponding to the sound source to be processed is non - linear mapping, obtain the non - linear mapping parameters, and calculate the initial volume information corresponding to the sound source to be processed according to the non - linear mapping parameters, included angle information, and sound source volume information; When it is determined that the sound source mapping type corresponding to the sound source to be processed is linear mapping, obtain the linear mapping rule, and calculate the initial volume information corresponding to the sound source to be processed according to the linear mapping rule, included angle information, and sound source volume information.

[0087] Optionally, the second calculation module 306 is further configured to: Detect the device load information of the device; When the device load information is greater than the preset load threshold, determine the sound source to be processed with a non - linear mapping type as the sound source to be adjusted; Adjust the sound source mapping type of the sound source to be adjusted to linear mapping.

[0088] Optionally, the second calculation module 306 is further configured to: When the device load information is less than the preset load threshold, adjust the sound source mapping type of the sound source to be adjusted from linear mapping to non - linear mapping.

[0089] The volume control device provided by the embodiment of the present application calculates the included angle information between each sound source and the virtual camera according to the camera attribute information and the sound source position information corresponding to the target virtual scene, and adjusts the volume information of each sound source through the included angle information, so as to realize the function that the sound source direction is consistent with the visual information, and improves the user experience. In addition, during the volume adjustment process, the sound source mapping type is referred to, and different adjustment methods are provided for different sound sources, enhancing the user's immersive experience.

[0090] Secondly, during the process of determining the sound source, a spatial partitioning algorithm is adopted, which can avoid unnecessary calculations. When performing data processing, an asynchronous calculation method is adopted to ensure the efficient processing of data. Thus, it is ensured that the target virtual scene can maintain a high frame rate update.

[0091] The above is a schematic solution of a volume control device according to this embodiment. It should be noted that the technical solution of this volume control device and the technical solution of the above volume control method belong to the same concept. For the details not described in the technical solution of the volume control device, reference can be made to the description of the technical solution of the above volume control method.

[0092] Figure 4 FIG. shows a structural block diagram of a computing device 400 according to an embodiment of the present application. The components of the computing device 400 include, but are not limited to, a memory 410 and a processor 420. The processor 420 is connected to the memory 410 through a bus 430, and a database 450 is used to store data.

[0093] The computing device 400 also includes an access device 440, which enables the computing device 400 to communicate via one or more networks 460. Examples of such networks include the Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or a combination of communication networks such as the Internet. The access device 440 may include one or more of any type of wired or wireless network interface (e.g., a network interface card (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so on.

[0094] In one embodiment of the present application, the above components of the computing device 400 and Figure 4 other components not shown may also be connected to each other, for example, via a bus. It should be understood that Figure 4 the block diagram of the computing device shown is for illustrative purposes only and is not a limitation on the scope of the present application. Those skilled in the art may add or replace other components as needed.

[0095] The computing device 400 can be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smartphone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a Personal Computer (PC). The computing device 400 can also be a mobile or stationary server.

[0096] Wherein, the processor 420 is used to execute the following computer program / instructions, and when the computer program / instructions are executed by the processor, the steps of the above volume control method are implemented.

[0097] The above is a schematic solution of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the above volume control method belong to the same concept. For the details not described in detail in the technical solution of the computing device, reference can be made to the description of the technical solution of the above volume control method.

[0098] An embodiment of this specification also provides a computer-readable storage medium storing computer programs / instructions, which when executed by a processor implement the steps of the above volume control method.

[0099] The above is a schematic solution of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium and the technical solution of the above volume control method belong to the same concept. For the details not described in detail in the technical solution of the storage medium, reference can be made to the description of the technical solution of the above volume control method.

[0100] An embodiment of this specification also provides a computer program product including computer programs / instructions, which when executed by a processor implement the steps of the above volume control method.

[0101] The above is a schematic solution of a computer program product according to this embodiment. It should be noted that the technical solution of this computer program product and the technical solution of the above volume control method belong to the same concept. For the details not described in detail in the technical solution of the computer program product, reference can be made to the description of the technical solution of the above volume control method.

[0102] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be executed in a different order than in the embodiments and still achieve the desired result. Additionally, the processes depicted in the figures do not necessarily require the specific order or sequential order shown to achieve the desired result. In certain implementations, multitasking and parallel processing are also possible or may be advantageous.

[0103] The computer instructions include computer program code, which may be in the form of source code, object code, executable files, or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, removable hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals.

[0104] It should be noted that for the foregoing method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present application is not limited by the described action sequence, because according to the present application, some steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily all essential to the present application.

[0105] In the above embodiments, the descriptions of the respective embodiments have their own focuses. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0106] The preferred embodiments of the present application disclosed above are only used to help explain the present application. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and changes can be made according to the content of the present application. The present application selects and specifically describes these embodiments to better explain the principle and practical application of the present application, so that those skilled in the art can understand and utilize the present application well. The present application is only limited by the claims and their full scope and equivalents.

Claims

1. A volume control method, characterized in that, including: Obtaining camera attribute information and at least one sound source attribute information corresponding to a target virtual scene, where the sound source attribute information includes sound source position information and sound source parameters; Calculating the included angle information between each sound source and the virtual camera according to the camera attribute information and each sound source position information; Calculating the initial volume information corresponding to each sound source according to the included angle information corresponding to each sound source and the sound source parameters; Synthesizing the target volume information corresponding to the target virtual scene according to the initial volume information corresponding to each sound source.

2. The method according to claim 1, wherein The camera attribute information includes virtual camera position information and camera orientation information; Calculating the included angle information between each sound source and the virtual camera according to the camera attribute information and each sound source position information includes: Calculating the included angle information between each sound source and the virtual camera according to the virtual camera position information, the camera orientation information and each sound source position information.

3. The method according to claim 1, characterized in that, Obtaining camera attribute information and at least one sound source attribute information corresponding to a target virtual scene includes: Obtaining camera attribute information corresponding to a target virtual scene, and determining a camera visible area according to the camera attribute information; Determining at least one target sound source according to the camera visible area, and obtaining the sound source attribute information corresponding to each target sound source.

4. The method according to claim 3, wherein Determining the camera visible area according to the camera attribute information includes: Obtaining a scene partition corresponding to the virtual world; Determining the camera visible area according to the camera attribute information and the scene partition.

5. The method according to claim 3, wherein The scene partition includes at least one node; Determining at least one target sound source according to the camera visible area includes: Determining the sound source stored in the target node in the camera visible area as the target sound source.

6. The method according to claim 4, wherein It also includes: Obtaining the sound source distance from each target sound source to the virtual camera; Determining the update frequency of each target sound source in the target virtual scene according to each sound source distance.

7. The method according to claim 1, characterized in that, The sound source parameters include sound source volume information and sound source mapping type; Calculating the initial volume information corresponding to each sound source according to the included angle information corresponding to each sound source and the sound source parameters includes: Calculating the initial volume information corresponding to each sound source according to the included angle information corresponding to each sound source, the sound source volume information and the sound source mapping type.

8. The method according to claim 7, wherein The sound source mapping type includes linear mapping and non-linear mapping; Calculating the initial volume information corresponding to each sound source according to the included angle information corresponding to each sound source, the sound source volume information and the sound source mapping type includes: When it is determined that the sound source mapping type corresponding to the sound source to be processed is non-linear mapping, obtaining non-linear mapping parameters, and calculating the initial volume information corresponding to the sound source to be processed according to the non-linear mapping parameters, the included angle information and the sound source volume information; When it is determined that the sound source mapping type corresponding to the sound source to be processed is linear mapping, obtaining a linear mapping rule, and calculating the initial volume information corresponding to the sound source to be processed according to the linear mapping rule, the included angle information and the sound source volume information.

9. The method according to claim 8, wherein The method also includes: Detecting the device load information of the device; When the device load information is greater than a preset load threshold, determining the sound source to be processed with a non-linear mapping type as the sound source to be adjusted; Adjusting the sound source mapping type of the sound source to be adjusted to linear mapping.

10. The method according to claim 9, characterized in that The method also includes: When the device load information is less than the preset load threshold, adjust the sound source mapping type of the sound source to be adjusted from linear mapping to non-linear mapping.

11. A volume control device, characterized in that, It includes: An acquisition module, configured to acquire camera attribute information corresponding to a target virtual scene and at least one sound source attribute information, where the sound source attribute information includes sound source position information and sound source parameters; A first calculation module, configured to calculate the included angle information between each sound source and the virtual camera according to the camera attribute information and each sound source position information; A second calculation module, configured to calculate the initial volume information corresponding to each sound source according to the included angle information and sound source parameters corresponding to each sound source; A generation module, configured to synthesize the target volume information corresponding to the target virtual scene according to the initial volume information corresponding to each sound source.

12. A computing device, characterized in that, It includes: A memory and a processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor, the steps of the method described in any one of claims 1-10 are implemented.

13. A computer-readable storage medium storing computer programs / instructions, characterized in that, When the computer programs / instructions are executed by the processor, the steps of the method described in any one of claims 1-10 are implemented.

14. A computer program product, comprising a computer program / instructions, characterized in that, When the computer programs / instructions are executed by the processor, the steps of the method described in any one of claims 1-10 are implemented.