Audio playback method, device, electronic device and storage medium

By dynamically determining the audio playback position and orientation, the problem of lack of linear or surface sound effects in the game is solved, and the game's immersion and audio expressiveness are improved.

CN113941151BActive Publication Date: 2025-08-08NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111124491.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-24
Publication Date
2025-08-08
Estimated Expiration
2041-09-24

AI Technical Summary

Technical Problem

In the prior art, the sound effect performance of linear or surface-shaped sound generators in the game is missing, resulting in poor audio playback effect.

Method used

By obtaining the current area range and position of the target virtual object in the game scene, dynamically determine the playback position and orientation of the audio, real-time update of the audio is achieved.

Benefits of technology

It improves the immersion and audio expression of the game, avoids the lack of sound effects, and provides a rich sound effect experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113941151B_ABST
    Figure CN113941151B_ABST
Patent Text Reader

Abstract

The present invention discloses an audio playback method, device, electronic device, and storage medium. The method comprises: obtaining the current area of a target virtual object in a game scene and the first position of a target virtual character in the game scene, wherein the target virtual object is changed and adjusted according to game progress information; determining a target playback position and a target playback direction of the audio to be played based on the current area and the first position; and playing the audio to be played at the target playback position along the target playback direction. The present invention solves the technical problem in the prior art of poor audio playback due to a lack of sound effects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of audio technology, and in particular to an audio playing method, device, electronic device and storage medium. Background Art

[0002] With the development of gaming technology, players have higher and higher requirements for gaming experience. In games, many players not only require the game to have a good visual experience, but also require a high-quality auditory experience.

[0003] However, in existing technologies, most in-game sound effects are based on point-like sound sources, making it impossible to reproduce the sound effects of linear or planar sound sources such as river surfaces, coastlines, poison circles, and walls of fire. Furthermore, while some game engines have the ability to set polygonal sound ranges, this function is still based on the principle of static sound sources. A sound source can move along a static line or surface, but when the line or surface on which the sound source resides is in motion, the sound source cannot move with the moving line or surface. Therefore, in existing technologies, adding continuous sound effects to linear or planar sound sources is often abandoned, resulting in a lack of audio effects and poor audio playback in some games.

[0004] To address the above-mentioned problems, no effective solutions have been proposed so far.

[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute prior art known to ordinary technicians in the field. Summary of the Invention

[0006] Embodiments of the present invention provide an audio playback method, device, electronic device, and storage medium to at least solve the technical problem in the prior art of poor audio playback quality due to lack of sound effect performance.

[0007] According to one aspect of an embodiment of the present invention, a method for playing audio is provided, comprising: obtaining a current area range of a target virtual object in a game scene and a first position of a target virtual character in the game scene, wherein the target virtual object is changed and adjusted according to game progress information; determining a target playback position and a target playback direction of the audio to be played based on the current area range and the first position; and playing the audio to be played at the target playback position along the target playback direction.

[0008] Furthermore, the above-mentioned audio playback method also includes: determining a target point from a preset range determined by the target virtual object based on the current area range and the first position, wherein the target point is a coordinate point on the target virtual object that satisfies a preset relationship with the first position; determining the position of the target point as the target playback position, and determining the direction of the target playback position pointing to the first position as the target playback direction.

[0009] Furthermore, the above audio playing method further includes: determining a coordinate point closest to the first position in the current area as a target point.

[0010] Furthermore, the above-mentioned audio playback method also includes: determining a preset straight line based on the reference position of the target virtual object and the first position; obtaining at least one intersection point between the preset straight line and the target virtual object; and determining the intersection point closest to the first position from at least one intersection point as the target point.

[0011] Furthermore, the above-mentioned audio playback method also includes: adjusting the audio playback information of the audio to be played at the target playback position according to the relative position between the target virtual object and the target virtual character and / or the game progress information; playing the audio to be played along the target playback direction according to the audio playback information.

[0012] Furthermore, the above-mentioned audio playback method also includes: when the game progress information represents that the target virtual object is in a first state, adjusting the first audio playback information of the audio to be played to the second audio playback information, wherein the first audio playback information or the second audio playback information includes at least the width of the sound field space and the phase change amplitude of the sound field, and the first state represents that the target virtual object is in a stable state; when the game progress information represents that the target virtual object is in a second state, adjusting the second audio playback information of the audio to be played to the first audio playback information, wherein the second state represents that the target virtual object is in a zoom state, and the zoom state represents that the target virtual object is enlarged or reduced at intervals of a preset duration.

[0013] Furthermore, the above-mentioned audio playback method also includes: determining the relative position trend between the target virtual object and the target virtual character based on the target virtual object and the target virtual character, wherein the relative position trend represents the changing trend of the relative position between the target virtual object and the target virtual character; and adjusting the audio playback information of the audio to be played according to the relative position trend.

[0014] Furthermore, the above-mentioned audio playback method also includes: determining whether the target virtual character is within a preset range corresponding to the target virtual object based on the relative position between the target virtual object and the target virtual character; when the target virtual character is within the preset range, adjusting the first audio playback information of the audio to be played to the second audio playback information; when the target virtual character is outside the preset range, adjusting the second audio playback information of the audio to be played to the first audio playback information, filtering out the preset frequency band in the first audio playback information, and obtaining the target audio, wherein the first audio playback information or the second audio playback information includes at least the width of the sound field space and the phase change amplitude of the sound field.

[0015] According to another aspect of an embodiment of the present invention, an audio playback device is also provided, including: an acquisition module, used to obtain the current area range of the target virtual object in the game scene and the first position of the target virtual character in the game scene, wherein the target virtual object changes and adjusts according to the game progress information; a determination module, used to determine the target playback position and target playback direction of the audio to be played based on the current area range and the first position; and a playback module, used to play the audio to be played at the target playback position along the target playback direction.

[0016] 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. The computer program is configured to execute the above-mentioned audio playing method when running.

[0017] According to another aspect of an embodiment of the present invention, an electronic device is also provided, characterized in that the electronic device includes one or more processors; a storage device for storing one or more programs, which, when the one or more programs are 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 above-mentioned audio playback method when running.

[0018] In an embodiment of the present invention, a method is adopted in which a target playback position and a target playback direction of the audio to be played are determined based on the current area range and the first position, by obtaining the current area range of the target virtual object in the game scene and the first position of the target virtual character in the game scene, wherein the target virtual object is changed and adjusted according to the game progress information; the target playback position and the target playback direction of the audio to be played are determined based on the current area range and the first position, and the audio to be played is played at the target playback position along the target playback direction.

[0019] From the above content, it can be seen that since the present application can determine the target playback position and target playback direction of the audio to be played based on the current area range and the first position, the audio to be played does not need to be hung on a fixed target virtual object or coordinate positioning. When the target virtual character moves, or the current area range of the target virtual object changes, the target playback position and target playback direction of the audio to be played can be updated in real time, thereby achieving the purpose of avoiding the lack of audio sound effects in the game, and solving the problem of poor playback effect of game audio due to the lack of audio sound effects in the game in the prior art. Furthermore, different sound effect performances can be provided to players according to the changes in the target virtual object and the position of the target virtual character, thereby achieving the technical effect of enhancing the immersion and expressiveness of the game. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] 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:

[0021] Figure 1 is a flowchart of an optional audio playing method according to an embodiment of the present invention;

[0022] Figure 2 is a schematic diagram of an optional audio playback method according to an embodiment of the present invention;

[0023] Figure 3 is a schematic diagram of an optional audio playback method according to an embodiment of the present invention;

[0024] Figure 4 2 is a schematic diagram of an optional audio playback device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0025] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions 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 embodiments described 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 making creative efforts should fall within the scope of protection of the present invention.

[0026] It should be noted that the terms "first", "second", etc. in the description 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 numbers 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 clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0027] In addition, it should be noted that the server can serve as the execution entity of the audio playback method in the embodiment of the present invention, wherein the server includes but is not limited to a cloud server and a physical server.

[0028] 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.

[0029] Figure 1 is a flow chart of an optional audio playing method according to an embodiment of the present invention, such as Figure 1 As shown, the method includes the following steps:

[0030] Step S102: Acquire the current area range of the target virtual object in the game scene and the first position of the target virtual character in the game scene.

[0031] Optionally, the target virtual object can be a virtual model in the game, such as a river surface, riverbank, or cloud layer, or a special effect file such as a poison circle or fire circle. The target virtual object can be a virtual object visible to the player or invisible to the player. The target virtual character can be a game character controlled by the player. In addition, the target virtual object can change based on game progress information, where game progress information includes but is not limited to information such as game duration and the number of surviving virtual characters. For example, as game time increases, the volume, length, or area of the target virtual object will shrink or expand.

[0032] Furthermore, when the player enters the game, at a specific time, the server refreshes the target virtual object. At the same time, the server obtains virtual object information such as the refresh point and radius of the target virtual object in the game, thereby establishing a coordinate system based on the obtained virtual object information, and determining the current area range of the target virtual object and the first position of the target virtual character. The current area range of the target virtual object can be the coverage range of the target virtual object, for example, the model area or volume covered by virtual models such as rivers and clouds, or it can be the circled range of the target virtual object, for example, the range circled by special effects files such as fire circles and poison circles. In addition, the current area range can also be a length range of virtual models such as river banks.

[0033] In the above process, the server can obtain the current area range of the target virtual object and the first position of the target virtual character, thereby achieving the effect of real-time monitoring of the movement of the target virtual character and the changes in the current area range of the target virtual object.

[0034] Step S104 : determining a target playback position and a target playback direction of the audio to be played according to the current area range and the first position.

[0035] Optionally, the target playback position may be set not only at the edge of the current region of the target virtual object, but also inside or outside the current region of the target virtual object. For example, Figure 2 and Figure 3 The target virtual objects in are all poison circles, and the audio position to be played is the sound point of the poison circle. Figure 2 The sound point of the poison circle is set on the poison circle, and Figure 3 The sound point of the poison circle is set inside the poison circle.

[0036] Furthermore, after determining the target playback position of the audio to be played, the target playback direction of the audio to be played must also be determined. This target playback direction can simulate the auditory experience of a real-life sound-producing object such as a speaker, which differs from the front and back of the speaker. For example, setting the target playback direction facing the target avatar can give the player a louder auditory experience, while setting the target playback direction facing away from the target avatar can give the player a lower auditory experience. The server can adjust the target playback direction in real time to provide an auditory experience that is closer to reality.

[0037] In the above process, the target playback position and target playback direction of the audio to be played can be updated as the target virtual character moves and the current area range of the target virtual object changes, thereby achieving the purpose of generating a movable sound source in the game according to the current area range and the first position, and providing players with different sound effect performances. By setting different target playback directions, players can be given a richer sound effect experience.

[0038] Step S106: Play the audio to be played at the target playback position along the target playback direction.

[0039] Optionally, after determining the target playback position and target playback direction of the audio to be played, the server can generate a sound effect hanging node for the audio to be played at the target playback position, and can enhance the spatial width and phase change amplitude of the sound effect by adjusting the three-dimensional surround parameters and spatial reverberation parameters of the sound effect, thereby creating the illusion that the entire target virtual object is making sound at the same time.

[0040] Furthermore, the server can adjust the playback effect of the audio to be played by reading the game progress information and the relative position information between the target virtual character and the target virtual object. For example, when the poison circle is in a stable state, the audio playback is weaker, giving the player a lower sense of threat; when the poison circle begins to shrink, the volume of the audio becomes louder, and threatening factors such as the sense of electric current are strengthened, giving the player an increased sense of oppression; and when the poison circle shrinks, if the player's corresponding target virtual character approaches the poison circle, as the distance between the target virtual character and the poison circle gets closer and closer, the rhythm of the audio playback will become faster and faster. If the player's corresponding target virtual character falls outside the poison circle, the rhythm of the audio playback will be further accelerated.

[0041] In the above process, since the target playback position and target playback direction are movable and changeable, when the audio to be played is played, it can create a feeling for the player that the entire target virtual object is making sound, thereby greatly improving the expressiveness and immersiveness of the game.

[0042] Based on the contents of steps S102 to S106, it can be seen that in an embodiment of the present invention, a method of determining the target playback position and target playback direction of the audio to be played based on the current area range and the first position is adopted, by obtaining the current area range of the target virtual object in the game scene and the first position of the target virtual character in the game scene, wherein the target virtual object is changed and adjusted according to the game progress information; the target playback position and target playback direction of the audio to be played are determined based on the current area range and the first position, and the audio to be played is played at the target playback position along the target playback direction.

[0043] It is easy to notice that, since the present application can determine the target playback position and target playback direction of the audio to be played based on the current area range and the first position, the audio to be played does not need to be attached to a fixed target virtual object or coordinate positioning. When the target virtual character moves, or the current area range of the target virtual object changes, the target playback position and target playback direction of the audio to be played can be updated in real time, thereby achieving the purpose of avoiding the lack of audio sound effects in the game, and solving the problem of poor playback effect of game audio due to the lack of audio sound effects in the game in the prior art. Furthermore, different sound effect performances can be provided to players according to the changes in the target virtual object and the position of the target virtual character, thereby achieving the technical effect of enhancing the immersion and expressiveness of the game.

[0044] In an optional embodiment, the server determines a target point from a preset range determined by the target virtual object based on the current area range and the first position, wherein the target point is a coordinate point on the target virtual object that satisfies a preset relationship with the first position; determines the position of the target point as the target playback position, and determines the direction of the target playback position pointing to the first position as the target playback direction.

[0045] Optionally, the preset range determined by the target virtual object may be a range determined by a graphic of the target virtual object mapped onto a two-dimensional plane, that is, a range determined by a top view, for example. Figure 2 As shown, the target virtual object is a poison circle in a shooting game. The poison circle is mapped to a two-dimensional plane. From the top view, it can be determined that the poison circle is a circle on the two-dimensional plane. The range defined by this circle is the preset range. It should be noted that the preset range is not limited to circles and can also be rectangles, triangles, and irregular polygons.

[0046] Furthermore, the server may determine the target point by establishing a preset relationship between the target virtual object and the first position, for example, Figure 2 As shown, when the target virtual object is a poison circle, the server obtains the reference position of the poison circle according to the preset relationship (i.e. Figure 2 The center position of the circle in the figure) and the first position of the target virtual character are connected, and the second position of the poison circle and the first position of the target virtual character are connected to obtain a preset straight line. The intersection of the preset straight line and the poison circle is the target point.

[0047] Further, after determining the position of the target point as the target playback position, the server uses the direction of the target playback position pointing to the position of the target virtual character as the target playback direction, for example, Figure 2 As shown, since the target virtual character is directly above the sound point of the poison circle, the server can set the target playback direction of the audio to be played at the sound point of the poison circle to be directly above.

[0048] In addition, the position of the target point can be refreshed in real time, thereby ensuring that when the target virtual character and the poison circle move, the target playback position and target playback direction of the audio to be played can also be updated in real time.

[0049] Through the above process, the server can update the target playback position and target playback direction of the audio to be played in real time, thereby providing players with different sound effect performance effects.

[0050] In an optional embodiment, the server may determine, based on the current area range, a coordinate point that is closest to the first position as the target point.

[0051] Optional, such as Figure 2 As shown, when the target virtual object is a poison circle, the server can obtain the reference position of the poison circle (i.e. Figure 2 The center position of the poison circle and the first position of the target virtual character are connected to obtain a preset straight line, wherein the intersection of the preset straight line and the poison circle is the coordinate point closest to the target virtual character in the current area, and this coordinate point can be set as the target point.

[0052] Furthermore, the target point may also be a coordinate point at a position corresponding to a preset distance value from the target virtual object, for example, Figure 3 As shown, the target point can be a coordinate point on a preset straight line with the same distance from the center of the poison circle as the target virtual character. Alternatively, the target point can also be a coordinate point on a preset straight line outside the current area.

[0053] In an optional embodiment, the server may determine a preset straight line based on the reference position of the target virtual object and the first position, and obtain at least one intersection point between the preset straight line and the target virtual object, and then determine the intersection point closest to the first position from the at least one intersection point as the target point.

[0054] Optionally, the reference position of the target virtual object may be the center position of the target virtual object. For example, if the target virtual object is a circular poison circle, the reference position may be the center position of the poison circle. If the target virtual object is a spherical virtual building, the reference position may be the center position of the virtual building. Figure 3As shown, when the target virtual object is a circular poison circle, the server connects the center of the poison circle with the first position to form a preset straight line. There may be multiple intersections between the preset straight line and the poison circle. The server can determine the intersection closest to the target virtual character from the multiple intersections as the target point. If there are multiple target virtual characters in the game, and they are distributed in different locations, the server can determine multiple preset straight lines based on the locations of the multiple target virtual characters and the second position, and generate multiple corresponding target points, so that each target virtual character has a corresponding target point closest to it.

[0055] In the above process, by establishing a preset straight line and forming an intersection with the preset range, and then obtaining the target point, the effect of quickly and accurately determining the target playback position of the audio to be played is achieved.

[0056] In an optional embodiment, the server adjusts the audio playback information of the audio to be played at the target playback position according to the relative position between the target virtual object and the target virtual character and / or the game progress information, and plays the audio to be played along the target playback direction according to the audio playback information.

[0057] Optionally, the relative position between the target virtual object and the target virtual character can represent the relative distance between the target virtual character and the target virtual object. The game progress information can be information representing the progress of the game, such as the length of the game, the number of surviving virtual characters in the game, etc. The audio playback information can be information such as the volume, pitch, rhythm speed, width of the sound field space, and phase change amplitude of the sound field.

[0058] Furthermore, the server can adjust the audio playback information of the audio to be played by reading the game progress information and the relative position information between the target virtual character and the target virtual object. For example, when the poison circle is in a stable state, the volume of the audio playback is small and the expressiveness is weak, which can give the player a lower sense of threat; when the poison circle begins to shrink, the volume of the audio playback becomes larger, and the threatening factors such as the sense of electric current are strengthened, giving the player an increased sense of oppression; and when the poison circle shrinks, if the target virtual character corresponding to the player approaches the poison circle, as the distance between the target virtual character and the poison circle gets closer and closer, the rhythm of the audio playback will become faster and faster. If the target virtual character corresponding to the player falls outside the poison circle, the music will further switch to a very fast rhythm.

[0059] In the above process, since the target playback position and target playback direction are movable and changeable, when the audio to be played is played, it can create a feeling for the player that the entire target virtual object is making sound, thereby greatly improving the expressiveness and immersiveness of the game.

[0060] In an optional embodiment, when the game progress information indicates that the target virtual object is in a first state, the server adjusts the first audio playback information of the audio to be played to the second audio playback information, wherein the first audio playback information or the second audio playback information includes at least the width of the sound field space and the phase change amplitude of the sound field, and the first state indicates that the target virtual object is in a stable state; and when the game progress information indicates that the target virtual object is in a second state, the server adjusts the second audio playback information of the audio to be played to the first audio playback information, wherein the second state indicates that the target virtual object is in a zoom state, and the zoom state indicates that the target virtual object is enlarged or reduced at intervals of a preset duration.

[0061] Optionally, after determining the target playback position and target playback direction of the audio to be played, the server can generate a sound effect hanging node for the audio to be played at the target playback position, and can change the width of the sound field space of the sound effect and the phase change amplitude of the sound field and other audio playback information by adjusting the three-dimensional surround parameters and spatial reverberation parameters of the audio, thereby creating the illusion that the entire target virtual object is making sound at the same time.

[0062] Optionally, the server may determine the state of the target virtual object based on the read game progress information. For example, when the target virtual object is a poison circle in a shooting game, the poison circle may have a stable state and a zoom state. The stable state is characterized by the poison circle not changing at this time and maintaining a stable state, while the zoom state is characterized by the poison circle starting to shrink at this time and being in a changing state.

[0063] Furthermore, the server will adjust the audio information of the audio to be played according to the state of the target virtual object. For example, when the poison circle is in a stable state, the audio information of the audio to be played is adjusted to the second audio playback information with a smaller volume and weaker expressiveness, which can give the player a lower sense of threat; when the poison circle is in a zoomed state, the audio information of the audio to be played is adjusted to the first audio playback information with a larger volume, which can give the player a sense of increased oppression.

[0064] In the above process, the audio information of the audio to be played is adjusted according to the state of the target virtual object, so that the player can be more easily brought into the game rhythm and the player's gaming experience is improved.

[0065] In an optional embodiment, the server determines the relative position trend between the target virtual object and the target virtual character based on the target virtual object and the target virtual character, wherein the relative position trend represents the changing trend of the relative position between the target virtual object and the target virtual character, and adjusts the audio playback information of the audio to be played based on the relative position trend.

[0066] Among them, the relative position trend between the target virtual object and the target virtual character can be judged by the relative distance between the target virtual object and the target virtual character. For example, when the relative distance between the target virtual character and the target virtual object becomes smaller and smaller, it means that the relative position trend between the target virtual character and the target virtual object is a trend of getting closer and closer, and when the relative distance between the target virtual character and the target virtual object becomes larger and larger, it means that the relative position trend between the target virtual character and the target virtual object is a trend of getting farther and farther away.

[0067] Optional, such as Figure 2 As shown, if the target virtual character corresponding to the player is getting closer and closer to the poison circle, the relative distance between the poison circle and the target virtual character will become smaller and smaller, indicating that the target virtual character is getting closer and closer to the poison circle. At this time, in order to remind the player of the danger, the audio playback information of the audio to be played can be adjusted, for example, the rhythm of the audio playback can be accelerated, and the volume of the audio playback can be increased to remind the player that he is approaching the poison circle.

[0068] In the above process, the audio playback information of the audio to be played is adjusted according to the relative position trend. By adjusting the audio playback information, the player can be warned of danger, create a game atmosphere, and improve the player's gaming experience.

[0069] In an optional embodiment, the server determines whether the target virtual character is within a preset range corresponding to the target virtual object based on the relative position between the target virtual object and the target virtual character, thereby adjusting the first audio playback information of the audio to be played to the second audio playback information when the target virtual character is within the preset range, and adjusting the second audio playback information of the audio to be played to the first audio playback information when the target virtual character is outside the preset range, filtering out the preset frequency band in the first audio playback information, and obtaining the target audio, wherein the first audio playback information or the second audio playback information includes at least the width of the sound field space and the phase change amplitude of the sound field.

[0070] Among them, the preset frequency band can be set according to the frequency. For example, the frequency band with a frequency above 7kHz is set as the preset frequency band, so that the audio playback information with a frequency band above 7kHz in the second audio playback information can be filtered out to obtain the target audio.

[0071] Optionally, the server can determine whether the target virtual character is within a preset range corresponding to the target virtual object based on the relative position between the target virtual object and the target virtual character. For example, when the target virtual object is a poison circle in a shooting game, if the target virtual character corresponding to the player is in an area outside the poison circle, the audio information of the audio to be played is adjusted to the first audio playback information, for example, the tempo of the audio playback is accelerated and the volume of the audio playback is increased to prompt the player that they are in a dangerous state. At the same time, the server can also filter out the preset frequency band in the first audio playback information through a filter to obtain the target audio. After filtering, the target audio can leave a sound field space in the target audio, creating an auditory experience of partially obstructed audio. When the target virtual character returns to the poison circle, the server adjusts the first audio playback information of the audio to be played to the second audio playback information. Compared with the first audio playback information, the second audio playback information has a slower tempo and lower volume, which can give the player a less threatening feeling.

[0072] In the above process, the audio playback information of the audio to be played is adjusted according to whether the target virtual character is within the preset range, so as to adjust the game atmosphere and achieve the effect of improving the player's game immersion.

[0073] From the above content, it can be seen that since the present application can determine the target playback position and target playback direction of the audio to be played based on the current area range and the first position, the audio to be played does not need to be hung on a fixed target virtual object or coordinate positioning. When the target virtual character moves, or the current area range of the target virtual object changes, the target playback position and target playback direction of the audio to be played can be updated in real time, thereby achieving the purpose of avoiding the lack of audio sound effects in the game, and solving the problem of poor playback effect of game audio due to the lack of audio sound effects in the game in the prior art. Furthermore, different sound effect performances can be provided to players according to the changes in the target virtual object and the position of the target virtual character, thereby achieving the technical effect of enhancing the immersion and expressiveness of the game.

[0074] According to an embodiment of the present invention, an embodiment of an audio playback device is also provided. The device can execute the audio playback method of the embodiment, wherein: Figure 4 FIG. 1 is a structural diagram of an audio playback device according to an embodiment of the present invention. Figure 4 As shown, the device includes: an acquisition module 401, a determination module 403 and a playback module 405.

[0075] Among them, the acquisition module 401 is used to obtain the current area range of the target virtual object in the game scene and the first position of the target virtual character in the game scene, wherein the target virtual object changes and adjusts according to the game progress information; the determination module 403 is used to determine the target playback position and target playback direction of the audio to be played based on the current area range and the first position; the playback module 405 is used to play the audio to be played at the target playback position along the target playback direction.

[0076] In addition, it should be noted that the above-mentioned acquisition module 401, determination module 403 and playback module 405 correspond to steps S102 to S106 in the embodiment. The examples and application scenarios implemented by the three modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned embodiment.

[0077] In an optional embodiment, the determination module includes: a first determination module and a second determination module. The first determination module is configured to determine a target point within a preset range determined by the target virtual object based on the current area range and the first position, wherein the target point is a coordinate point on the target virtual object that satisfies a preset relationship with the first position; and the second determination module is configured to determine the position of the target point as the target playback position, and determine the direction of the target playback position toward the first position as the target playback direction.

[0078] In an optional embodiment, the first determining module includes: a third determining module, configured to determine, in the current area range, a coordinate point that is closest to the first position as the target point.

[0079] In an optional embodiment, the third determination module includes: a fourth determination module, a first acquisition module, and a fifth determination module. The fourth determination module is configured to determine a preset straight line based on the reference position and the first position of the target virtual object; the first acquisition module is configured to obtain at least one intersection point between the preset straight line and the target virtual object; and the fifth determination module is configured to determine, from the at least one intersection point, the intersection point closest to the first position as the target point.

[0080] In an optional embodiment, the playback module includes: a first adjustment module and a first playback module. The first adjustment module is configured to adjust audio playback information of the audio to be played at a target playback position based on the relative position between the target virtual object and the target virtual character and / or game progress information; and the first playback module is configured to play the audio to be played along the target playback direction according to the audio playback information.

[0081] In an optional embodiment, the first adjustment module includes: a second adjustment module and a third adjustment module. The second adjustment module is used to adjust the first audio playback information of the audio to be played to the second audio playback information when the game progress information indicates that the target virtual object is in the first state, wherein the first audio playback information or the second audio playback information at least includes the width of the sound field space and the phase change amplitude of the sound field, and the first state indicates that the target virtual object is in a stable state; the third adjustment module is used to adjust the second audio playback information of the audio to be played to the first audio playback information when the game progress information indicates that the target virtual object is in the second state, wherein the second state indicates that the target virtual object is in a zoom state, and the zoom state indicates that the target virtual object is enlarged or reduced at intervals of a preset duration.

[0082] In an optional embodiment, the first adjustment module includes: a sixth determination module and a fourth adjustment module. The sixth determination module is configured to determine a relative position trend between the target virtual object and the target virtual character based on the target virtual object and the target virtual character, wherein the relative position trend represents a trend of change in the relative position between the target virtual object and the target virtual character; and the fourth adjustment module is configured to adjust audio playback information of the audio to be played based on the relative position trend.

[0083] In an optional embodiment, the first adjustment module includes: a seventh determination module, a fifth adjustment module, and a sixth adjustment module. The seventh determination module is used to determine whether the target virtual character is within a preset range corresponding to the target virtual object based on the relative position between the target virtual object and the target virtual character; the fifth adjustment module is used to adjust the first audio playback information of the audio to be played to the second audio playback information when the target virtual character is within the preset range; the sixth adjustment module is used to adjust the second audio playback information of the audio to be played to the first audio playback information when the target virtual character is outside the preset range, filter out the preset frequency band in the first audio playback information, and obtain the target audio, wherein the first audio playback information or the second audio playback information at least includes the width of the sound field space and the phase change amplitude of the sound field.

[0084] 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. The computer program is configured to execute the above-mentioned audio playing method when running.

[0085] According to another aspect of an embodiment of the present invention, an electronic device is also provided, characterized in that the electronic device includes one or more processors; a storage device for storing one or more programs, which, when the one or more programs are 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 above-mentioned audio playback method when running.

[0086] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.

[0087] In the above embodiments of the present invention, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0088] 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 exemplary. For example, the division of units can be a logical function division. In actual implementation, there may be other division methods, such as 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.

[0089] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected to achieve the purpose of the present embodiment according to actual needs.

[0090] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0091] 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, 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. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the methods of 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, etc. Various media that can store program codes.

[0092] The above are only preferred embodiments 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 principles 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: Obtaining a current area range of a target virtual object in a game scene and a first position of a target virtual character in the game scene, wherein the target virtual object is changed and adjusted according to game progress information; Determining a target playback position and a target playback direction of the audio to be played based on the current area range and the first position; determining a relative position trend between the target virtual object and the target virtual character according to the target virtual object and the target virtual character, wherein the relative position trend represents a change trend of the relative position between the target virtual object and the target virtual character; adjusting the audio playback information of the audio to be played at the target playback position according to the relative position trend; Play the audio to be played along the target playback direction according to the audio playback information; Among them, the target playback position and target playback direction of the audio to be played are determined according to the current area range and the first position, including: connecting the reference position of the target virtual object and the first position to obtain a preset straight line, wherein the reference position is the center position of the target virtual object; determining a coordinate point located on the preset straight line with the same distance value from the reference position and the target virtual character as the target point; determining the position of the target point as the target playback position, and determining the direction of the target playback position pointing to the first position as the target playback direction.

2. The method according to claim 1, characterized in that The method further comprises: Adjusting audio playback information of the audio to be played at the target playback position according to the game progress information; The audio to be played is played along the target playback direction according to the audio playback information.

3. The method according to claim 2, characterized in that Adjusting audio playback information of the to-be-played audio at the target playback position according to the game progress information includes: When the game progress information indicates that the target virtual object is in a first state, adjusting the first audio playback information of the audio to be played to second audio playback information, wherein the first audio playback information or the second audio playback information includes at least a width of a sound field space and a phase change amplitude of the sound field, and the first state indicates that the target virtual object is in a stable state; When the game progress information indicates that the target virtual object is in a second state, the second audio playback information of the audio to be played is adjusted to the first audio playback information, wherein the second state indicates that the target virtual object is in a zoom state, and the zoom state indicates that the target virtual object is enlarged or reduced at intervals of a preset duration.

4. The method according to claim 1, wherein Adjusting audio playback information of the to-be-played audio at the target playback position according to the relative position between the target virtual object and the target virtual character includes: determining whether the target virtual character is within a preset range corresponding to the target virtual object according to the relative position between the target virtual object and the target virtual character; When the target virtual character is within the preset range, adjusting the first audio playback information of the audio to be played to the second audio playback information; When the target virtual character is outside the preset range, the second audio playback information of the audio to be played is adjusted to the first audio playback information, and the preset frequency band in the first audio playback information is filtered out to obtain the target audio, wherein the first audio playback information or the second audio playback information includes at least the width of the sound field space and the phase change amplitude of the sound field.

5. An audio playback device, characterized in that: include: an acquisition module, configured to acquire a current area of a target virtual object in a game scene and a first position of a target virtual character in the game scene, wherein the target virtual object is changed and adjusted according to game progress information; a determination module, configured to determine a target playback position and a target playback direction of the audio to be played based on the current area range and the first position; The determining module is further configured to: determine a relative position trend between the target virtual object and the target virtual character based on the target virtual object and the target virtual character, wherein the relative position trend represents a trend of change in the relative position between the target virtual object and the target virtual character; and adjust audio playback information of the audio to be played at the target playback position based on the relative position trend; A playback module is used to play the audio to be played along the target playback direction according to the audio playback information; wherein the determination module is also used to: connect the reference position of the target virtual object and the first position to obtain a preset straight line, wherein the reference position is the center position of the target virtual object; determine the coordinate point on the preset straight line with the same distance value from the reference position and the target virtual character as the target point; determine the position of the target point as the target playback position, and determine the direction of the target playback position pointing to the first position as the target playback direction.

6. 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 audio playing method according to any one of claims 1 to 4 when running.

7. An electronic device, characterized in that: The electronic device includes 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 audio playback method described in any one of claims 1 to 4 when run.

Citation Information

Patent Citations

  • Audio playing control method and device in game scenes

    CN108355356A

  • Sound effect playing method and device in game scene and electronic device

    CN111111167A