Method, device and electronic device for playing audio
By obtaining the virtual character position and audio reception range in the game scene and determining the audio target playback position based on the sound effect point distribution information, the problem of cumbersome configuration of the "sound effect ball" in the prior art is solved, and a more natural and unified audio effect is achieved.
Patent Information
- Application Number
- CN202111632559.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-28
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2041-12-28
AI Technical Summary
When placing a ‘sound ball’ in a game scene, the configuration process is cumbersome and cannot fully fit into irregular terrain areas, resulting in poor audio playback effect.
By obtaining the position of the virtual character in the game scene, the audio reception range of the virtual radio is determined, and the target playback position of the audio to be played based on the distribution information of the sound effect point, and then the audio is played at the target position.
Improves the efficiency of audio configuration, ensures that the audio effects match irregular terrain areas, and improves the gaming experience of gamers.
Smart Images

Figure CN114404973B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of audio technology, and in particular to a method, device and electronic equipment for playing audio. Background Art
[0002] Audio effects have a significant impact on the gaming experience, which can enhance the player's sense of immersion and the overall gaming experience. For mobile devices, due to factors such as the size, power consumption, and performance of the mobile devices themselves, good audio effects help create a more complete and grand scene experience. Therefore, adapting the game scene to develop real and natural audio effects has gradually become an important factor affecting the player's gaming experience.
[0003] In the prior art, when configuring the sound effects of a game scene in a game engine, the configuration is done by relying on the sound effect components in the scene editor. The configuration process of the sound effect components mainly involves configuring the "sound effect ball". Specifically, the operator needs to drag the three-dimensional area where the sound effect is added to the specified position in the game scene and adjust the size of the three-dimensional area. For example, Figure 1 Schematic diagram of a "sound effect ball" according to the prior art. Figure 1 As shown, a "sound effect ball" area can contain the position of the game camera and the listener (virtual receiver).
[0004] However, the configuration method for placing the "sound effect ball" in the game scene requires adding and placing the "sound effect ball" in different areas according to the game map. Among them, the size and position of the "sound effect ball" need to be adjusted repeatedly during the placement process, and the cumbersome steps reduce the efficiency of audio production. In addition, the placement of the "sound effect ball" only supports the placement of the "sound effect ball" in regular terrain areas. When encountering irregular terrain areas (such as rivers, coastlines, caves, etc.), the "sound effect ball" cannot be made to fit the irregular terrain area completely, and the inaccurate placement position will lead to problems such as sound superposition, strong sense of fragmentation, and unnatural listening. Summary of the invention
[0005] The embodiments of the present invention provide a method, device and electronic device for playing audio, so as to at least solve the technical problem of poor audio playing effect caused by the low fit between the placed sound source and the game scene.
[0006] According to one aspect of an embodiment of the present invention, a method for playing audio is provided, comprising: obtaining a position of a virtual character in a game scene; obtaining an audio receiving range of a virtual microphone in the game scene according to the position of the virtual character, wherein the virtual microphone is bound to a specific position relatively fixed to the virtual character; determining distribution information of at least one sound effect point within the audio receiving range, wherein at least one sound effect point is pre-set in the game scene and is used to identify at least one sound source position; determining an audio to be played corresponding to the audio receiving range and a target playback position corresponding to the audio to be played based on the distribution information; and playing the audio to be played at the target playback position.
[0007] Furthermore, the method for playing audio also includes: obtaining a target position and a target orientation of the virtual character in the game scene; and determining an audio receiving range of the virtual microphone according to the target position and the target orientation.
[0008] Furthermore, the method for playing audio also includes: obtaining a geometric shape corresponding to the distribution information; determining a target playback position of the audio to be played based on the geometric shape; and synthesizing the audio corresponding to at least one sound effect point based on the geometric shape to obtain the audio to be played.
[0009] Furthermore, the method for playing audio also includes: determining a sound effect point type corresponding to at least one sound effect point; when the number of sound effect point types is multiple, determining a geometric shape composed of each type of sound effect point; and determining a target playback position corresponding to each type of sound effect point based on the geometric shape composed of each type of sound effect point.
[0010] Furthermore, the method for playing audio also includes: obtaining an audio playback range corresponding to the audio to be played; detecting whether the target position of the virtual microphone is within the audio playback range to obtain a detection result; when the detection result indicates that the target position is within the audio playback range, playing the audio to be played at the target playback position.
[0011] Furthermore, the method for playing audio also includes: when the detection result indicates that the target position is outside the audio playing range, stopping playing the audio to be played at the target playing position.
[0012] Furthermore, the method for playing audio also includes: detecting whether the target playback position is located in a preset area; if the target playback position is located in the preset area, and the virtual radio is in the preset area, playing the audio to be played at the target playback position.
[0013] Furthermore, the method for playing audio also includes: if the target playback position is located within a preset area, and the virtual radio is outside the preset area, stopping the playback of the audio to be played at the target playback position.
[0014] Furthermore, the method for playing audio also includes: before determining the distribution information of at least one sound effect point, obtaining the current number of sound effect points corresponding to at least one virtual component in the game scene and the distribution density of at least one sound effect point on at least one virtual component; setting at least one sound effect point on at least one virtual component according to the current number of sound effect points and the distribution density, and establishing an association relationship between at least one sound effect point and at least one virtual component.
[0015] Furthermore, the method for playing audio also includes: determining the maximum number of sound effect points and the maximum distribution density corresponding to the current virtual component, wherein the current virtual component is any one of the at least one virtual component; when the current number of sound effect points is greater than or equal to the maximum number of sound effect points, and / or the distribution density is greater than or equal to the maximum distribution density, setting at least one sound effect point on the current virtual component according to the maximum number of sound effect points and the maximum distribution density; when the current number of sound effect points is less than the maximum number of sound effect points, and the distribution density is less than the maximum distribution density, setting at least one sound effect point on the current virtual component according to the current number of sound effect points and the distribution density.
[0016] Furthermore, the method for playing audio also includes: when detecting that the geometric information of at least one virtual component has changed, obtaining the target geometric information after the change; adjusting the current number of sound effect points of at least one virtual component and / or the distribution density of at least one sound effect point based on the target geometric information.
[0017] According to another aspect of an embodiment of the present invention, a device for playing audio is also provided, including: an acquisition module, used to obtain an audio receiving range of a virtual object in a game scene; a first determination module, used to determine distribution information of at least one sound effect point within the audio receiving range, wherein the at least one sound effect point is used to identify at least one sound source position of the audio to be played; a second determination module, used to determine the audio to be played corresponding to the audio receiving range and the target playback position corresponding to the audio to be played based on the distribution information; and a playback module, used to play the audio to be played at the target playback position.
[0018] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned method for playing audio when running.
[0019] According to another aspect of an embodiment of the present invention, an electronic device is also provided, which includes one or more processors; a storage device for storing one or more programs, so that when the one or more programs are executed by the one or more processors, the one or more processors are implemented to run the programs, wherein the programs are configured to execute the above-mentioned method of playing audio when running.
[0020] In an embodiment of the present invention, the method of determining the audio to be played and the target playback position of the audio to be played according to the audio reception range of the virtual microphone is adopted. First, the position of the virtual character in the game scene is obtained, and then the audio reception range of the virtual microphone in the game scene is obtained according to the position of the virtual character, and the distribution information of at least one sound effect point in the audio reception range is determined, so as to determine the audio to be played corresponding to the audio reception range and the target playback position corresponding to the audio to be played based on the distribution information, and then play the audio to be played at the target playback position. Among them, the virtual microphone is bound to a specific position relatively fixed to the virtual character, and at least one sound effect point is pre-set in the game scene and is used to identify at least one sound source position.
[0021] It can be seen from the above content that in the present application, it is only necessary to determine the distribution of multiple sound effect points to determine the target playback position of the audio to be played. Since there is no need to configure the "sound effect ball" in this application, the audio effect of the game scene no longer depends on the number, placement position and placement range of the "sound effect ball", thereby avoiding the problem of cumbersome steps in the configuration process of the "sound effect ball" and improving the configuration efficiency of the audio to be played. In addition, when generating virtual sound effect points, the present application will not be affected by the terrain area. Regardless of whether the terrain area is regular, the sound effect points can be matched with the terrain area, thereby ensuring that the final generated audio effect is unified, complete, continuous, and more directional, thereby enhancing the game experience of gamers.
[0022] It can be seen that through the technical solution of the present application, the purpose of improving the audio playback effect is achieved, thereby achieving the effect of improving the configuration efficiency of the audio to be played, and further solving the technical problem of poor audio playback effect caused by the low fit between the placed sound source and the game scene. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0024] Figure 1 is a schematic diagram of a "sound effect ball" according to the prior art;
[0025] Figure 2 is a schematic diagram of a game scene according to the prior art;
[0026] Figure 3 is a schematic diagram of a method for playing audio according to the prior art;
[0027] Figure 4 is a schematic diagram of a method for playing audio according to the prior art;
[0028] Figure 5 is a schematic diagram of a method for playing audio according to the prior art;
[0029] Figure 6 is a schematic diagram of a method for playing audio according to the prior art;
[0030] Figure 7 is a flow chart of a method for playing audio according to an embodiment of the present invention;
[0031] Figure 8 is a schematic diagram of an optional method for playing audio according to an embodiment of the present invention;
[0032] Fig. 9 is a schematic diagram of an optional binding sound effect point according to an embodiment of the present invention;
[0033] Fig.10 is a schematic diagram of an optional binding sound effect point according to an embodiment of the present invention;
[0034] Fig.11 is a schematic diagram of an optional method for playing audio according to an embodiment of the present invention;
[0035] Fig.12 is a flow chart of an optional configuration of the Ambience component according to an embodiment of the present invention;
[0036] Fig.13 is a schematic diagram of an optional Ambience component setting interface according to an embodiment of the present invention;
[0037] Fig.14 is a schematic diagram of an optional Ambience component operation interface according to an embodiment of the present invention;
[0038] Fig.15 is a schematic diagram of an optional Ambience component operation interface according to an embodiment of the present invention;
[0039] Fig.16 is a schematic diagram of an optional Ambience component operation interface according to an embodiment of the present invention;
[0040] Fig.17 is a schematic diagram of an optional Ambience component operation interface according to an embodiment of the present invention;
[0041] Fig.18 is a schematic diagram of an optional Ambience component operation interface according to an embodiment of the present invention;
[0042] Fig.19is a schematic diagram of an optional Ambience component operation interface according to an embodiment of the present invention;
[0043] Fig. 20 is a schematic diagram of an optional Ambience component operation interface according to an embodiment of the present invention;
[0044] Fig.21 is a schematic diagram of an optional binding sound effect point according to an embodiment of the present invention;
[0045] Fig. 22 is a flow chart of an optional binding sound effect point according to an embodiment of the present invention;
[0046] Fig.23 It is a schematic diagram of an optional device for playing audio according to an embodiment of the present application. DETAILED DESCRIPTION
[0047] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0048] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0049] Example 1
[0050] According to an embodiment of the present invention, an embodiment of a method for playing audio is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0051] In addition, it should be noted that a sound effect synthesis system can be used as the execution subject of the audio playing method in this application.
[0052] Figure 7 is a flow chart of a method for playing audio according to an embodiment of the present invention. Figure 7 As shown, the method comprises the following steps:
[0053] Step S702, obtaining the position of the virtual character in the game scene.
[0054] In step S702, the virtual character may be a virtual character in the game. For example, after the player enters the game, he or she may select a game character in the game, and the game character may move in the game scene. The sound effect synthesis system may monitor the position of the virtual character in the game scene in real time. For example, the sound effect synthesis system may obtain the position of the virtual character in the game scene through a virtual camera, and determine the coordinates of the position of the virtual character in combination with the world coordinates in the game scene. In addition, the game character may also be a virtual model such as a virtual monster, a virtual building, a virtual vehicle, a virtual river, etc. in the game.
[0055] Step S704, the audio receiving range of the virtual microphone in the game scene is obtained according to the position of the virtual character. In step S704, the virtual microphone is bound to a specific position relatively fixed to the virtual character. The virtual microphone can be represented by a listener, wherein the listener can follow the virtual character in the game or not. The position of the virtual microphone and the position of the virtual character can be the same or different. For example, in the game, the listener can be mounted on the virtual character, so that the virtual character moves on the map in the form of the first person, and the audio receiving range of the listener is constantly changing as the virtual character moves. In addition, the listener can also enter the game as a spectator (i.e., the third person) by mounting at any point around the virtual character without following any virtual character, so that when the listener moves to any location on the map, the sound effect synthesis system can generate a corresponding audio receiving range according to the current position of the listener. In addition, the audio receiving range is the area range where the listener can receive audio, which can be a range of any shape. For example, a circular audio receiving range is generated according to a preset radius with the position of the listener as the center of the circle.
[0056] Step S706, determining distribution information of at least one sound effect point within the audio receiving range.
[0057] In step S706, at least one sound effect point is pre-set in the game scene and is used to identify at least one sound source position. Optionally, the sound effect point can be bound to the terrain in the game map, or it can be bound to a specific model. Since many environmental sound effects depend on the terrain, the sound effect synthesis system can directly bind the sound effect point to the terrain. Among them, the terrain can be a terrain with a regular shape such as a rectangular grassland, or it can be a terrain with an irregular shape such as a river or a waterfall. Furthermore, the sound effect point can also be bound to a specific model in the game scene, such as a beach, a house, etc., so that the sound effect point can have a flexible spatial position, and the sound effect point can also update its position as the specific model moves. In addition, the sound effect point (i.e., the sound source position) does not render the sound effect, that is, the sound effect point itself does not play sound.
[0058] From the above content, it can be seen that the present application can arrange sound effect points on irregular terrain areas, thereby avoiding the problem of poor audio playback effect caused by the inability of the "sound effect ball" to fully fit the irregular terrain area, and improving the overall audio playback effect in the game scene.
[0059] Step S708: determining the audio to be played corresponding to the audio receiving range and the target playback position corresponding to the audio to be played based on the distribution information.
[0060] In step S708, the sound effect synthesis system can add a sound effect point in the game scene to replace the "sound effect ball" to identify the sound location. Different from the "sound effect ball", after using the sound effect point to identify the sound location, there is only this one sound effect in the entire game scene. Figure 8 As shown, when rendering sound effects, the sound effect synthesis system can comprehensively determine the audio receiving range corresponding to the listener according to the position of the listener and the direction of the listener, and determine multiple sound effect points within the audio receiving range according to the audio receiving range. Figure 8 As shown, multiple sound effect points are distributed at various positions of the stream, and each sound effect point corresponds to its own actual hearing area. On this basis, the sound effect synthesis system can select at least one sound effect point for synthesizing the audio to be played by analyzing the distribution information of the multiple sound effect points, and determine the target playback position corresponding to the audio to be played according to the distribution position between at least one sound effect point. In addition, it should be noted that the target playback position is different from the sound source position identified by the above-mentioned sound effect point, and the target playback position can be determined by the geometric shape formed by the multiple sound source positions.
[0061] It should be noted that, unlike the "sound effect ball" approach, after using the sound effect point to mark the sound position, after the listener enters the audio receiving range, there is only one sound effect, the audio to be played, in the audio receiving range. This avoids the problem in the prior art that when the listener is in the middle of two "sound effect balls", it will hear sounds from multiple sound source points, thus achieving the effect of improving the user's gaming experience.
[0062] Step S710, playing the audio to be played at the target playback position.
[0063] In step S710, if Figure 8 As shown, after determining the target playback position to be played, the sound effect synthesis system can determine the audio playback range corresponding to the audio to be played according to the target playback position. For example, with the target playback position as the center of the circle, the audio playback range corresponding to the audio to be played is generated according to a preset playback radius. Furthermore, the sound effect synthesis system can detect the target position of the virtual object listener in real time, and determine whether the target position is within the audio playback range. When it is detected that the target position is within the audio playback range, the sound effect synthesis system can play the audio to be played at the target playback position.
[0064] Based on the contents of the above steps S702 to S710, it can be known that in an embodiment of the present invention, the method of determining the audio to be played and the target playback position of the audio to be played according to the audio reception range of the virtual microphone is adopted. First, the position of the virtual character in the game scene is obtained, and then the audio reception range of the virtual microphone in the game scene is obtained according to the position of the virtual character, and the distribution information of at least one sound effect point within the audio reception range is determined, so as to determine the audio to be played corresponding to the audio reception range and the target playback position corresponding to the audio to be played based on the distribution information, and then play the audio to be played at the target playback position. Among them, the virtual microphone is bound to a specific position relatively fixed to the virtual character, and at least one sound effect point is pre-set in the game scene and is used to identify at least one sound source position.
[0065] It can be seen from the above content that in the present application, it is only necessary to determine the distribution of multiple sound effect points to determine the target playback position of the audio to be played. Since there is no need to configure the "sound effect ball" in this application, the audio effect of the game scene no longer depends on the number, placement position and placement range of the "sound effect ball", thereby avoiding the problem of cumbersome steps in the configuration process of the "sound effect ball" and improving the configuration efficiency of the audio to be played. In addition, when generating virtual sound effect points, the present application will not be affected by the terrain area. Regardless of whether the terrain area is regular, the sound effect points can be matched with the terrain area, thereby ensuring that the final generated audio effect is unified, complete, continuous, and more directional, thereby enhancing the game experience of gamers.
[0066] It can be seen that through the technical solution of the present application, the purpose of improving the audio playback effect is achieved, thereby achieving the effect of improving the configuration efficiency of the audio to be played, and further solving the technical problem of poor audio playback effect caused by the low fit between the placed sound source and the game scene.
[0067] In an optional embodiment, after obtaining the target position and target orientation of the virtual character in the game scene, the sound effect synthesis system may determine the audio receiving range of the virtual microphone according to the target position and target orientation.
[0068] Optionally, after the virtual character enters the game scene, the sound effect synthesis system can obtain the target position and target orientation of the virtual character in real time. Since the virtual microphone is bound to a specific position relatively fixed to the virtual character, the sound effect synthesis system can generate the audio receiving range of the listener based on the target position and target orientation of the virtual character. For example, the listener can hear the sound emitted from 5 meters in front of the virtual character at the farthest, and the sound emitted from 1 meter behind the virtual character at the closest. The 5 meters and 1 meter in the example are virtual distances in the game scene.
[0069] Through the above process, when the virtual character is at different target positions and target directions, the audio receiving range corresponding to the listener is also different, thereby giving the player a more realistic audio experience and improving the player's gaming experience.
[0070] In an optional embodiment, the sound effect synthesis system can obtain the geometric shape corresponding to the distribution information, and determine the target playback position of the audio to be played based on the geometric shape, thereby synthesizing the audio corresponding to at least one sound effect point according to the geometric shape to obtain the audio to be played.
[0071] Optionally, there may be multiple sound effect points within the audio receiving range of the listener, and multiple sound effect points may form multiple geometric shapes. Among them, the geometric shape may be a regular shape such as a positive direction, a rectangle, a triangle, or other irregular shapes. Further, the sound effect synthesis system may determine the target playback position of the audio to be played based on the geometric shape formed by the multiple sound effect points. For example, if there are 4 sound effect points within the audio receiving range of the listener, and the 4 sound effect points form a square geometric shape, then based on the square, the sound effect synthesis system may determine the center position of the square as the target playback position of the audio to be played. In addition, after determining the target playback position, the sound effect synthesis system will also synthesize the audio corresponding to the multiple sound effect points according to the geometric shape to obtain the audio to be played. For example, in the above example, the 4 sound effect points correspond to audio 1, audio 2, audio 3, and audio 4, respectively. Combined with the corresponding distance information and orientation information in the geometric shape, the sound effect synthesis system synthesizes audio 1, audio 2, audio 3, and audio 4 into one audio to be played.
[0072] Through the above process, no matter where the listener is within the audio receiving range, the listener will hear the sound of the audio to be played from the target playback position, thereby avoiding the problem in the prior art that when the listener is in the middle of two "sound effect balls", it will hear sounds from multiple sound source points, thereby improving the gaming experience of gamers.
[0073] In an optional embodiment, the sound effect synthesis system may determine the sound effect point type corresponding to at least one sound effect point, and when the number of sound effect point types is multiple, determine the geometric shape composed of each type of sound effect points, thereby determining the target playback position corresponding to each type of sound effect point according to the geometric shape composed of each type of sound effect points.
[0074] Optionally, the sound effect points may correspond to different sound effect point types. For example, sound effect point 1, sound effect point 2, and sound effect point 3 may be used to synthesize the sound of leaves being blown by the wind, and sound effect point 4, speaker 5, and sound effect point 6 may be used to synthesize the sound of a river. Among them, the sound of leaves being blown by the wind and the sound of a river correspond to two different types of sound effect points. Furthermore, the sound effect synthesis system may determine the target playback position A based on the geometric shape A formed by the sound effect point 1, sound effect point 2, and sound effect point 3, and place the audio A to be played at the target playback position A, and the audio A to be played may emit the sound of leaves being blown by the wind. The sound effect synthesis system may also determine the target playback position B based on the geometric shape B formed by the sound effect point 4, speaker 5, and sound effect point 6, and place the audio B to be played at the target playback position B, and the audio B to be played may emit the sound of a river.
[0075] It should be noted that by dividing the sound effect points into different sound effect point types, different types of sounds can be played at different target playback positions, thereby avoiding the problem of cross-play between multiple types of sounds, and achieving the effect of playing multiple audios to be played in line with the actual game scene.
[0076] In an optional embodiment, after obtaining the audio playback range corresponding to the audio to be played, the sound effect synthesis system detects whether the target position of the virtual microphone is within the audio playback range to obtain a detection result. When the detection result indicates that the target position is within the audio playback range, the audio to be played is played at the target playback position.
[0077] Optionally, after the listener enters the game, the sound effect synthesis system will monitor the listener's target position in real time. When the listener enters the audio playback range of the audio to be played, the sound effect synthesis system will play the audio to be played at the target playback position, so that the listener can receive the audio to be played. In addition, the audio playback range can be a range of various shapes, for example, the audio playback range can be a range of regular shapes such as a circle, rectangle, triangle, or other irregular shapes. Among them, the target playback position can be any position within the audio playback range.
[0078] In an optional embodiment, when the detection result indicates that the target position is outside the audio playback range, the audio to be played is stopped at the target playback position.
[0079] Optionally, when the listener's target position is outside the audio playback range, the sound effect synthesis system will stop playing the audio to be played at the target playback position. For example, the listener moves with virtual character A. When virtual character A moves to position B, it is within the audio playback range of audio 1 to be played. The sound effect synthesis system will play audio 1 to be played. If virtual character 1 continues to move to position C, and position C is not within the audio playback range of audio 1 to be played, the sound effect synthesis system will stop playing audio 1 to be played.
[0080] In the above process, whether to play the audio to be played within the audio playback range is determined by the target position of the listener, which can give game players a more realistic auditory experience and avoid unnecessary occupation of audio resources, thereby achieving the effect of reducing performance consumption.
[0081] In an optional embodiment, the sound effect synthesis system will also detect whether the target playback position is within a preset area. If the target playback position is within the preset area and the virtual radio is within the preset area, the audio to be played is played at the target playback position.
[0082] Optionally, the preset area may be a restricted area. For example, in a game, the restricted area may be a house, and the target playback position may be the location of a music box in the house. When the listener enters the house, the sound effect synthesis system plays the audio to be played at the music box.
[0083] In an optional embodiment, if the target playback position is within a preset area and the virtual radio is outside the preset area, the audio to be played is stopped at the target playback position.
[0084] Optionally, still taking the restricted area as a house as an example, there is a music box in the house, and the position of the music box is the target playback position. If the listener does not walk into the house, the music synthesis system will not play the audio to be played.
[0085] It should be noted that in games such as adventure games, sound effects are an important part of the entire game. By judging whether a virtual object is in a preset area and determining whether to play the audio to be played in the preset area, game players can be given a more realistic and exciting gaming experience.
[0086] In an optional embodiment, before determining the distribution information of at least one sound effect point, the music synthesis system obtains the current number of sound effect points corresponding to at least one virtual component in the game scene and the distribution density of at least one sound effect point on at least one virtual component; at least one sound effect point is set on at least one virtual component according to the current number of sound effect points and the distribution density, and an association relationship is established between at least one sound effect point and at least one virtual component.
[0087] Optionally, the virtual component may be a terrain or a specific model in a game map. Fig. 9 As shown, in Fig. 9 In the example, since many environmental sound effects are dependent on the terrain, the sound effect points can be directly bound to the terrain. The terrain can be a regular terrain, such as a rectangular grassland. The terrain can also be an irregular terrain, such as a river, a waterfall, etc. Further, as Fig.10 As shown, the sound effect point can also be bound to a specific model in the game scene, such as a beach, a house, etc., so that the sound effect point can have a flexible spatial position, and the sound effect point can also update its position as the specific model moves.
[0088] Furthermore, different virtual components correspond to different numbers of current sound effect points and distribution densities of sound effect points. For example, fewer sound effect points may be needed on grass, and multiple sound effect points are sparsely distributed. More sound effect points may be needed in a river, and multiple sound effect points are densely distributed. According to the current number of sound effect points and distribution density corresponding to each virtual component, the sound effect synthesis system can bind the current sound effect point to the virtual component, that is, establish an association relationship between the current sound effect point and the virtual component.
[0089] From the above content, it can be seen that the present application can not only bind sound effect points on irregular terrain, but also bind sound effect points on specific models in the scene, thereby arranging sound effect points on the basis of being more in line with the game scene, thereby improving the overall audio effect in the game scene.
[0090] In an optional embodiment, the sound effect synthesis system may determine the maximum number of sound effect points and the maximum distribution density corresponding to the current virtual component, so that when the current number of sound effect points is greater than or equal to the maximum number of sound effect points, and / or the distribution density is greater than or equal to the maximum distribution density, at least one sound effect point is set on the current virtual component according to the maximum number of sound effect points and the maximum distribution density; when the current number of sound effect points is less than the maximum number of sound effect points, and the distribution density is less than the maximum distribution density, at least one sound effect point is set on the current virtual component according to the current number of sound effect points and the distribution density. The current virtual component is any one of the at least one virtual component.
[0091] Optionally, when the current number of sound effect points exceeds the maximum number of sound effect points or the distribution density exceeds the maximum distribution density, the sound effect synthesis system binds the virtual component with the maximum number of sound effect points or the maximum distribution density. For example, for virtual component A, the current number of sound effect points is 20, but the maximum number of sound effect points of virtual component A is 10, so the sound effect synthesis system will bind 10 sound effect points to virtual component A. In addition, when the current number of sound effect points does not exceed the maximum number of sound effect points or the distribution density does not exceed the maximum distribution density, the sound effect synthesis system binds the virtual component with the current number of sound effect points or the distribution density. Still taking virtual component A as an example, the current number of sound effect points is 8, and the maximum number of sound effect points of virtual component A is 10, so the sound effect synthesis system will bind 8 sound effect points to virtual component A.
[0092] It should be noted that by setting the maximum number of sound effect points and the maximum distribution density, the occupation of unnecessary and repeated sounds can be avoided, thereby achieving the effect of reducing performance consumption.
[0093] In an optional embodiment, when a change in the geometric information of at least one virtual component is detected, the sound effect synthesis system obtains the target geometric information after the change, and adjusts the current number of sound effect points of at least one virtual component and / or the distribution density of at least one sound effect point based on the target geometric information.
[0094] Optionally, in a game scene, the geometric information of a virtual component may change. For example, taking a virtual component as a poison circle, the poison circle will continue to grow according to the progress of the game, that is, the geometric information of the poison circle has changed. The sound effect synthesis system will monitor the changes of the poison circle in real time, and adjust the current number of sound effect points of the poison circle and / or the distribution density of at least one sound effect point at any time according to the changed poison circle, for example, continuously increase the number of sound effect points and improve the distribution density.
[0095] It should be noted that by detecting the change information of virtual components and adjusting the number and distribution density of sound effect points in real time, it can be ensured that game players can hear continuous and synchronized audio, which is conducive to improving the game experience of game players.
[0096] In an optional embodiment, compared with the method of configuring the "sound effect ball" in the prior art, the method of playing audio in the present application is described below by taking the sound effect synthesis system as the Messiah engine as an example. Figure 2 As shown, in the prior art, when the Listener set on the lens enters the "sound effect ball" area with the game character, the Messiah engine will play the Event added in the "sound effect ball" and register an Entity (i.e., GameObject) in the engine for it. Furthermore, the Messiah engine obtains the coordinate information of the Entity in real time, and calculates the 3D position and distance parameters between it and the Listener, so that the Messiah engine simulates the effects of 3D sound changes and sound attenuation according to the 3D position and distance parameters.
[0097] Furthermore, if Figure 3 As shown, the rendering process of the "sound effect ball" can be explained by simulating a winding stream that penetrates an entire forest. For game players, the game effect they hope to obtain is that they can hear the gurgling sound of the stream at any position near the stream; when they are close to the stream, the sound of the stream becomes obvious, and when they are far away from the stream, the sound of the stream slowly dissipates.
[0098] Optional, such as Figure 4As shown, in order to achieve the above effect, when configuring "sound effect balls" to generate the audio to be played, it is necessary to place a number of "sound effect balls" on the stream and set the 3D position parameters and attenuation parameters for these "sound effect balls". After the configuration is completed, although the sound of the stream can be heard when the listener moves to most positions in the river, there are still many problems. For example, if the number of "sound effect balls" is too large, the final rendered sound effect is more likely to have white noise with too much useless sound information, which will bring auditory burden to the player. Moreover, the introduction of too many "sound effect balls" is also a huge burden for the engine. Specifically, if there are many environmental sound effects that need to be simulated in the scene, the rendering and synthesis of a large number of voice parts will also consume a lot of resources, and the performance burden brought to the engine may be unbearable for the engine.
[0099] In addition, if Figure 5 As shown in the figure, if the listener is in the area between the two "sound effect balls", the sound from two directions will be transmitted to the listener, which will cause the player to hear the wrong problem. Figure 6 As shown, in order to solve the problem of causing auditory errors to players, the existing technology can only continue to increase the number of "sound effect balls" to allow the listener to obtain richer sounds. However, if the number of "sound effect balls" is too large, the final synthesized sound effect will be more inclined to noise, resulting in a worse audio playback effect. Moreover, since multiple "sound effect balls" are independent sound sources, when the listener moves between multiple "sound effect balls", the listener will easily hear the sounds emitted by multiple "sound effect balls" at the same time, resulting in the problem that the synchronization and continuity between the sounds cannot be guaranteed at all.
[0100] Optionally, still taking the Messiah engine as an example of the sound effect synthesis system, the present application can combine area sound sources to implement the function of simulating multiple sound sources in the same area to emit the same sound. Specifically, firstly, by writing a program, the following Wwise interface is integrated into the Messiah engine:
[0101] MultiPositionType_MultiDirections.
[0102] Among them, the Messiah engine uses the MultiPositionType_MultiDirections interface to reconstruct the surface sound source information, so that the game player can use one sound source to give the sound coming from multiple directions with realistic attenuation effect. Fig.11 As shown, in Fig.11In the example, the ambient sound from the lake can be synthesized by the sound effect points at four different positions. When the listener is at position A, the ambient sound from the lake comes from all directions. Specifically, this can be achieved by setting a suitably high dispersion value in the Messiah engine, where a high dispersion value can spread the sound so that the sound is played in all speakers.
[0103] Optionally, when the listener is located at position B, the position of the listener has exceeded the maximum attenuation distance (corresponding to the audio receiving range). At the maximum attenuation distance, the listener either cannot hear the sound of the lake or can only hear a faint sound.
[0104] Alternatively, when the listener is at position C, the listener will hear the sound of the lake from the speaker with a large opening angle, but the sound will be attenuated because there is a certain distance between the listener and the lake. It should be noted that in this case, since the listener is still within the maximum attenuation distance, the sound will not be attenuated to the maximum.
[0105] In an optional embodiment, when using the above-mentioned Wwise interface function, if the object shape (geometric shape corresponding to the corresponding distribution information) is reconstructed by overlapping multiple sound positions, each new sound effect point added requires more computing resources to calculate the target position of the audio to be played, which may increase the consumption of audio rendering. Therefore, the function of the Wwise interface can be optimized in the Messiah engine.
[0106] Specifically, the Ambience component using the Wwise interface can be added to the Messiah engine, and a configuration brush tool for sound effect points is introduced for the Ambience component. In addition, since the sound effect points are bound to specific locations in the game scene, when the final sound rendering effect is controlled by the geometric shape composed of multiple sound effect points, the computer will not carry too much extra audio information, thereby reducing the consumption of computing resources.
[0107] It should be noted that for the Messiah engine, the number and distribution density of sound effect points are not important, what is important is the geometric shape formed by multiple sound effect points. The sound effect synthesis of the Listener in the effective area ultimately depends on the geometric shape formed by multiple sound effect points. In addition, in the Messiah engine, the sound effect points are strictly aligned to the terrain grid, so the Ambience component must be bound to a terrain component.
[0108] Optionally, the following is a detailed description of the process of configuring the Ambience component in the Messiah engine. Fig.12 As shown, first create an Entity in the Messiah engine, then right-click in the Details panel, click "Add", and then "Ambience". In addition, the Details panel also shows components such as "point light", "spot light", "arealight", "sphere local environment volume", "cube local environment volume", "reflection probe", "light probe", "point cloud", "SH volume", "visibility cube", "level volume", "trap volume" and "audio".
[0109] Further, after entering the settings of the Ambience component, the Messiah engine binds a terrain component in the game scene, where Fig.13 This is the setting interface of the Ambience component. The specific instructions are as follows:
[0110] Enabled indicates whether the Ambience component is enabled. If Enabled is not, the sound effect point will not take effect in the game scene, and the sound effect point block cannot be generated;
[0111] Event Param indicates the event name, which corresponds to the event name in bnk under the Sounds directory;
[0112] Preview Color represents the preview color, which is used to preview the color of the sound effect point block in the game scene;
[0113] Review Always means always previewing, which is used to check whether the sound effect point block can still be previewed in the game scene when the component is not selected;
[0114] Preview Size indicates the preview size, which is used to preview the size of the sound effect point block;
[0115] Play In Editor means playing in the editor. If this option is not selected, the audio to be played will not be played when editing the sound effect point.
[0116] Refresh means refresh, which is used to refresh the data of the entire audio to be played;
[0117] Max Anchors indicates the maximum number of anchor points, which is used to represent the maximum number of valid anchor points (i.e. sound effect points). When the number of anchor points exceeds this value, the extra anchor points will be ignored.
[0118] Num Anchors represents the number of anchor points, which represents the number of current anchor points (i.e. the number of current sound effect points);
[0119] Clear Anchors means clearing anchors, which is used to delete all anchors, and this operation is irreversible;
[0120] Connected Terrain indicates a connected terrain, which represents the terrain where the current anchor point is effective. If there are multiple terrains in the scene, it is necessary to determine the terrain to which the audio to be played should be bound;
[0121] Select Terrain means selecting terrain, which is used to cycle through the visible terrains in the current game scene;
[0122] Restrict In Volume means limiting the area. If this option is selected, the audio to be played will only be effective in the set area (i.e. the preset area). If the Listener leaves the area, the audio to be played will stop playing. When entering the area again, the audio to be played will start playing again.
[0123] Restrict Volume Shape represents the preset area shape, which is used to set the shape of the preset area;
[0124] Max Play Times indicates the maximum number of playbacks, which is used to set the number of times the audio to be played is repeated when the listener is in the preset area, where 0 means unlimited;
[0125] Fade Out Time represents the fade-out time, which is used to set the fade-out time when the audio to be played stops playing;
[0126] Fade Out Type represents the fade-out mode, which is used to set the fade-out mode when the audio to be played stops playing.
[0127] In addition, if Fig.14 As shown, the configuration brush tool of the sound effect point in the Ambience component can be displayed in the form of a control, so that the operator can directly click to open it.
[0128] Optional, such as Fig.15As shown in the figure, when binding a sound effect point to a virtual component such as terrain, you can click the Select Terrain and Action controls in sequence, and then you can see a brush enclosed in a dotted circle in the game scene. Fig.15 In the example, the value of Max Anchors is "512", the value of Num Anchors is "0", the values of semi circle rtpc and Restrict InVolume are "x", the value of Restrict In Volume is "Sphere", and the value of semi circle rtpc update is "0.2".
[0129] Furthermore, if Fig.16 As shown in the GIZMO panel, you can change the distribution density and number of sound effect points by adjusting Radius and Alignment. After the adjustment is completed, move the mouse to the game scene interface and left-click on the terrain material to generate sound effect points on the terrain. Fig.17 As shown, if you want to eliminate the sound effect point, hold down ALT and left-click the elimination area to eliminate it.
[0130] Optional, such as Fig.18 As shown in the figure, when binding sound effect points to virtual components such as geometric bodies, the operator can first click the Add Primitive Binder and Action controls in the Messiah engine, and then the Messiah engine will display the created components in the Ambience component. Fig.18 Also shown are controls such as "restrictedvolume shape", "semi circle rtpc", "semi circle rtpc radius", "semi circle rtpcupdate", "semi circle rtpc LF" and "semi circle rtpc RF".
[0131] Furthermore, if Fig.19 as well as Fig. 20 As shown, the operator can select any specific model in the game scene and copy the name of the parent model, such as "cjc_building_niaoju_01_002". Then, the operator can paste the name into the "Entity Name" under the "Primitive Binders" directory, and the Messiah engine can generate the corresponding sound effect point on the specific model. The display effect after generation can be seen Fig.21 .
[0132] From the above content, we can see that Fig. 22 As shown, the process of the operator configuring the sound effect points on the virtual component through the environment component can be summarized as follows: first define the environment component parameters, then select the specific binding type. Specifically, the binding type can be divided into binding the sound effect points on the virtual component such as the terrain and binding the sound effect points on the virtual component such as the specific model such as the geometry. Finally, the sound effect points can be generated according to the type of the virtual component.
[0133] It should be noted that, through the above process, not only the problem of the inability to accurately configure the sound based on the virtual components in the game scene in the prior art is solved, but also the problem of the inability to set the audio to be played in batches on a large scale in the prior art is solved, thereby achieving the effect of improving the configuration efficiency of the audio to be played.
[0134] It can be seen from the above content that in the present application, it is only necessary to determine the distribution of multiple sound effect points to determine the target playback position of the audio to be played. Since there is no need to configure the "sound effect ball" in this application, the audio effect of the game scene no longer depends on the number, placement position and placement range of the "sound effect ball", thereby avoiding the problem of cumbersome steps in the configuration process of the "sound effect ball" and improving the configuration efficiency of the audio to be played. In addition, when generating virtual sound effect points, the present application will not be affected by the terrain area. Regardless of whether the terrain area is regular, the sound effect points can be matched with the terrain area, thereby ensuring that the final generated audio effect is unified, complete, continuous, and more directional, thereby enhancing the game experience of gamers.
[0135] It can be seen that through the technical solution of the present application, the purpose of improving the audio playback effect is achieved, thereby achieving the effect of improving the configuration efficiency of the audio to be played, and further solving the technical problem of poor audio playback effect caused by the low fit between the placed sound source and the game scene.
[0136] Example 2
[0137] According to another aspect of the embodiments of the present invention, a device for playing audio is provided. Fig.23 is a schematic diagram of an optional device for playing audio according to an embodiment of the present application, such as Fig.23As shown, the device may include: a first acquisition module 2301, used to obtain the position of the virtual character in the game scene; a second acquisition module 2302, used to obtain the audio receiving range of the virtual object in the game scene; a first determination module 2303, used to determine the distribution information of at least one sound effect point within the audio receiving range, wherein at least one sound effect point is used to identify at least one sound source position of the audio to be played; a second determination module 2304, used to determine the audio to be played corresponding to the audio receiving range and the target playback position corresponding to the audio to be played based on the distribution information; a playback module 2305, used to play the audio to be played at the target playback position.
[0138] It should be noted that the first acquisition module 2301 , the second acquisition module 2302 , the first determination module 2303 , the second determination module 2304 and the playing module 2305 in this embodiment correspond to steps S702 to S710 in embodiment 1 respectively.
[0139] Optionally, the second acquisition module further includes: a third acquisition module and a third determination module. The third acquisition module is used to acquire the target position and target orientation of the virtual character in the game scene; the third determination module is used to determine the audio receiving range of the virtual microphone according to the target position and target orientation.
[0140] Optionally, the second determination module further includes: a fourth acquisition module, a fourth determination module and a synthesis module. The fourth acquisition module is used to acquire the geometric shape corresponding to the distribution information; the fourth determination module is used to determine the target playback position of the audio to be played according to the geometric shape; the synthesis module is used to synthesize the audio corresponding to at least one sound effect point according to the geometric shape to obtain the audio to be played.
[0141] Optionally, the fourth determination module further includes: a fifth determination module, a sixth determination module and a seventh determination module. The fifth determination module is used to determine the sound effect point type corresponding to at least one sound effect point; the sixth determination module is used to determine the geometric shape formed by each type of sound effect point when there are multiple types of sound effect points; the seventh determination module is used to determine the target playback position corresponding to each type of sound effect point according to the geometric shape formed by each type of sound effect point.
[0142] Optionally, the playback module further includes: a sixth acquisition module, a detection module, and a first playback module. The sixth acquisition module is used to acquire the audio playback range corresponding to the audio to be played; the detection module is used to detect whether the target position of the virtual microphone is within the audio playback range to obtain a detection result; and the first playback module is used to play the audio to be played at the target playback position when the detection result indicates that the target position is within the audio playback range.
[0143] Optionally, the above-mentioned device for playing audio also includes: a stop playback module, which is used to stop playing the audio to be played at the target playback position when the detection result indicates that the target position is outside the audio playback range.
[0144] Optionally, the first playback module further includes: a first detection module and a second playback module. The first detection module is used to detect whether the target playback position is located in a preset area; the second playback module is used to play the audio to be played at the target playback position if the target playback position is located in the preset area and the virtual radio is in the preset area.
[0145] Optionally, the above-mentioned device for playing audio also includes: a first stop playing module, which is used to stop playing the audio to be played at the target playing position if the target playing position is located in a preset area and the virtual radio is outside the preset area.
[0146] Optionally, the above-mentioned device for playing audio further includes: a seventh acquisition module and a setting module. The seventh acquisition module is used to acquire the current number of sound effect points corresponding to at least one virtual component in the game scene and the distribution density of at least one sound effect point on at least one virtual component; the setting module is used to set at least one sound effect point on at least one virtual component according to the current number of sound effect points and the distribution density, and establish an association relationship between at least one sound effect point and at least one virtual component.
[0147] Optionally, the above-mentioned setting module also includes: an eighth determination module, a first setting module and a second setting module. Among them, the eighth determination module is used to determine the maximum number of sound effect points and the maximum distribution density corresponding to the current virtual component, wherein the current virtual component is any one of the at least one virtual component; the first setting module is used to set at least one sound effect point on the current virtual component according to the maximum number of sound effect points and the maximum distribution density when the current number of sound effect points is greater than or equal to the maximum number of sound effect points, and / or the distribution density is greater than or equal to the maximum distribution density; the second setting module is used to set at least one sound effect point on the current virtual component according to the current number of sound effect points and the distribution density when the current number of sound effect points is less than the maximum number of sound effect points and the distribution density is less than the maximum distribution density.
[0148] Optionally, the above-mentioned device for playing audio further includes: an eighth acquisition module and an adjustment module. The eighth acquisition module is used to acquire the target geometric information after the change when detecting that the geometric information of at least one virtual component has changed; the adjustment module is used to adjust the current number of sound effect points of at least one virtual component and / or the distribution density of at least one sound effect point based on the target geometric information.
[0149] Example 3
[0150] According to another aspect of the embodiments of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the method for playing audio in the above-mentioned embodiment 1 when running.
[0151] Example 4
[0152] According to another aspect of an embodiment of the present invention, an electronic device is also provided, which includes one or more processors; a storage device for storing one or more programs, so that when the one or more programs are executed by the one or more processors, the one or more processors are implemented to run the programs, wherein the programs are configured to execute the method for playing audio in the above-mentioned embodiment 1 when running.
[0153] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0154] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0155] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0156] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0157] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0158] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0159] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for playing audio, characterized in that: include: Get the position of the virtual character in the game scene; Acquiring an audio receiving range of a virtual microphone in the game scene according to the position of the virtual character, wherein the virtual microphone is bound to a specific fixed position relative to the virtual character; Determining distribution information of at least one sound effect point within the audio receiving range, wherein the at least one sound effect point is pre-set in the game scene and is used to identify at least one sound source position; Determine the audio to be played corresponding to the audio receiving range and the target playback position corresponding to the audio to be played based on the distribution information; Playing the audio to be played at the target playback position; Among them, determining the audio to be played corresponding to the audio receiving range and the target playback position corresponding to the audio to be played based on the distribution information includes: obtaining the geometric shape corresponding to the distribution information; determining the target playback position of the audio to be played according to the geometric shape; and synthesizing the audio corresponding to the at least one sound effect point according to the geometric shape to obtain the audio to be played.
2. The method according to claim 1, characterized in that Acquiring an audio receiving range of a virtual microphone in the game scene according to the position of the virtual character includes: Obtaining a target position and a target orientation of the virtual character in the game scene; The audio receiving range of the virtual microphone is determined according to the target position and the target direction.
3. The method according to claim 1, characterized in that Determining a target playback position of the audio to be played according to the geometric shape includes: Determining a sound effect point type corresponding to the at least one sound effect point; When there are multiple types of sound effect points, determining a geometric shape formed by each type of sound effect points; The target playback position corresponding to each type of sound effect point is determined according to the geometric shape formed by each type of sound effect point.
4. The method according to claim 1, characterized in that: Playing the audio to be played at the target playback position includes: Obtaining the audio playback range corresponding to the audio to be played; Detecting whether the target position of the virtual microphone is within the audio playback range, and obtaining a detection result; When the detection result indicates that the target position is within the audio playback range, the to-be-played audio is played at the target playback position.
5. The method according to claim 4, characterized in that The method further comprises: When the detection result indicates that the target position is outside the audio playback range, the playback of the to-be-played audio is stopped at the target playback position.
6. The method according to claim 4, characterized in that When the detection result indicates that the target position is within the audio playback range, playing the to-be-played audio at the target playback position includes: Detecting whether the target playback position is within a preset area; If the target playback position is located within the preset area, and the virtual radio is within the preset area, the audio to be played is played at the target playback position.
7. The method according to claim 6, characterized in that The method further comprises: If the target playback position is within the preset area, and the virtual radio is outside the preset area, the audio to be played is stopped at the target playback position.
8. The method according to claim 1, characterized in that Before determining the distribution information of the at least one sound effect point, the method further includes: Obtaining the current number of sound effect points corresponding to at least one virtual component in the game scene and the distribution density of the at least one sound effect point on the at least one virtual component; The at least one sound effect point is set on the at least one virtual component according to the current number of sound effect points and the distribution density, and an association relationship is established between the at least one sound effect point and the at least one virtual component.
9. The method according to claim 8, characterized in that Setting the at least one sound effect point on the at least one virtual component according to the current number of sound effect points and the distribution density includes: Determine a maximum number of sound effect points and a maximum distribution density corresponding to a current virtual component, wherein the current virtual component is any one of the at least one virtual component; When the current number of sound effect points is greater than or equal to the maximum number of sound effect points, and / or the distribution density is greater than or equal to the maximum distribution density, setting the at least one sound effect point on the current virtual component according to the maximum number of sound effect points and the maximum distribution density; When the current number of sound effect points is less than the maximum number of sound effect points and the distribution density is less than the maximum distribution density, at least one sound effect point is set on the current virtual component according to the current number of sound effect points and the distribution density.
10. The method according to claim 8, characterized in that The method further comprises: When detecting that the geometric information of the at least one virtual component changes, acquiring the changed target geometric information; The current number of sound effect points of the at least one virtual component and / or the distribution density of the at least one sound effect point are adjusted based on the target geometric information.
11. A device for playing audio, characterized in that: include: A first acquisition module is used to acquire the position of the virtual character in the game scene; A second acquisition module is used to acquire an audio receiving range of a virtual microphone in the game scene according to the position of the virtual character, wherein the virtual microphone is bound to a specific fixed position relative to the virtual character; A first determination module, configured to determine distribution information of at least one sound effect point within the audio receiving range, wherein the at least one sound effect point is pre-set in the game scene and is used to identify at least one sound source position; A second determination module is used to determine the audio to be played corresponding to the audio receiving range and a target playback position corresponding to the audio to be played based on the distribution information; A playing module, used for playing the audio to be played at the target playing position; Among them, the second determination module is also used to: obtain the geometric shape corresponding to the distribution information; determine the target playback position of the audio to be played according to the geometric shape; and synthesize the audio corresponding to the at least one sound effect point according to the geometric shape to obtain the audio to be played.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the method for playing audio as described in any one of claims 1 to 10 when running.
13. An electronic device, characterized in that: The electronic device comprises one or more processors; a storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to run the programs, wherein the programs are configured to execute the method for playing audio as described in any one of claims 1 to 10 when run.
Citation Information
Patent Citations
Sound effect playing method and device in game scene and electronic device
CN111111167A