Environmental audio playing method and device, storage medium and electronic device
By playing a first audio with continuous characteristics in a virtual scene and randomly triggering a second audio with transient characteristics, the problem of repetitive environmental audio in the virtual scene is solved, enhancing the realism of the game and the player experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-12
- Publication Date
- 2026-03-20
AI Technical Summary
In virtual environments, existing methods of playing ambient audio result in players experiencing repetitive and monotonous audio when staying in a virtual environment for extended periods, thus diminishing the gaming experience.
By acquiring a first audio with continuous characteristics and a second audio with transient characteristics from preset ambient audio, and randomly playing the second audio while playing the first audio, the ambient audio of the virtual scene is formed.
It creates a realistic game atmosphere, improves the player experience, avoids repetition, and enhances the auditory realism.
Smart Images

Figure CN115054915B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of computer, in particular, to an environmental audio playing method and device, a storage medium and an electronic device. BACKGROUND
[0002] In a virtual scene, a real scene experience or a game atmosphere is often created by playing environmental audio. In the related art, when a player enters a virtual scene, an audio engine plays environmental audio that is pre-set. However, the method of playing environmental audio provided in the related art, when the player stays in the virtual scene for a long time, the player can obviously feel that the played environmental audio is repetitive and single, thereby reducing the game experience of the player. SUMMARY
[0003] This summary is provided to introduce a selection of concepts, which are further described below in the detailed description. This summary is not intended to identify key or essential features of the claimed subject matter, nor is it used to limit the scope of the claimed subject matter's scope.
[0004] In a first aspect, the present disclosure provides an environmental audio playing method, comprising:
[0005] acquiring a first audio and a second audio from pre-set environmental audio, wherein the first audio is a sound with a persistent characteristic in the environmental audio, and the second audio is a sound with a transient characteristic in the environmental audio;
[0006] in response to an instruction of playing environmental audio in a virtual scene, playing the first audio, and randomly playing the second audio in the process of playing the first audio, so that the first audio and the second audio cooperate to form environmental audio of the virtual scene.
[0007] In a second aspect, the present disclosure provides an environmental audio playing device, comprising:
[0008] an acquisition module configured to acquire a first audio and a second audio from pre-set environmental audio, wherein the first audio is a sound with a persistent characteristic in the environmental audio, and the second audio is a sound with a transient characteristic in the environmental audio;
[0009] a playing module configured to, in response to an instruction of playing environmental audio in a virtual scene, play the first audio, and randomly play the second audio in the process of playing the first audio, so that the first audio and the second audio cooperate to form environmental audio of the virtual scene.
[0010] In a third aspect, the present disclosure provides a computer readable storage medium having stored thereon a computer program which, when executed by a processing apparatus, implements the steps of the method of the first aspect.
[0011] In a fourth aspect, the present disclosure provides an electronic device comprising:
[0012] a storage device having stored thereon a computer program;
[0013] a processing apparatus configured to execute the computer program in the storage device to implement the steps of the method of the first aspect.
[0014] Based on the above technical solution, the first audio with the persistence characteristic is played, and the second audio with the transience characteristic is randomly played in the process of playing the first audio, so as to make the first audio and the second audio cooperate to form the environmental audio of the virtual scene. Since the first audio is the sound with the persistence characteristic in the environmental audio and the second audio is the sound with the transience characteristic in the environmental audio, in the process of cyclically playing the first audio, the environmental audio formed by randomly triggering the second audio to be played will not feel repetitive in the hearing of the game player, thereby creating a real game atmosphere and improving the experience of the game player.
[0015] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF DRAWINGS
[0016] The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by describing in detail some embodiments with reference to the attached drawings. The same or similar reference numerals refer to the same or similar elements throughout the drawings. It is to be understood that the drawings are schematic, and the original and elements are not necessarily drawn in proportion. In the drawings:
[0017] Figure 1 is a flowchart of an environmental audio playing method according to some embodiments.
[0018] Figure 2 is Figure 1 a detailed flowchart of step 120 shown in FIG. 1.
[0019] Figure 3 is Figure 2 a detailed flowchart of step 122 shown in FIG. 1.
[0020] Figure 4 is a module connection diagram of an environmental audio playing device according to some embodiments.
[0021] Figure 5 is a block diagram of an electronic device according to some embodiments. DETAILED DESCRIPTION
[0022] Embodiments of the present disclosure will be described in more detail with reference to the drawings. While certain embodiments of the present disclosure are shown in the drawings, it is understood that the present disclosure can be embodied in various forms and should not be interpreted in a limited sense as set forth in the embodiments set forth herein. Rather, the embodiments are provided to more completely understand the present disclosure. It is understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of the present disclosure.
[0023] It should be understood that each step described in the method embodiments of the present disclosure can be performed in different orders and / or in parallel. In addition, the method embodiments can include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0024] The term "comprising" and variations thereof as used herein are used inclusively, i.e., "comprising, but not limited to." The term "based on" is "based at least in part on." The term "one embodiment" means "at least one embodiment." The term "another embodiment" means "at least one additional embodiment." The term "some embodiments" means "at least some embodiments." Related definitions will be given in the description below.
[0025] It should be noted that the terms "first", "second", and the like in the present disclosure are merely used to distinguish different devices, modules or units, and are not intended to limit the order or interdependence of the functions performed by these devices, modules or units.
[0026] It should be noted that the terms "one", "multiple" in the present disclosure are illustrative and not restrictive, and those skilled in the art should understand that "one" or "multiple" should be understood as "one or more" unless otherwise explicitly indicated in the context.
[0027] The names of the messages or information exchanged between the devices in the embodiments of the present disclosure are merely used for illustrative purposes, and are not intended to limit the scope of the messages or information.
[0028] In the related art, when a player enters a virtual scene, an audio engine plays a pre-set environmental audio. The set environmental audio is often an audio of about 30 seconds, and the audio engine plays the environmental audio by looping to create a game atmosphere. For example, when the weather in the virtual scene is "thunderstorm weather", the audio engine plays "thunderstorm sound" to create a weather atmosphere. For "thunderstorm sound", since the audio engine always loops the "thunderstorm sound", the player will hear the "thunder sound" at the same position every time the loop period is played.
[0029] Obviously, the method of playing environmental audio in the related art causes the players to feel the environmental sound with obvious cycle characteristics in the hearing, which greatly destroys the reality and immersion of the game.
[0030] To solve the above technical problems, the present disclosure provides an environmental audio playing method, which acquires a first audio with persistence characteristics and a second audio with instantaneous characteristics from preset environmental audio, and plays the second audio randomly in the process of playing the first audio, so as to form the environmental audio of the virtual scene by cooperation of the first audio and the second audio. Since the first audio is the sound with persistence characteristics in the environmental audio and the second audio is the sound with instantaneous characteristics in the environmental audio, the players will not feel the repetition in the hearing in the process of playing the first audio repeatedly, thereby creating a real game atmosphere.
[0031] Figure 1 is a flowchart of an environmental audio playing method according to some embodiments. As shown in Figure 1 The present disclosure provides an environmental audio playing method, which can be executed by an electronic device, specifically, by an environmental audio playing apparatus, which can be implemented in software and / or hardware and configured in the electronic device. As shown in Figure 1 The method can include the following steps.
[0032] In step 110, a first audio and a second audio are acquired from preset environmental audio, wherein the first audio is a sound with persistence characteristics in the environmental audio, and the second audio is a sound with instantaneous characteristics in the environmental audio.
[0033] Here, the preset environmental audio can include natural environmental audio, humanistic environmental audio, and magical environmental audio, etc. The natural environmental audio includes various sounds in nature, such as wind sound, rain sound, bird sound, thunder sound, etc. Different seasons, regions, and weather can be represented by the natural environmental audio, so that the game world can be more natural. The humanistic environmental audio can include environmental sounds produced by human civilization, such as traffic sound, calling sound, speaking sound, etc. The magical environmental audio can include sounds for creating a magical scene, such as wind sound with large reverberation to highlight the feeling of emptiness when the game player appears in the scene of the heavenly palace. It should be understood that in the present disclosure, the environmental audio can be all game sound effects for creating an environmental atmosphere. For different virtual scenes, the preset environmental audio corresponding to the virtual scene can be matched.
[0034] The electronic device obtains the first audio and the second audio from a preset environmental audio when obtaining an instruction to play the environmental audio in the virtual scene. The preset environmental audio can be a pre-recorded audio, for example, a "thunderstorm" audio with a time length of 30 seconds. Of course, the preset environmental audio can also be composed of at least two sub-audios, for example, including a "rain" sub-audio segment with a time length of 30 seconds and at least one "thunder" sub-audio segment. It should be understood that the sub-audio segment can be recorded separately or extracted from a preset environmental audio, for example, "rain" and "thunder" are extracted from "thunderstorm".
[0035] In some embodiments, obtaining the first audio and the second audio from the preset environmental audio can be obtaining the stored first audio and the second audio from a database, wherein the database stores the first audio and the second audio matching the scene type of the virtual scene.
[0036] In other embodiments, obtaining the first audio and the second audio from the preset environmental audio can be obtaining the preset environmental audio from a database and extracting the first audio and the second audio from the obtained preset environmental audio.
[0037] It is worth noting that the first audio and the second audio constitute a complete environmental audio, regardless of the way the first audio and the second audio are obtained. The first audio is a sound with a persistent characteristic in the environmental audio. The sound with a persistent characteristic represents a sound continuously emitted by the same sound source in the environmental audio, which is equivalent to the background noise in the environmental audio. In the hearing of the game player, the sound with a persistent characteristic is a sound with a repetitive characteristic and no obvious distinguishing point in the environmental audio. For example, the persistent "rain" in the environmental audio "thunderstorm" is the first audio in the environmental audio, the persistent "car sound" in the environmental audio "car flow" is the first audio in the environmental audio, and the persistent "water sound" in the environmental audio "streaming water" is the first audio in the environmental audio.
[0038] The second audio is a sound with a transient characteristic in the environmental audio. The sound with a transient characteristic represents a sound triggered instantaneously by a sound source or a sound with a duration less than a preset time threshold in the environmental audio. In the hearing of the game player, the sound with a transient characteristic is a sound with randomness and an obvious trigger point in the environmental audio. For example, the occasional "thunder" in the environmental audio "thunderstorm" is the second audio in the environmental audio, the occasional "horn sound" in the environmental audio "car flow" is the second audio in the environmental audio, and the occasional "bird chirping sound" in the environmental audio "streaming water" is the second audio in the environmental audio.
[0039] In step 120, in response to the instruction of playing environmental audio in the virtual scene, the first audio is played, and in the process of playing the first audio, the second audio is randomly played to make the first audio and the second audio cooperate to form the environmental audio of the virtual scene.
[0040] Here, the instruction of playing environmental audio in the virtual scene can be triggered when a game player enters the virtual scene, or triggered when the content in the virtual scene changes. For example, when the weather in the game changes, the instruction of playing environmental audio can be triggered. The virtual scene can be a game scene, a virtual reality scene, etc.
[0041] The electronic device can loop play the first audio through the audio engine. It should be understood that since the first audio is a sound with a persistent feature in the environmental audio, there is no obvious trigger point in the hearing of the game player, and even if the first audio is loop played, it will not attract the attention of the player. For example, the audio engine loops plays "rain sound" when the weather in the virtual scene changes to a thunderstorm. And in the process of playing the first audio, the audio engine randomly plays the second audio, so that the first audio and the second audio can cooperate to form complete environmental audio. For example, the audio engine randomly triggers the playing of "thunder sound" in the process of looping playing "rain sound", and "rain sound" and "thunder sound" cooperate to form the environmental audio of "thunder and rain sound", thereby creating a thunderstorm atmosphere in the virtual scene.
[0042] It is worth noting that since the second audio is a sound with a transient feature, the sound with an obvious trigger point can be heard in the hearing of the game player. By randomly playing the second audio, the environmental audio formed by the cooperation of the first audio and the second audio is also a random environmental audio.
[0043] In addition, when the number of second audios is multiple, the audio engine can randomly select one second audio from the multiple second audios, and play the selected second audio.
[0044] Therefore, by playing the first audio with a persistent feature and randomly playing the second audio with a transient feature in the process of playing the first audio, the first audio and the second audio cooperate to form the environmental audio of the virtual scene. Since the first audio is a sound with a persistent feature in the environmental audio and the second audio is a sound with a transient feature in the environmental audio, in the process of looping playing the first audio, by randomly triggering the playing of the second audio, the environmental audio formed will not have a repeated feeling in the hearing of the game player, thereby creating a real game atmosphere and improving the experience of the game player.
[0045] Figure 2 is Figure 1 the detailed flowchart of step 120 is shown. As Figure 2 As shown in some implementable embodiments, in step 120, playing the second audio randomly during playing the first audio can include the following steps.
[0046] In step 121, it is determined whether the current audio progress of the first audio is a target audio position during playing the first audio.
[0047] Here, the electronic device can periodically determine whether the current audio progress of the first audio is a target audio position during playing the first audio by the audio engine. The target audio position represents triggering playing the second audio when the audio engine plays to the target audio position of the first audio. Of course, when the period is small enough, the electronic device can determine whether the current audio progress of the first audio played by the audio engine can trigger playing the second audio at any time during playing the first audio by the audio engine. The current audio progress refers to the current playing progress of the first audio.
[0048] As some examples, in the case that the current audio progress is a preset audio position, a triggering probability at the preset audio position is determined, and in the case that a triggering result calculated according to the triggering probability is a preset result, it is determined that the current audio progress is the target audio position.
[0049] Here, one or more preset audio positions can be set in the first audio. When the first audio plays to a preset audio position, the triggering probability is calculated once, and then the triggering result is calculated according to the triggering probability. The triggering result can include “trigger” and “not trigger”. When the triggering result is “trigger”, it is determined that the current audio progress is the target audio position. When the triggering result is “not trigger”, it is determined that the current audio progress is not the target audio position.
[0050] It should be understood that the size of the triggering probability determines the size of the probability of the triggering result being the preset result. For example, when the triggering probability is 90%, the probability of the triggering result being the preset result is 90%, and the probability of the triggering result not being the preset result is 10%.
[0051] The triggering probability can be calculated by a probability function. It is worth noting that the triggering probability calculated each time can be random. Of course, the size of the triggering probability can also be determined according to a virtual scene.
[0052] Exemplarily, the probability function can be constructed according to a game picture of the virtual scene, and then the trigger probability is calculated through the probability function. The size of the trigger probability calculated by the probability function is positively correlated with the degree of the requirement of triggering the second audio in the game picture. For example, when the thunderstorm weather in the game picture gradually strengthens, the more "thunder" that needs to be triggered, the greater the trigger probability calculated by the probability function, so that the current audio progress of the first audio can trigger the playing of the second audio with a greater probability. When the thunderstorm weather in the game picture gradually weakens, the less "thunder" that needs to be triggered, the smaller the trigger probability calculated by the probability function, so that the current audio progress of the first audio can trigger the playing of the second audio with a smaller probability.
[0053] It should be understood that, by determining the size of the trigger probability according to the virtual scene, the environmental sound effect of the virtual scene can be made to be more consistent with the real situation of the virtual scene, so as to provide a real game atmosphere. For example, when the thunderstorm weather in the virtual scene gradually strengthens, more "thunder" is played, and when the thunderstorm weather in the virtual scene gradually weakens, less "thunder" is played, thereby simulating real thunderstorm weather in the virtual scene.
[0054] As other examples, a random duration can be determined, and the current audio progress is determined to be the target audio position in a case that the current audio progress and the audio position at which the second audio is last triggered to play are separated by the random duration.
[0055] Here, the random duration can be calculated by a random algorithm, and each time the random duration calculated is uncertain. If the current audio progress and the audio position at which the second audio is last triggered to play are separated by the random duration, the current audio progress is determined to be the target audio position, and the second audio is triggered to play. For example, the random duration is 3 seconds, and the audio position at which the second audio is last played is 5 seconds, so the second audio is triggered to play when the first audio is played to 8 seconds.
[0056] It is worth noting that when the audio engine starts playing the first audio, a first random duration can be calculated, when a first current audio progress of the first audio and a starting point of the first audio are separated by the first random duration, the first current audio progress is determined to be the target audio position, the second audio is played, and a second random duration is calculated, when a second current audio progress of the first audio and the first current audio progress are separated by the second random duration, the second current audio progress is determined to be the target audio position, and the second audio is played again.
[0057] Since the second audio is triggered randomly in the time dimension, the environmental audio formed by the cooperation of the first audio and the second audio also has randomness, and even if the environmental audio is played in a loop, the game player will not feel a sense of repetition in the hearing.
[0058] It should be understood that the audio engine recalculates the random duration each time the second audio is played, and each time the random duration is calculated differently.
[0059] Exemplarily, a random algorithm can be constructed according to the game picture of the virtual scene, and then the random duration is calculated through the random algorithm. The random duration calculated by the random algorithm is negatively correlated with the degree of demand for triggering the second audio in the game picture. For example, when the thunderstorm weather in the game picture gradually strengthens, the more “thunder” needs to be triggered, the smaller the random duration calculated by the random algorithm, so that the current audio progress of the first audio can trigger the playing of the second audio with a larger probability. When the thunderstorm weather in the game picture gradually weakens, the less “thunder” needs to be triggered, the larger the random duration calculated by the random algorithm, so that the current audio progress of the first audio can trigger the playing of the second audio with a smaller probability.
[0060] It should be understood that by determining the size of the random duration according to the virtual scene, the environmental sound effect of the virtual scene can be more consistent with the real situation of the virtual scene to provide a real game atmosphere. For example, when the thunderstorm weather in the virtual scene gradually strengthens, the audio engine plays “thunder” more frequently, and when the thunderstorm weather in the virtual scene gradually weakens, the audio engine plays “thunder” less frequently, thereby simulating real thunderstorm weather in the virtual scene.
[0061] In step 122, the second audio is played when the current audio progress is the target audio position.
[0062] Here, when the electronic device determines that the current audio progress of the first audio played by the audio engine is the target audio position, it is determined to trigger the playing of the second audio, and the second audio is triggered to be played at the current audio progress.
[0063] Thus, in the process of playing the first audio, by judging whether the current audio progress of the first audio played is the target audio position for triggering the playing of the second audio, if it is the target audio position, the playing of the second audio is triggered, so that the playing of the second audio can be triggered randomly in the process of playing the first audio. Thus, the environmental sound effect in the virtual scene will not be felt by the game player, thereby creating a real game atmosphere and improving the experience of the game player.
[0064] Figure 3 is Figure 2 a detailed flowchart of step 122. As Figure 3 shown in some implementable embodiments, step 122, in which the second audio is played when the current audio progress is the target audio position, includes the following steps.
[0065] In step 1221, in a case where it is determined that the current audio progress is the target audio position, a target playing position is determined in the virtual scene.
[0066] Here, after determining that the current audio progress is the target audio position, the electronic device determines a target playing position in the virtual scene. The target playing position refers to a position at which the second audio is played in the virtual scene. It should be understood that the target playing position can be a position of a sound source that triggers playing of the second audio in the virtual scene. For example, when the second audio is "thunder", the target playing position can be a position of "lightning" in the virtual scene; when the second audio is "bird chirping", the target playing position can be a position of "bird" in the virtual scene. Of course, the target playing position can also be randomly determined in the virtual scene.
[0067] As some examples, a target playing area can be constructed with a preset position of the virtual scene as a center point and with a volume of the second audio as a radius, and a position in the target playing area can be randomly determined as the target playing position.
[0068] Here, the preset position of the virtual scene can be a center point of a game screen or a position of a sound source. A target playing area similar to a sphere can be constructed with the preset position as a center point and with the volume of the second audio as a radius. The volume of the second audio as a radius refers to a propagation distance of the second audio in the virtual scene as a radius. Then a position in the target playing area can be randomly selected as the target playing position, and the second audio can be played at the target playing position.
[0069] It should be noted that playing the second audio at the target playing position refers to setting a sound emitter of the second audio at the target playing position and controlling the sound emitter to play the second audio.
[0070] It should be understood that by randomly determining a position in the target playing area as the target playing position, the second audio triggered each time can randomly appear at different positions in the virtual scene, that is, the second audio remains random in the spatial dimension, so as to ensure that the environmental sound effect does not feel repetitive in the hearing of the game player.
[0071] For example, when the second audio is "thunder", the position of "thunder" in the virtual scene is random and can appear in the center of the screen, the left side of the screen, and the right side of the screen, and the like. For another example, when the second audio is "mosquito sound", by randomly determining the target playing position in the target playing area, an atmosphere that "mosquito sound" randomly flies around the ear of the game player can be presented.
[0072] As some other examples, one of a plurality of preset scene positions in the virtual scene can be randomly selected as the target playing position.
[0073] Here, a plurality of preset scene positions can be pre-set in the virtual scene. Of course, the preset scene position can also be determined according to the picture elements in the virtual scene. For example, the position of an object in the virtual scene that can emit the second audio is set as a preset scene position. Illustratively, when the virtual scene is a forest scene, the position of a bird existing in the forest scene in the scene can be set as a preset scene position.
[0074] After randomly selecting one preset scene position from the plurality of preset scene positions as a target playing position, the sound emitter of the second audio is set at the target playing position, and the sound emitter is controlled to play the second audio.
[0075] It should be understood that, by randomly selecting one preset scene position from the plurality of preset scene positions as a target playing position, the second audio triggered each time can randomly appear at different positions in the virtual scene, that is, the second audio is random in the spatial dimension, so as to ensure that the environmental sound effect will not feel repetitive in the hearing of the game player.
[0076] In step 1222, the second audio is played at the target playing position.
[0077] Here, playing the second audio at the target playing position refers to setting the sound emitter corresponding to the second audio at the target playing position, and controlling the sound emitter to play the second audio. It should be understood that, when playing the second audio, the audio engine can also spatialize the second audio, so that the propagation of the second audio in the virtual scene can have a sense of reality.
[0078] Thus, by randomly determining the target playing position in the virtual scene, the same second audio will be triggered at different positions in the virtual scene, so that the second audio is random in the spatial dimension, ensuring that the environmental sound effect will not feel repetitive in the hearing of the game player. For example, in the process of playing "rain sound" in a loop, randomly selecting a target playing position in the virtual scene to play "thunder sound" can make the "thunder sound" not fixed at the same position in the virtual scene, so as to weaken the repetitive feeling of the environmental sound effect and improve the game experience of the game player.
[0079] In some implementable embodiments, in step 110, the audio spectrum corresponding to the sound with the persistence characteristic and the sound with the instantaneous characteristic can be determined according to the audio type of the environmental audio, and the environmental audio is subjected to audio separation processing according to the audio spectrum, to obtain the first audio and the second audio.
[0080] Here, the audio type can refer to the attribute or type of the environmental audio, such as "thunderstorm sound", "streaming water sound", and the like.
[0081] The environmental audio of different audio types can be pre-labeled with the first audio spectrum of the sound with the persistence characteristic and the second audio spectrum of the sound with the instantaneous characteristic. For example, for the environmental audio of "thunderstorm sound", the sound spectrum corresponding to the "rain sound" in the "thunderstorm sound" can be pre-labeled as the first audio spectrum of the sound with the persistence characteristic, and the sound spectrum corresponding to the "thunder sound" can be labeled as the second audio spectrum of the sound with the instantaneous characteristic.
[0082] Of course, in other embodiments, the spectrum with continuous similar sound spectrum can be identified as the first audio spectrum from the environmental audio according to the audio type, and the spectrum with instantaneous sound spectrum can be identified as the second audio spectrum from the environmental audio according to the audio type.
[0083] After determining the audio spectrum, the environmental audio is audio separated according to the audio spectrum, so as to extract the first audio and the second audio from the environmental audio. It should be understood that the audio separation is to extract the sound with the first audio spectrum characteristic in the environmental audio to form the first audio, and to extract the sound with the second audio spectrum characteristic in the environmental audio to form the second audio.
[0084] Thus, the first audio and the second audio can be quickly extracted from the environmental audio by the audio spectrum. It is worth mentioning that for storing all pre-recorded environmental audios in the electronic device or the cloud server, the first audio and the second audio can be extracted by the above-mentioned embodiments.
[0085] Figure 4 is a module connection diagram of an environmental audio playing device according to some embodiments. As shown in Figure 4 The device 400 can include:
[0086] The acquisition module 401 is configured to acquire the first audio and the second audio from the pre-set environmental audio, wherein the first audio is the sound with the persistence characteristic in the environmental audio, and the second audio is the sound with the instantaneous characteristic in the environmental audio.
[0087] The playing module 402 is configured to play the first audio in response to an instruction of playing environmental audio in a virtual scene, and randomly play the second audio in a process of playing the first audio, so that the first audio and the second audio cooperate to form environmental audio of the virtual scene.
[0088] Optionally, the playing module 402 comprises:
[0089] The determining subunit is configured to determine whether a current audio progress of the first audio is a target audio position in a process of playing the first audio.
[0090] The audio subunit is configured to play the second audio in a case where the current audio progress is the target audio position.
[0091] Optionally, the determining subunit is specifically configured to:
[0092] determine a trigger probability at a preset audio position in a case where the current audio progress is the preset audio position;
[0093] determine that the current audio progress is the target audio position in a case where a trigger result calculated according to the trigger probability is a preset result;
[0094] or,
[0095] determine a random time length;
[0096] determine that the current audio progress is a target audio position in a case where the current audio progress and an audio position of last time triggering the playing of the second audio are separated by the random time length.
[0097] Optionally, the audio subunit is specifically configured to:
[0098] determine a target playing position in the virtual scene in a case where it is determined that the current audio progress is the target audio position;
[0099] play the second audio at the target playing position.
[0100] Optionally, the audio subunit is specifically configured to:
[0101] construct a target playing area with a preset position of the virtual scene as a center point and with a volume of the second audio as a radius;
[0102] randomly determine a position in the target playing area as the target playing position;
[0103] or,
[0104] randomly select one of the preset scene positions in the virtual scene as the target playing position.
[0105] Optionally, the apparatus 400 further includes:
[0106] a calculation module, configured to determine the trigger probability or the size of the random duration according to the virtual scene.
[0107] Optionally, the acquisition module 401 is specifically configured to:
[0108] determine that the environmental audio includes audio frequency spectrums corresponding to the persistent feature and the instantaneous feature;
[0109] perform audio separation processing on the environmental audio according to the audio frequency spectrums, to obtain the first audio and the second audio.
[0110] As to the apparatus 400 in the above embodiments, the specific manners in which various modules perform operations have been described in detail in the embodiments of the method, and thus will not be described here in detail.
[0111] Reference will be made to the following description Figure 5 , Figure 5 is a block diagram of an electronic device according to some embodiments. As shown in Figure 5 , it shows a structural schematic diagram of an electronic device 600 suitable for implementing the embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure can include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablet PCs), PMPs (Portable Multimedia Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and the like, as well as fixed terminals such as digital TVs, desktop computers, and the like. Figure 5 The electronic device shown is only an example, and should not bring any limitation to the functions and use range of the embodiments of the present disclosure.
[0112] As shown in Figure 5 , the electronic device 600 can include a processing device (such as a central processor, a graphics processor, etc.) 601, which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 602 or loaded into a random access memory (RAM) 603 from a storage device 608. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0113] In general, the following devices can be connected to the I / O interface 605: input devices 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, and the like; output devices 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, and the like; storage devices 608 including, for example, a magnetic tape, a hard disk, and the like; and communication devices 609. The communication devices 609 can allow the electronic device 600 to communicate wirelessly or wired with other devices to exchange data. Although Figure 5 The electronic device 600 is shown with various devices, but it is understood that all of the shown devices are not required to be implemented or present. More or less devices can alternatively be implemented or present.
[0114] In particular, the processes described above with reference to the flowcharts can be implemented as a computer software program according to embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for executing the methods illustrated by the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network through the communication devices 609, or installed from the storage devices 608, or installed from the ROM 602. When the computer program is executed by the processing devices 601, the above-mentioned functions defined in the methods of embodiments of the present disclosure are performed.
[0115] It is noted that the aforementioned computer-readable medium of the present disclosure can be a computer-readable signal medium or a computer-readable storage medium or any combination thereof. The computer-readable storage medium can be, for example and without limitation, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the computer-readable storage medium can 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 present disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program used by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, the computer-readable signal medium can include a computer-readable program code transmitted by a computer-readable storage medium or carried by a carrier wave in a baseband or as part of a carrier wave. Such a propagated computer-readable signal medium can take various forms, including but not limited to electro-magnetic, optical, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium that can be used to carry or store a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained in the computer-readable medium can be transmitted by any suitable medium, including but not limited to wire, cable, RF (radio frequency), or the like, or any suitable combination of the foregoing.
[0116] In some embodiments, the electronic device can communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with digital data communications of any form or medium (e.g., a communications network). Examples of communications networks include local area networks ("LAN"), wide area networks ("WAN"), internetworks (e.g., the Internet), and end-to-end networks (e.g., ad hoc end-to-end networks), as well as any currently known or future developed networks.
[0117] The aforementioned computer-readable medium can be contained in the aforementioned electronic device; or can exist separately without being assembled into the electronic device.
[0118] The computer readable medium described above carries one or more programs, when the one or more programs are executed by the electronic device, cause the electronic device to: in response to an instruction of playing environmental audio in a virtual scene, obtain a first audio and a second audio from preset environmental audio, wherein the first audio is a sound with a persistence characteristic in the environmental audio, and the second audio is a sound with a transient characteristic in the environmental audio; play the first audio, and randomly play the second audio in a process of playing the first audio, so that the first audio and the second audio cooperate to form environmental audio of the virtual scene.
[0119] Computer program code for carrying out operations of the present disclosure can be written in any one or more of a variety of programming languages or combinations of languages, including an object-oriented programming language such as Java, Smalltalk, C++, or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).
[0120] The flow diagrams and the block diagrams in the drawings are illustrations of architectures, functionalities, and operations of possible implementations of systems, methods, and computer program products according to various embodiments of present disclosure. In this regard, each block in the flow diagrams or block diagrams can represent a module, a segment, or a portion of code, which comprises one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can 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
[0121] The modules involved in the embodiments of the present disclosure can be implemented in the form of software or in the form of hardware. In some cases, the name of the module does not constitute a limitation on the module itself.
[0122] The functionality described above in this document can be performed, at least in part, by one or more hardware logic components. For example, and without limitation, example types of hardware logic components that can be used include Field-programmable Gate Arrays (FPGAs), Application-specific Integrated Circuits (ASICs), Application-specific Standard Products (ASSPs), System-on-a-chip (SOCs), Complex Programmable Logic Devices (CPLDs), etc.
[0123] In the context of the present disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium will include one or more lines of electrical connections, portable computer disks, hard disk drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fibers, portable compact disc read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0124] The above description is only preferred embodiments of the present disclosure and the explanation of the applied technical principles. It should be understood by those skilled in the art that the disclosed scope of the present disclosure is not limited to the technical solutions formed by the specific combinations of the above technical features, and also covers other technical solutions formed by any combinations of the above technical features or equivalent features without departing from the above disclosed concept. For example, the technical solutions formed by replacing the above features with the technical features disclosed in the present disclosure (but not limited to) having similar functions.
[0125] Further, while operations are depicted in a particular order, this should not be understood as requiring the operations to be performed in the particular order shown or in sequential order, and that certain operations can be performed in parallel or in any suitably ordered order. Also, while a number of specific implementation details have been discussed, these should not be construed as limiting the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable sub-combination.
[0126] Although the subject matter has been described in language specific to structural features and / or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims. With respect to the devices in the above-described embodiments, in which various modules perform operations, the specific manner in which the operations are performed by the various modules has been described in detail in the embodiments relating to the method. Here, no detailed explanation will be given.
Claims
1. An environmental audio playback method, characterized in that, include: From a preset ambient audio source, a first audio source and a second audio source are obtained, wherein the first audio source is a sound with continuous characteristics in the ambient audio source, and the second audio source is a sound with transient characteristics in the ambient audio source. In response to an instruction to play ambient audio in a virtual scene, the first audio is played in a loop, and during the looping of the first audio, the second audio is played randomly, so that the first audio and the second audio cooperate to form the ambient audio of the virtual scene; The step of randomly playing the second audio during the loop playback of the first audio includes: During the playback of the first audio, determine whether the current audio progress of the first audio is at the target audio position; If the current audio progress is at the target audio position, play the second audio. Determining whether the current audio progress of the first audio is the target audio position includes: When the current audio progress is at a preset audio position, a probability function is constructed based on the game screen of the virtual scene, and the trigger probability at the preset audio position is determined based on the probability function; the magnitude of the trigger probability determined by the probability function is positively correlated with the degree of need to trigger the playback of the second audio in the game screen; If the trigger result calculated based on the trigger probability is a preset result, the current audio progress is determined to be the target audio position; or, A random algorithm is constructed based on the game screen of the virtual scene, and a random duration is determined by the random algorithm. The magnitude of the random duration determined by the random algorithm is negatively correlated with the degree of need to trigger the playback of the second audio in the game screen. If the current audio progress is separated from the audio position where the second audio was last played by the random time interval, the current audio progress is determined to be the target audio position.
2. The method according to claim 1, characterized in that, When the current audio progress is at the target audio position, playing the second audio includes: If the current audio progress is determined to be the target audio position, the target playback position is determined in the virtual scene; The second audio is played at the target playback position.
3. The method according to claim 2, characterized in that, Determining the target playback position in the virtual scene includes: A target playback area is constructed with the preset position of the virtual scene as the center point and the volume of the second audio as the radius; A location is randomly selected from the target playback area as the target playback position; or, One of the preset scene locations in the virtual scene is randomly selected as the target playback location.
4. The method according to claim 1, characterized in that, The step of obtaining the first audio and the second audio from the preset ambient audio includes: The environmental audio is determined to include the audio spectrum corresponding to sounds having the continuous characteristics and sounds having the transient characteristics. Based on the audio spectrum, the ambient audio is subjected to audio separation processing to obtain the first audio and the second audio.
5. An ambient audio playback device, characterized in that, include: The acquisition module is configured to acquire a first audio and a second audio from a preset ambient audio, wherein the first audio is a sound with continuous characteristics in the ambient audio, and the second audio is a sound with transient characteristics in the ambient audio; The playback module is configured to, in response to an instruction to play ambient audio in a virtual scene, loop the first audio, and, during the looping of the first audio, randomly play the second audio, so that the first audio and the second audio cooperate to form the ambient audio of the virtual scene; The playback module includes: The subunit is configured to determine whether the current audio progress of the first audio is the target audio position during the playback of the first audio. An audio subunit is configured to play the second audio when the current audio progress is at the target audio position; The specific configuration of the determined subunit is as follows: When the current audio progress is at a preset audio position, a probability function is constructed based on the game screen of the virtual scene, and the trigger probability at the preset audio position is determined based on the probability function; the magnitude of the trigger probability determined by the probability function is positively correlated with the degree of need to trigger the playback of the second audio in the game screen; If the trigger result calculated based on the trigger probability is a preset result, the current audio progress is determined to be the target audio position; or, A random algorithm is constructed based on the game screen of the virtual scene, and a random duration is determined by the random algorithm. The magnitude of the random duration determined by the random algorithm is negatively correlated with the degree of need to trigger the playback of the second audio in the game screen. If the current audio progress is separated from the audio position where the second audio was last played by the random time interval, the current audio progress is determined to be the target audio position.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processing device, it implements the steps of the method according to any one of claims 1 to 4.
7. An electronic device, characterized in that, include: A storage device on which computer programs are stored; A processing device for executing the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
An apparatus for and a method of processing reproducible data
CN101099196A
Music data processing method and music data processing system based on face action recognition
CN106503127A
Sound effect adjustment method and apparatus, electronic device, and computer readable storage medium
CN107179908A
Ambient sound implementation method and device, electronic equipment and storage medium
CN114225410A
Systems for generating unique non-looping sound streams from audio clips and audio tracks
US20210178268A1