CN111744192B - Sound propagation method, sound propagation device, electronic equipment and computer readable medium - Google Patents

Sound propagation method, sound propagation device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN111744192B
CN111744192B CN202010598287.8A CN202010598287A CN111744192B CN 111744192 B CN111744192 B CN 111744192B CN 202010598287 A CN202010598287 A CN 202010598287A CN 111744192 B CN111744192 B CN 111744192B
Authority
CN
China
Prior art keywords
sound
point
area
propagation
region
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010598287.8A
Other languages
Chinese (zh)
Other versions
CN111744192A (en
Inventor
马若飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202010598287.8A priority Critical patent/CN111744192B/en
Publication of CN111744192A publication Critical patent/CN111744192A/en
Application granted granted Critical
Publication of CN111744192B publication Critical patent/CN111744192B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/54Controlling the output signals based on the game progress involving acoustic signals, e.g. for simulating revolutions per minute [RPM] dependent engine sounds in a driving game or reverberation against a virtual wall
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Acoustics & Sound (AREA)
  • Computer Hardware Design (AREA)
  • Evolutionary Computation (AREA)
  • Geometry (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Measurement Of Velocity Or Position Using Acoustic Or Ultrasonic Waves (AREA)
  • Telephone Function (AREA)

Abstract

The disclosure relates to a sound propagation method, a sound propagation device, electronic equipment and a computer readable medium, and belongs to the technical field of computers. The method comprises the following steps: determining a plurality of areas in a map, acquiring sound area points corresponding to each area and area connection points between two adjacent areas, and obtaining a propagation connection diagram; responding to a sound propagation event of a sound source point, acquiring a sound propagation distance of the sound source point, determining a sound source region point corresponding to a region where the sound source point is located, and determining a sound receiving region point corresponding to a region where the sound receiving point is located; and judging whether the sound receiving point can receive the sound propagated by the sound source point or not according to the connection relation between the sound source area point and the sound receiving area point in the propagation connection diagram and the sound propagation distance. According to the method and the device, the propagation condition of the sound among the nodes in each area is simulated through the propagation connection diagram of the sound, and whether the receiving point can receive the sound propagated by the source point can be judged in a complex scene.

Description

Sound propagation method, sound propagation device, electronic equipment and computer readable medium
Technical Field
The present disclosure relates to the field of computer technology, and in particular, to a sound propagation method, a sound propagation device, an electronic apparatus, and a computer readable medium.
Background
In a game, it is often necessary to simulate the propagation of sound events in a game scene to determine whether a certain location in the scene is able to receive sound from another location.
Most of the existing simulation methods for sound propagation at present are to judge whether a target position can receive sound by directly judging the distance or judging whether a barrier exists between two positions through a plurality of rays. Therefore, the existing method can only simulate the propagation conditions of some open scenes, and is difficult to realize more realistic simulation for some complex scenes.
In view of this, there is a need in the art for a method that can more realistically simulate sound propagation in complex scenarios.
It should be noted that the information disclosed in the above background section is only for enhancing understanding of the background of the present disclosure and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The disclosure aims to provide a sound propagation method, a sound propagation device, electronic equipment and a computer readable medium, so that the propagation situation of sound in a complex scene can be more truly simulated at least to a certain extent.
According to a first aspect of the present disclosure, there is provided a sound propagation method including:
determining a plurality of areas in a map, acquiring sound area points corresponding to each area and area connection points between two adjacent areas, and obtaining a propagation connection diagram according to the sound area points and the area connection points;
responding to a sound propagation event of a sound source point, acquiring a sound propagation distance of the sound source point, determining a sound source region point corresponding to a region where the sound source point is located, and determining a sound receiving region point corresponding to a region where a sound receiving point is located;
and judging whether the sound receiving point can receive the sound propagated by the sound source point or not according to the connection relation between the sound source region point and the sound receiving region point in the propagation connection diagram and the sound propagation distance.
In an exemplary embodiment of the present disclosure, the determining, according to the connection relationship between the sound source region point and the sound receiving region point in the propagation connection diagram and the sound propagation distance, whether the sound receiving point can receive the sound propagated by the sound source point includes:
Determining a sound propagation range of the sound source point according to the position of the sound source point and the sound propagation distance;
if the position of the sound receiving point is within the sound transmission range, determining the sound receiving point as a sound receiving point to be transmitted;
and judging whether the sound to be transmitted and received by the sound source point can be received or not according to the connection relation between the sound source region point and the sound to be transmitted and received region point in the transmission connection diagram.
In an exemplary embodiment of the present disclosure, the determining, according to a connection relationship between the sound source region point and the sound receiving region point to be propagated in the propagation connection diagram, whether the sound receiving point to be propagated can receive the sound propagated by the sound source point includes:
acquiring the attenuation distance of a to-be-propagated area connection point, and determining the residual propagation distance of the to-be-propagated area connection point according to the attenuation distance, the position of the sound source point and the sound propagation distance, wherein the to-be-propagated area connection point is an area connection point connected with the to-be-propagated sound receiving area point;
And judging whether the sound to be transmitted can be received by the sound source point according to the position of the sound receiving point to be transmitted and the residual transmission distance of the connection point of the area to be transmitted.
In an exemplary embodiment of the present disclosure, the determining the remaining propagation distance of the to-be-propagated area connection point according to the attenuation distance, the position of the sound source point, and the sound propagation distance includes:
determining a connection distance between the sound source point and the to-be-transmitted area connection point as a first transmission distance from the sound source point to the to-be-transmitted area connection point;
obtaining the consumed distance of the to-be-propagated area connection point according to the sum of the first propagation distance and the attenuation distance of the to-be-propagated area connection point;
and obtaining the residual propagation distance of the to-be-propagated area connection point according to the difference value of the sound propagation distance and the consumed distance of the to-be-propagated area connection point.
In an exemplary embodiment of the present disclosure, the determining, according to the location of the to-be-propagated sound receiving point and the remaining propagation distance of the to-be-propagated area connection point, whether the to-be-propagated sound receiving point can receive the sound propagated by the sound source point includes:
Determining a connection distance between the sound receiving point to be propagated and the region connection point to be propagated as a second propagation distance from the region connection point to be propagated to the sound receiving point to be propagated;
and if the second propagation distance is smaller than or equal to the remaining propagation distance of the to-be-propagated area connection point, the to-be-propagated sound receiving point can receive the sound propagated by the sound source point.
In an exemplary embodiment of the disclosure, the obtaining a propagation connection graph according to the sound region point and the region connection point includes:
if sound can be transmitted between two adjacent areas, the sound area points corresponding to the two adjacent areas are connected through the area connection points, and the transmission connection diagram is obtained.
In an exemplary embodiment of the present disclosure, after the acquiring the sound region points corresponding to the respective regions and the region connection points between the adjacent two regions, the method further includes:
acquiring coordinates of all position points in the map and sound area points corresponding to the areas where the position points are located, and obtaining position information corresponding to the position points;
And storing the position information corresponding to all the position points in the map in a position information table.
In an exemplary embodiment of the present disclosure, the determining a sound source area point corresponding to an area where the sound source point is located, and determining a sound receiving area point corresponding to an area where the sound receiving point is located, includes:
determining coordinates of the sound source points and the sound receiving points, and acquiring corresponding position information from the position information table according to the coordinates of the sound source points and the sound receiving points;
and determining a sound source region point corresponding to the region where the sound source point is located and a sound receiving region point corresponding to the region where the sound receiving point is located according to the sound source point and the position information corresponding to the sound receiving point.
According to a second aspect of the present disclosure, there is provided a sound propagation device including:
the propagation connection diagram generation module is used for determining a plurality of areas in the map, acquiring sound area points corresponding to each area and area connection points between two adjacent areas, and obtaining a propagation connection diagram according to the sound area points and the area connection points;
the sound area point determining module is used for responding to a sound propagation event of a sound source point, acquiring a sound propagation distance of the sound source point, determining a sound source area point corresponding to an area where the sound source point is located, and determining a sound receiving area point corresponding to an area where the sound receiving point is located;
And the sound receiving point judging module is used for judging whether the sound receiving point can receive the sound propagated by the sound source point or not according to the connection relation between the sound source area point and the sound receiving area point in the propagation connection diagram and the sound propagation distance.
According to a third aspect of the present disclosure, there is provided an electronic device comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the method of propagating sound of any one of the above via execution of the executable instructions.
According to a fourth aspect of the present disclosure, there is provided a computer readable medium having stored thereon a computer program which, when executed by a processor, implements the method of propagation of sound of any one of the above.
Exemplary embodiments of the present disclosure may have the following advantageous effects:
in the sound propagation method according to the exemplary embodiment of the present disclosure, propagation conditions of sound between respective regions are simulated by dividing a complex scene into a plurality of regions and by a propagation connection graph generated by nodes and connection points of the respective regions in the scene. In the example embodiment of the disclosure, by converting the game scene into the graph structure, the sound propagation can be more truly simulated in a complex scene, so as to judge whether the sound receiving point can receive the sound propagated by the sound source point, and make the sound propagation in the game more realistic.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure. It will be apparent to those of ordinary skill in the art that the drawings in the following description are merely examples of the disclosure and that other drawings may be derived from them without undue effort.
FIG. 1 is a schematic diagram of an exemplary system architecture of a sound propagation method and apparatus to which embodiments of the present invention may be applied;
FIG. 2 shows a flow diagram of a method of propagating sound of an example embodiment of the present disclosure;
FIG. 3 schematically illustrates a schematic diagram of a propagation connection graph according to one embodiment of the present disclosure;
fig. 4 is a flowchart illustrating a method for determining whether a sound receiving point can receive sound according to an exemplary embodiment of the present disclosure;
fig. 5 is a flowchart illustrating a method for determining whether a sound receiving point to be propagated can receive sound according to an exemplary embodiment of the present disclosure;
FIG. 6 schematically illustrates a schematic diagram of how the remaining propagation distance is calculated, according to one embodiment of the present disclosure;
FIG. 7 illustrates a flow diagram of determining a remaining propagation distance according to an example embodiment of the present disclosure;
FIG. 8 illustrates a flow diagram of determining whether sound can be received based on the remaining propagation distance according to an example embodiment of the present disclosure;
fig. 9 schematically illustrates a schematic diagram for determining whether a sound receiving point can receive sound according to one embodiment of the present disclosure;
FIG. 10 illustrates a flow diagram of preserving location information according to an example embodiment of the present disclosure;
FIG. 11 illustrates a flow diagram of determining sound zone points from a location information table according to an example embodiment of the present disclosure;
FIG. 12 illustrates a block diagram of a sound propagation device of an example embodiment of the present disclosure;
fig. 13 shows a schematic diagram of a computer system suitable for use in implementing embodiments of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments may be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the present disclosure. One skilled in the relevant art will recognize, however, that the aspects of the disclosure may be practiced without one or more of the specific details, or with other methods, components, devices, steps, etc. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus a repetitive description thereof will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software or in one or more hardware modules or integrated circuits or in different networks and/or processor devices and/or microcontroller devices.
Fig. 1 is a schematic diagram of a system architecture of an exemplary application environment to which a sound propagation method and apparatus according to an embodiment of the present invention may be applied.
As shown in fig. 1, the system architecture 100 may include a plurality of mobile terminals 101, 102, 103, a network 104, and a server 105. The network 104 is the medium used to provide communication links between the mobile terminals 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wireless communication links, etc.
It should be understood that the number of mobile terminals, networks and servers in fig. 1 is merely illustrative. There may be any number of mobile terminals, networks and servers, as desired for implementation. For example, the server 105 may be a server cluster formed by a plurality of servers.
The mobile terminals 101, 102, 103 may be various electronic devices with processors including, but not limited to, smartphones, tablets, portable computers, and the like. The server 105 may be a server providing various services. For example, the mobile terminals 101, 102, 103 may obtain, by a processor, a sound propagation distance of a sound source point, determine a sound source region point corresponding to a region where the sound source point is located, and determine a sound receiving region point corresponding to a region where the sound receiving point is located. The server 105 may determine whether the sound receiving point can receive the sound propagated by the sound source point according to the connection relationship between the sound source region point and the sound receiving region point in the propagation connection diagram and the sound propagation distance. The mobile terminals 101, 102, 103 may also complete the entire process from acquiring the sound propagation distance of the sound source point to determining whether the sound receiving point is able to receive the sound propagated by the sound source point through the processor.
The present exemplary embodiment first provides a sound propagation method. Referring to fig. 2, the sound propagation method may include the steps of:
s210, determining a plurality of areas in the map, acquiring sound area points corresponding to the areas and area connection points between two adjacent areas, and obtaining a propagation connection diagram according to the sound area points and the area connection points.
In this example embodiment, the map may be divided into a plurality of regions according to a specific layout of the scene map in the game, and the regions may be regular rectangles or irregular patterns. Each region is provided with a sound region point and a region connection point is arranged between two adjacent regions.
The sound area point is used for locating an area where the position point in the map is located, and can be arranged in the middle of the whole area in general, and the sound area point can receive sound events of any position point in the same area in a straight line. The region connection point is used to indicate whether sound can be propagated between two adjacent regions, and can be used to indicate the attenuation of sound through the connection point.
If sound can be transmitted between two adjacent areas, sound area points corresponding to the two adjacent areas are connected through area connection points, and a transmission connection diagram is obtained.
As shown in fig. 3, the map in fig. 3 is divided into 6 areas according to the layout of the game scene, wherein area 1 is an irregular figure composed of two rectangles, and areas 2 to 6 are regular rectangles of different sizes, respectively. Each region in the figure is provided with a sound region point 301, and if sound can be transmitted between two adjacent regions, such as region 4 and region 5, a region connection point 302 is provided between the two adjacent regions; if no sound can be transmitted between two adjacent regions, such as region 2 and region 3, no region connection point is provided between the regions. The individual sound zone points in the map can be connected by zone connection points 302 to obtain a propagation connection map.
S220, responding to a sound propagation event of the sound source point, acquiring a sound propagation distance of the sound source point, determining a sound source region point corresponding to a region where the sound source point is located, and determining a sound receiving region point corresponding to a region where the sound receiving point is located.
In this exemplary embodiment, a position point where a Character or NPC (Non-Player Character) where a sound event occurs is a sound source point, and a sound area point corresponding to an area where the sound source point is located is a sound source area point. As shown in fig. 3, the region where the sound source point 303 is located is region 1, and the sound region point corresponding to region 1 is the sound source region point. The maximum propagation distance of the sound event occurring at the sound source point is the sound propagation distance of the sound source point.
The position point of the Character or NPC (Non-Player Character) receiving the sound event is the sound receiving point, and the sound area point corresponding to the area where the sound receiving point is located is the sound receiving area point. As shown in fig. 3, if each of the region 1, the region 3, the region 4 and the region 5 has one sound receiving point 304, the sound region points corresponding to the region 1, the region 3, the region 4 and the region 5 are the sound receiving region points corresponding to the respective sound receiving points.
And S230, judging whether the sound receiving point can receive the sound propagated by the sound source point or not according to the connection relation between the sound source area point and the sound receiving area point in the propagation connection diagram and the sound propagation distance.
In this example embodiment, all sound receiving points that may receive a sound event may be screened according to the sound propagation distance of the sound source point, and then, according to the connection relationship between the sound source region point and the sound receiving region point in the propagation connection diagram, it is determined whether the sound propagated by the sound source point may be actually received in all the sound receiving points that may be received.
Next, the above steps of the present exemplary embodiment will be described in more detail with reference to fig. 4 to 11.
In step S230, as shown in fig. 4, according to the connection relationship between the sound source region point and the sound receiving region point in the propagation connection diagram and the sound propagation distance, it is determined whether the sound receiving point can receive the sound propagated by the sound source point, which specifically includes the following steps:
and S410, determining the sound propagation range of the sound source point according to the position of the sound source point and the sound propagation distance.
In this exemplary embodiment, a circular maximum propagation range may be defined by taking the position of the sound source point as the center and taking the sound propagation distance as the radius, and the range is the sound propagation range of the sound source point.
And S420, if the position of the sound receiving point is within the sound transmission range, determining the sound receiving point as the sound receiving point to be transmitted.
If the position of the sound receiving point is within the sound transmission range, the sound receiving point is the sound receiving point which is likely to receive the sound event, the sound receiving point is determined as the sound receiving point to be transmitted, and further judgment is carried out.
If the position of the sound receiving point is out of the sound transmission range, the sound receiving point is not required to be further judged and is directly eliminated.
And S430, judging whether the sound source point to be propagated can receive the sound propagated by the sound source point or not according to the connection relation between the sound source region point and the sound receiving region point to be propagated in the propagation connection diagram.
The sound area point corresponding to the area where the sound receiving point to be propagated is located is the sound receiving area point to be propagated. As shown in fig. 5, in step S430, the following steps may be specifically included:
s510, obtaining the attenuation distance of the to-be-propagated area connection point, and determining the residual propagation distance of the to-be-propagated area connection point according to the attenuation distance, the position of the sound source point and the sound propagation distance, wherein the to-be-propagated area connection point is an area connection point connected with the to-be-propagated sound receiving area point.
In this example embodiment, there is some attenuation of the sound as it propagates through the region of the junction. The attenuation values at the different zone connection points may be different.
As shown in fig. 6, assuming that the sound propagation distance of the sound source point 601 is 10, the attenuation distances of the region connection points 602 and 603 are 3, the attenuation distances of the region connection points 604 and 605 are 0, the attenuation distance of the region connection point 606 is 2, and the connection distances between the sound source point 601 and the respective region connection points are indicated by marks in fig. 6, the remaining propagation distances at the region connection points can be obtained from the connection distances and the attenuation distances at the region connection points.
And S520, judging whether the sound receiving point to be propagated can receive the sound propagated by the sound source point or not according to the position of the sound receiving point to be propagated and the residual propagation distance of the connection point of the area to be propagated.
After the remaining propagation distance at the connection point of the to-be-propagated area is obtained, whether the to-be-propagated sound receiving point can receive the sound propagated by the sound source point or not can be judged according to the connection distance between the connection point of the to-be-propagated area and the to-be-propagated sound receiving point.
In step S510, as shown in fig. 7, the remaining propagation distance of the connection point of the region to be propagated is determined according to the attenuation distance, the position of the sound source point and the sound propagation distance, which may specifically include the following steps:
Step S710, determining the connection distance between the sound source point and the connection point of the region to be propagated as a first propagation distance from the sound source point to the connection point of the region to be propagated.
If the to-be-transmitted area connection point can be directly connected with the sound source point, the first transmission distance from the sound source point to the to-be-transmitted area connection point is the straight line distance between the transmission area connection point and the sound source point; if the to-be-transmitted area connection point and the sound source point are required to be connected through other area connection points, the first transmission distance from the sound source point to the to-be-transmitted area connection point is the connection distance passing through other area connection points.
As shown in fig. 6, the first propagation distance from the sound source point to the region connection point 606 is 3; the first travel distance from the sound source point to the zone connection point 605 is 5, with the connection passing through the zone connection point 606 in between.
And S720, obtaining the consumed distance of the connecting point of the area to be propagated according to the sum of the first propagation distance and the attenuation distance of the connecting point of the area to be propagated.
And adding the attenuation distance of the region connection point to be propagated to the first propagation distance from the sound source point to the region connection point to be propagated to obtain the consumed distance of the region connection point to be propagated.
For example, as shown in fig. 6, the area connection point 603 is an area connection point to be propagated, to which a sound receiving point to be propagated in the area 3 is connected, a first propagation distance from a sound source point to the area connection point 603 is 4, an attenuation distance of the area connection point 603 is 3, and then a consumed distance of the area connection point 603 is 7; the area connection point 605 is an area connection point to be propagated, to which the sound receiving point to be propagated in the area 5 is connected, the first propagation distance from the sound source point to the area connection point 605 is 5, the attenuation distance of the area connection point 605 is 0, the attenuation distance of the area connection point 606 passing in the middle is 2, and the consumed distance of the area connection point 605 is 7.
And S730, obtaining the residual propagation distance of the connection point of the region to be propagated according to the difference value of the sound propagation distance and the consumed distance of the connection point of the region to be propagated.
And subtracting the consumed distance of the connection point of the region to be propagated from the sound propagation distance of the sound source point to obtain the residual propagation distance of the connection point of the region to be propagated. As shown in fig. 6, the remaining propagation distance of the area connection point 603 is 3, the remaining propagation distance of the area connection point 604 is 7, the remaining propagation distance of the area connection point 605 is 3, and the remaining propagation distance of the area connection point 606 is 5.
In step S520, as shown in fig. 8, according to the position of the sound receiving point to be propagated and the remaining propagation distance of the connection point of the area to be propagated, it is determined whether the sound receiving point to be propagated can receive the sound propagated by the sound source point, which specifically includes the following steps:
step S810, determining the connection distance between the sound receiving point to be propagated and the connection point of the area to be propagated as a second propagation distance from the connection point of the area to be propagated to the sound receiving point to be propagated.
The second propagation distance from the point of connection of the region to be propagated to the point of reception of the sound to be propagated is a connection distance between the point of reception of the sound to be propagated and the point of connection of the region to be propagated. As shown in fig. 9, the second propagation distance from the region-to-be-propagated connection point 603 to the sound-to-be-propagated reception point 901 is 4, the second propagation distance from the region-to-be-propagated connection point 604 to the sound-to-be-propagated reception point 902 is 6, and the second propagation distance from the region-to-be-propagated connection point 605 to the sound-to-be-propagated reception point 903 is 2.
Step S820, if the second propagation distance is smaller than or equal to the remaining propagation distance of the connection point of the to-be-propagated area, the to-be-propagated sound receiving point can receive the sound propagated by the sound source point.
And judging whether the sound source point can receive the sound transmitted by the sound source point or not according to the residual transmission distance of the connection point of the region to be transmitted, which is connected with the sound receiving point to be transmitted, and the second transmission distance from the connection point of the region to be transmitted to the sound receiving point to be transmitted. If the second propagation distance is smaller than or equal to the remaining propagation distance, the sound receiving point to be propagated can receive the sound propagated by the sound source point; if the second propagation distance is greater than the remaining propagation distance, the sound receiving point to be propagated cannot receive the sound propagated by the sound source point.
As shown in fig. 9, the remaining propagation distance of the to-be-propagated area connection point 603 is 3, and the second propagation distance from the to-be-propagated area connection point 603 to the to-be-propagated sound receiving point 901 is 4, so that the to-be-propagated sound receiving point 901 cannot receive sound propagated by the sound source point; the remaining propagation distance of the to-be-propagated area connection point 604 is 7, and the second propagation distance from the to-be-propagated area connection point 604 to the to-be-propagated sound receiving point 902 is 6, so that the to-be-propagated sound receiving point 902 can receive the sound propagated by the sound source point; the remaining propagation distance of the to-be-propagated area connection point 605 is 3, and the second propagation distance from the to-be-propagated area connection point 605 to the to-be-propagated sound receiving point 903 is 2, so that the to-be-propagated sound receiving point 903 can receive sound propagated by the sound source point.
If the sound receiving point to be propagated and the sound source point are in the same area, attenuation through the area connection point is not needed, calculation of the first propagation distance and the second propagation distance is not needed, and the distance from the sound source point to the sound receiving point to be propagated can be directly judged. As shown in fig. 9, the sound receiving point 904 to be propagated is in the same area as the sound source point 601 and has a distance of 3, which is smaller than the sound propagation distance 10 of the sound source point 601, so that the sound propagated by the sound source point 601 can be received by the sound receiving point 904.
Before judging whether the sound receiving point can receive the sound transmitted by the sound source point or not through the steps, the user can walk through all the position points in the map in advance and save the position information of the position points, so that the position information can be conveniently and directly read in the operation step, the consumption in the operation process is reduced, and the operation time is optimized. The specific method comprises the following steps:
in step S210, as shown in fig. 10, after acquiring the sound region points corresponding to the respective regions and the region connection points between the adjacent two regions, the following steps may be further included:
s1010, acquiring coordinates of all position points in the map and sound area points corresponding to the areas where the position points are located, and obtaining position information corresponding to the position points.
In this example embodiment, the coordinates of each location point may be calculated according to a certain precision (e.g., 0.3 m) by traversing all the valid location points in the map, and then the sound area points corresponding to the area where each location point is located are obtained, and the coordinates of the location point and the sound area points corresponding to the location point are used as the location information corresponding to the location point.
And S1020, storing the position information corresponding to all the position points in the map in a position information table.
The position information corresponding to all the position points in the map is stored in the position information table, so that the position information can be directly read from the position information table in the subsequent calculation process, and the consumption in calculation is reduced.
In step S220, as shown in fig. 11, determining a sound source region point corresponding to a region where a sound source point is located, and determining a sound receiving region point corresponding to a region where a sound receiving point is located may specifically include the following steps:
and S1110, determining coordinates of the sound source points and the sound receiving points, and acquiring corresponding position information from a position information table according to the coordinates of the sound source points and the sound receiving points.
And S1120, determining a sound source region point corresponding to the region where the sound source point is located and a sound receiving region point corresponding to the region where the sound receiving point is located according to the position information corresponding to the sound source point and the sound receiving point.
Because the position information corresponding to all the position points in the map is stored in the position information table in advance, when the sound source region point and the sound receiving region point are determined, the sound source point or the region where the sound receiving point is located does not need to be judged again, only the coordinates of the sound source point and the sound receiving point need to be determined, and the corresponding sound region point is directly obtained from the position information table according to the coordinates to serve as the sound source region point and the sound receiving region point.
By caching the position information in the map in the position information table in advance, the consumed time of each simulation of sound event propagation can be optimized, the consumption in operation is reduced, and the game running efficiency is improved.
It should be noted that although the steps of the methods in the present disclosure are depicted in the accompanying drawings in a particular order, this does not require or imply that the steps must be performed in that particular order, or that all illustrated steps be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform, etc.
Further, the disclosure also provides a sound propagation device. Referring to fig. 12, the sound propagation device may include a propagation connection diagram generation module 1210, a sound region point determination module 1220, and a sound reception point judgment module 1230. Wherein:
The propagation connection diagram generating module 1210 may be configured to determine a plurality of regions in the map, obtain sound region points corresponding to each region, and region connection points between two adjacent regions, and obtain a propagation connection diagram according to the sound region points and the region connection points;
the sound region point determining module 1220 may be configured to obtain a sound propagation distance of a sound source point in response to a sound propagation event of a sound source point, determine a sound source region point corresponding to a region where the sound source point is located, and determine a sound receiving region point corresponding to a region where the sound receiving point is located;
the sound receiving point determining module 1230 may be configured to determine whether the sound receiving point can receive the sound propagated by the sound source point according to the connection relationship between the sound source region point and the sound receiving region point in the propagation connection diagram and the sound propagation distance.
In some exemplary embodiments of the present disclosure, the sound receiving point judging module 1230 may include a sound propagation range determining unit, a receiving point to be propagated determining unit, and a receiving point connection relationship judging unit. Wherein:
the sound propagation range determining unit may be configured to determine a sound propagation range of the sound source point according to a position where the sound source point is located and the sound propagation distance;
The to-be-transmitted receiving point determining unit may be configured to determine the sound receiving point as the to-be-transmitted sound receiving point if the position of the sound receiving point is within the sound transmission range;
the receiving point connection relation judging unit may be configured to judge whether the sound to be propagated by the sound source point can be received by the sound to be propagated receiving point according to a connection relation between the sound source region point and the sound to be propagated receiving region point in the propagation connection diagram.
In some exemplary embodiments of the present disclosure, the reception point connection relation judging unit may include a remaining propagation distance determining unit and a reception point to be propagated judging unit. Wherein:
the remaining propagation distance determining unit may be configured to obtain an attenuation distance of a to-be-propagated area connection point, and determine a remaining propagation distance of the to-be-propagated area connection point according to the attenuation distance, a position where the sound source point is located, and the sound propagation distance, where the to-be-propagated area connection point is an area connection point connected to the to-be-propagated sound receiving area point;
the to-be-transmitted receiving point judging unit may be configured to judge whether the to-be-transmitted sound receiving point can receive the sound transmitted by the sound source point according to the position of the to-be-transmitted sound receiving point and the remaining transmission distance of the to-be-transmitted area connection point.
In some exemplary embodiments of the present disclosure, the remaining travel distance determining unit may include a first travel distance determining unit, a consumed distance determining unit, and a remaining travel distance calculating unit.
Wherein:
the first propagation distance determining unit may be configured to determine a connection distance between the sound source point and the region connection point to be propagated as a first propagation distance from the sound source point to the region connection point to be propagated;
the consumed distance determining unit may be configured to obtain a consumed distance of the to-be-propagated area connection point according to a sum of the first propagation distance and the attenuation distance of the to-be-propagated area connection point;
the remaining propagation distance calculating unit may be configured to obtain the remaining propagation distance of the to-be-propagated area connection point according to a difference between the sound propagation distance and the consumed distance of the to-be-propagated area connection point.
In some exemplary embodiments of the present disclosure, the reception point to be propagated judging unit may include a second propagation distance determining unit and a second propagation distance judging unit. Wherein:
the second propagation distance determining unit may be configured to determine a connection distance between the to-be-propagated sound receiving point and the to-be-propagated area connection point as a second propagation distance from the to-be-propagated area connection point to the to-be-propagated sound receiving point;
The second propagation distance determining unit may use Yu Redi that the second propagation distance is less than or equal to the remaining propagation distance of the connection point of the to-be-propagated area, so that the to-be-propagated sound receiving point can receive the sound propagated by the sound source point.
In some exemplary embodiments of the present disclosure, the propagation connection map generating module 1210 may include a region connection point connection unit, and may be configured to connect sound region points corresponding to two adjacent regions through a region connection point if sound can be propagated between the two adjacent regions, so as to obtain a propagation connection map.
In some exemplary embodiments of the present disclosure, a sound propagation device provided by the present disclosure may further include a location information acquisition module and a location information storage module. Wherein:
the position information acquisition module can be used for acquiring coordinates of all position points in the map and sound area points corresponding to the areas where the position points are located, so as to obtain position information corresponding to the position points;
the location information storage module may be configured to store location information corresponding to all location points in the map in a location information table.
In some exemplary embodiments of the present disclosure, the sound region point determining module 1220 may include a location information determining unit and a sound region point determining unit. Wherein:
The position information determining unit may be configured to determine coordinates of the sound source point and the sound receiving point, and obtain corresponding position information from the position information table according to the coordinates of the sound source point and the sound receiving point;
the sound region point determining unit may be configured to determine, according to the position information corresponding to the sound source point and the sound receiving point, a sound source region point corresponding to the region where the sound source point is located, and a sound receiving region point corresponding to the region where the sound receiving point is located.
The specific details of each module/unit in the above-mentioned sound propagation device are already described in the corresponding method embodiment section, and will not be repeated here.
Fig. 13 shows a schematic diagram of a computer system suitable for use in implementing an embodiment of the invention.
It should be noted that, the computer system 1300 of the electronic device shown in fig. 13 is only an example, and should not impose any limitation on the functions and the application scope of the embodiments of the present invention.
As shown in fig. 13, the computer system 1300 includes a Central Processing Unit (CPU) 1301, which can execute various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 1302 or a program loaded from a storage section 1308 into a Random Access Memory (RAM) 1303. In the RAM 1303, various programs and data required for the system operation are also stored. The CPU1301, ROM 1302, and RAM 1303 are connected to each other through a bus 1304. An input/output (I/O) interface 1305 is also connected to bus 1304.
The following components are connected to the I/O interface 1305: an input section 1306 including a keyboard, a mouse, and the like; an output portion 1307 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker, and the like; a storage portion 1308 including a hard disk or the like; and a communication section 1309 including a network interface card such as a LAN card, a modem, or the like. The communication section 1309 performs a communication process via a network such as the internet. The drive 1310 is also connected to the I/O interface 1305 as needed. Removable media 1311, such as magnetic disks, optical disks, magneto-optical disks, semiconductor memory, and the like, is installed as needed on drive 1310 so that a computer program read therefrom is installed as needed into storage portion 1308.
In particular, according to embodiments of the present invention, the processes described below with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such embodiments, the computer program may be downloaded and installed from a network via the communication portion 1309 and/or installed from the removable medium 1311. When executed by a Central Processing Unit (CPU) 1301, performs the various functions defined in the system of the present application.
It should be noted that the computer readable medium shown in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
As another aspect, the present application also provides a computer-readable medium that may be contained in the electronic device described in the above embodiment; or may exist alone without being incorporated into the electronic device. The computer-readable medium carries one or more programs which, when executed by one of the electronic devices, cause the electronic device to implement the methods described in the embodiments below.
It should be noted that although in the above detailed description several modules of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functions of two or more modules described above may be embodied in one module in accordance with embodiments of the present disclosure. Conversely, the features and functions of one module described above may be further divided into a plurality of modules to be embodied.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any adaptations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (9)

1. A method of sound propagation comprising:
Determining a plurality of areas in a map, acquiring sound area points corresponding to each area and area connection points between two adjacent areas, and obtaining a propagation connection diagram according to the sound area points and the area connection points;
responding to a sound propagation event of a sound source point, acquiring a sound propagation distance of the sound source point, determining a sound source region point corresponding to a region where the sound source point is located, and determining a sound receiving region point corresponding to a region where a sound receiving point is located;
determining a sound propagation range of the sound source point according to the position of the sound source point and the sound propagation distance;
if the position of the sound receiving point is within the sound transmission range, determining the sound receiving point as a sound receiving point to be transmitted;
acquiring the attenuation distance of a to-be-transmitted area connection point, and determining the residual transmission distance of the to-be-transmitted area connection point according to the attenuation distance, the position of the sound source point and the sound transmission distance, wherein the sound area point corresponding to the area where the to-be-transmitted sound receiving point is located is a to-be-transmitted sound receiving area point, and the to-be-transmitted area connection point is an area connection point connected with the to-be-transmitted sound receiving area point;
And judging whether the sound to be transmitted can be received by the sound source point according to the position of the sound receiving point to be transmitted and the residual transmission distance of the connection point of the area to be transmitted.
2. The sound propagation method according to claim 1, wherein the determining the remaining propagation distance of the region connection point to be propagated based on the attenuation distance, and the position of the sound source point and the sound propagation distance, includes:
determining a connection distance between the sound source point and the to-be-transmitted area connection point as a first transmission distance from the sound source point to the to-be-transmitted area connection point;
obtaining the consumed distance of the to-be-propagated area connection point according to the sum of the first propagation distance and the attenuation distance of the to-be-propagated area connection point;
and obtaining the residual propagation distance of the to-be-propagated area connection point according to the difference value of the sound propagation distance and the consumed distance of the to-be-propagated area connection point.
3. The sound propagation method according to claim 1, wherein the determining whether the sound receiving point to be propagated can receive the sound propagated by the sound source point according to the position of the sound receiving point to be propagated and the remaining propagation distance of the connection point of the area to be propagated includes:
Determining a connection distance between the sound receiving point to be propagated and the region connection point to be propagated as a second propagation distance from the region connection point to be propagated to the sound receiving point to be propagated;
and if the second propagation distance is smaller than or equal to the remaining propagation distance of the to-be-propagated area connection point, the to-be-propagated sound receiving point can receive the sound propagated by the sound source point.
4. The sound propagation method according to claim 1, wherein the obtaining a propagation connection map from the sound region point and the region connection point includes:
if sound can be transmitted between two adjacent areas, the sound area points corresponding to the two adjacent areas are connected through the area connection points, and the transmission connection diagram is obtained.
5. The sound propagation method according to claim 1, wherein after the acquisition of the sound region points corresponding to the respective regions and the region connection points between the adjacent two regions, the method further comprises:
acquiring coordinates of all position points in the map and sound area points corresponding to the areas where the position points are located, and obtaining position information corresponding to the position points;
And storing the position information corresponding to all the position points in the map in a position information table.
6. The method for propagating sound according to claim 5, wherein determining a sound source region point corresponding to a region where the sound source point is located and determining a sound receiving region point corresponding to a region where the sound receiving point is located comprises:
determining coordinates of the sound source points and the sound receiving points, and acquiring corresponding position information from the position information table according to the coordinates of the sound source points and the sound receiving points;
and determining a sound source region point corresponding to the region where the sound source point is located and a sound receiving region point corresponding to the region where the sound receiving point is located according to the sound source point and the position information corresponding to the sound receiving point.
7. A sound propagation device, comprising:
the propagation connection diagram generation module is used for determining a plurality of areas in the map, acquiring sound area points corresponding to each area and area connection points between two adjacent areas, and obtaining a propagation connection diagram according to the sound area points and the area connection points;
the sound area point determining module is used for responding to a sound propagation event of a sound source point, acquiring a sound propagation distance of the sound source point, determining a sound source area point corresponding to an area where the sound source point is located, and determining a sound receiving area point corresponding to an area where the sound receiving point is located;
The sound receiving point judging module is used for determining the sound propagation range of the sound source point according to the position of the sound source point and the sound propagation distance; if the position of the sound receiving point is within the sound transmission range, determining the sound receiving point as a sound receiving point to be transmitted; acquiring the attenuation distance of a to-be-transmitted area connection point, and determining the residual transmission distance of the to-be-transmitted area connection point according to the attenuation distance, the position of the sound source point and the sound transmission distance, wherein the sound area point corresponding to the area where the to-be-transmitted sound receiving point is located is a to-be-transmitted sound receiving area point, and the to-be-transmitted area connection point is an area connection point connected with the to-be-transmitted sound receiving area point; and judging whether the sound to be transmitted can be received by the sound source point according to the position of the sound receiving point to be transmitted and the residual transmission distance of the connection point of the area to be transmitted.
8. An electronic device, comprising:
a processor; and
a memory for storing one or more programs that, when executed by the one or more processors, cause the one or more processors to implement the method of propagation of sound of any one of claims 1 to 6.
9. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements a method of propagation of sound according to any one of claims 1 to 6.
CN202010598287.8A 2020-06-28 2020-06-28 Sound propagation method, sound propagation device, electronic equipment and computer readable medium Active CN111744192B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010598287.8A CN111744192B (en) 2020-06-28 2020-06-28 Sound propagation method, sound propagation device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010598287.8A CN111744192B (en) 2020-06-28 2020-06-28 Sound propagation method, sound propagation device, electronic equipment and computer readable medium

Publications (2)

Publication Number Publication Date
CN111744192A CN111744192A (en) 2020-10-09
CN111744192B true CN111744192B (en) 2024-02-02

Family

ID=72677680

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010598287.8A Active CN111744192B (en) 2020-06-28 2020-06-28 Sound propagation method, sound propagation device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN111744192B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6190497B1 (en) * 2016-07-13 2017-08-30 株式会社コロプラ Information processing method and program for causing computer to execute information processing method
CN108744517A (en) * 2018-04-27 2018-11-06 网易(杭州)网络有限公司 Audio-frequency processing method, device, terminal and storage medium
CN110166890A (en) * 2019-01-30 2019-08-23 腾讯科技(深圳)有限公司 Broadcasting acquisition method, equipment and the storage medium of audio
CN111111167A (en) * 2019-12-05 2020-05-08 腾讯科技(深圳)有限公司 Sound effect playing method and device in game scene and electronic device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8847965B2 (en) * 2010-12-03 2014-09-30 The University Of North Carolina At Chapel Hill Methods, systems, and computer readable media for fast geometric sound propagation using visibility computations
US9632619B2 (en) * 2014-06-25 2017-04-25 Egalax_Empia Technology Inc. Recording method, apparatus, system, and computer-readable media of touch information timing

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6190497B1 (en) * 2016-07-13 2017-08-30 株式会社コロプラ Information processing method and program for causing computer to execute information processing method
CN108744517A (en) * 2018-04-27 2018-11-06 网易(杭州)网络有限公司 Audio-frequency processing method, device, terminal and storage medium
CN110166890A (en) * 2019-01-30 2019-08-23 腾讯科技(深圳)有限公司 Broadcasting acquisition method, equipment and the storage medium of audio
CN111111167A (en) * 2019-12-05 2020-05-08 腾讯科技(深圳)有限公司 Sound effect playing method and device in game scene and electronic device

Also Published As

Publication number Publication date
CN111744192A (en) 2020-10-09

Similar Documents

Publication Publication Date Title
CN111467806B (en) Method, device, medium and electronic equipment for generating resources in game scene
CN111581291A (en) Data processing method and device, electronic equipment and readable medium
CN110390493B (en) Task management method and device, storage medium and electronic equipment
CN112100079B (en) Test method and system based on simulation data calling and electronic equipment
CN112650841A (en) Information processing method and device and electronic equipment
US11651198B2 (en) Data processing method and apparatus for neural network
CN109325744B (en) Payment processing method, payment processing device, payment processing medium and electronic equipment
CN114138674A (en) Automatic testing method and device and computer equipment
CN112991027A (en) Bidding information processing method, device, equipment and medium based on block chain
CN110908921A (en) Game problem positioning method and device, electronic equipment and storage medium
CN116225886A (en) Test case generation method, device, equipment, storage medium and program product
CN111744192B (en) Sound propagation method, sound propagation device, electronic equipment and computer readable medium
CN115296905B (en) Data acquisition and analysis method and system based on mobile terminal
CN112306826A (en) Method and apparatus for processing information for terminal
CN109634866A (en) Data test method, apparatus, medium and electronic equipment
CN112734962B (en) Attendance information generation method and device, computer equipment and readable storage medium
CN114428815A (en) Data storage method and device, electronic equipment and computer readable medium
CN113362864A (en) Audio signal processing method, device, storage medium and electronic equipment
CN111949860A (en) Method and apparatus for generating a relevance determination model
CN108898446A (en) Method and apparatus for output information
CN109657126A (en) Answer generation method, device, equipment and medium
CN112036821B (en) Quantization method, quantization device, quantization medium and quantization electronic equipment based on grid map planning private line
CN113469877B (en) Object display method, scene display method, device and computer readable medium
CN111741437B (en) Positioning method for addressing correction of satellite positioning and communication base station cloud terminal
CN110580142B (en) Method and device for generating random number

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant