Audio processing method and device in virtual environment, equipment, medium and product
By adjusting the sound effect parameters according to the relative orientation relationship between the virtual character and the ambient sound source elements in the virtual environment and generating scene audio data, the problem of single sound effects in the existing technology is solved, and the diversity and immersion of the game experience are improved.
Patent Information
- Application Number
- CN202411097912.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-09
- Publication Date
- 2024-12-06
AI Technical Summary
Existing gaming technology is difficult to provide a diverse sound experience in virtual environments, resulting in players hearing the same ambient sound effects on the same map or scene, lacking immersion.
By obtaining the element audio data of the ambient sound source element in the virtual environment, and adjusting the sound effect parameters based on the relative orientation relationship between the main control virtual character and the ambient sound source element, generating spatial audio data and integrating it into scene audio data to provide more diversification sound effect experience.
减少了对计算机设备存储空间的浪费,提升了玩家在虚拟环境中的代入感和音效多样性,提供了更真实的音效体验。
Smart Images

Figure CN119075303A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an audio processing method, device, equipment, medium and product in a virtual environment. Background Art
[0002] During the game, the sound effects played by the terminal play a key role in enhancing the player experience. Well-designed sound effects can make players feel more involved when playing games. Among them, the sound effects in the game include environmental sounds, character dialogues, special effects sounds, background music, etc.
[0003] In the related art, game sound effects are usually realized by a series of pre-recorded sound tracks. That is, the sound tracks corresponding to each sound effect are configured during the development of the game application, and when the player plays the game, it is determined whether the player triggers an event associated with the sound effect to play the pre-recorded sound track. For example, when the player controls the main virtual character to enter a certain map, the pre-recorded background music of the map is played in a loop; when the player controls the main virtual character to interact with a non-player character (NPC), the NPC's dialogue voice is triggered.
[0004] However, the pre-configured soundtracks make the sound effects felt by players during the game experience uniform. For example, different players hear the same ambient sound or background sound in the same map. Summary of the invention
[0005] The present application embodiment provides an audio processing method, device, equipment, medium and product in a virtual environment. The technical solution is as follows:
[0006] On the one hand, a method for audio processing in a virtual environment is provided, the method comprising:
[0007] Acquire element audio data of an ambient sound source element in a virtual environment, wherein the virtual environment includes a master virtual character;
[0008] Based on the relative position relationship between the environmental sound source element and the master virtual character in the virtual environment, obtaining the sound effect parameters corresponding to the environmental sound source element;
[0009] Adjusting the element audio data based on the sound effect parameter to generate spatial audio data corresponding to the environmental sound source element, wherein the spatial audio data is used to express the perceived effect of the master virtual character on the audio generated by the environmental sound source element in the relative position relationship;
[0010] Scene audio data is generated based on the spatial audio data, where the scene audio data is the perception effect of the master virtual character on at least one audio generated in the virtual environment.
[0011] In another aspect, a device for audio processing in a virtual environment is provided, the device comprising:
[0012] A first acquisition module is used to acquire element audio data of an environmental sound source element in a virtual environment, wherein the virtual environment includes a master virtual character, and the environmental sound source element is a sound source that generates audio in the virtual environment;
[0013] A second acquisition module is used to acquire the sound effect parameters corresponding to the environmental sound source elements based on the relative position relationship between the environmental sound source elements and the master virtual character in the virtual environment;
[0014] A generating module, configured to adjust the element audio data based on the sound effect parameter to generate spatial audio data corresponding to the environmental sound source element, wherein the spatial audio data is used to express the perceived effect of the audio generated by the environmental sound source element by the master virtual character in the relative position relationship;
[0015] The generation module is further used to generate scene audio data based on the spatial audio data, and the scene audio data is the perception effect of the master virtual character on at least one audio generated in the virtual environment.
[0016] In some optional embodiments, the second acquisition module further includes:
[0017] A first acquisition unit is used to acquire first position information of the environmental sound source element in the virtual environment; and acquire second position information of the master virtual character in the virtual environment;
[0018] A first determining unit, configured to determine the relative position relationship between the environmental sound source element and the master virtual character based on the first position information and the second position information;
[0019] The first generating unit is used to generate the sound effect parameter corresponding to the environmental sound source element based on the relative orientation relationship.
[0020] In some optional embodiments, the first determining unit is further used to determine, based on the relative position relationship, a sound propagation path of the audio generated by the environmental sound source element between the environmental sound source element and the master virtual character;
[0021] The first generating unit is further used to generate sound effect parameters corresponding to the environmental sound source elements based on the sound propagation path.
[0022] In some optional embodiments, the first determining unit is further used to determine, based on the relative orientation relationship, a first propagation path of the audio generated by the environmental sound source element directly propagating from the environmental sound source element to the master virtual character; based on the relative orientation relationship, determine a second propagation path of the audio generated by the environmental sound source element propagating to the master virtual character after being reflected in the virtual environment;
[0023] The first generating unit is further used to determine the sound effect parameter corresponding to the environmental sound source element based on the first propagation path and the second propagation path.
[0024] In some optional embodiments, the first determining unit is further configured to determine a field of view corresponding to the master virtual character based on the orientation of the master virtual character in the virtual environment;
[0025] The first generating unit is further used to determine the sound effect parameter based on the first parameter when the ambient sound source element is within the field of view; and to determine the sound effect parameter based on the second parameter when the ambient sound source element is outside the field of view; wherein the audio volume corresponding to the first parameter is greater than the audio volume corresponding to the second parameter.
[0026] In some optional embodiments, the environmental sound source elements include space elements forming a virtual space in the virtual environment, and the master virtual character is in the virtual space;
[0027] The first determining unit is further configured to determine, based on the relative orientation relationship, surrounding state information of the spatial element on the master virtual character;
[0028] The first generating unit is further used to determine the space type of the virtual space where the master virtual character is located based on the surrounding state information; and obtain sound effect parameters matching the space type.
[0029] In some optional embodiments, the first determining unit is further configured to determine distance information between the master virtual character and the environmental sound source element based on the relative orientation relationship;
[0030] The first generating unit is further used to determine, based on the distance information, an attenuation parameter and a delay parameter corresponding to the audio generated by the ambient sound source element; and to determine the sound effect parameter based on the attenuation parameter and the delay parameter.
[0031] In some optional embodiments, the first acquisition module is also used to acquire scene data of the virtual environment, wherein the scene data includes element data of multiple candidate environmental elements; the scene data is input into a pre-trained scene recognition model, and the environmental sound source element is obtained by screening from the multiple candidate environmental sound source elements. The scene recognition model is used to identify the sound source that generates audio in the virtual environment as the environmental sound source element in combination with the overall situation of the virtual environment.
[0032] In some optional embodiments, the environmental sound source element includes a character element, and the character element is used to indicate a scene virtual character other than the master virtual character in the virtual environment;
[0033] The first acquisition module further includes:
[0034] a second acquisition unit, configured to acquire the dialogue data and character feature information of the character element, wherein the character feature information is used to describe the attributes of the scene virtual character, wherein the attributes of the scene virtual character include at least one of basic attributes and situational performance attributes of the scene virtual character, wherein the basic attributes are attributes pre-configured for the scene virtual character, and the situational performance attributes are attributes determined in real time by the scene virtual character in the situation of the virtual environment;
[0035] The second generating unit is used to generate a character voice matching the character feature information according to the dialogue data as element audio data corresponding to the character element.
[0036] In some optional embodiments, the character characteristic information includes at least one of character basic information, character emotion information, and character behavior information;
[0037] The basic character information is used to indicate the basic character situation of the scene virtual character;
[0038] The character emotion information is used to indicate the emotional state of the scene virtual character in the dialogue scenario corresponding to the line data;
[0039] The character behavior information is used to indicate the actions performed by the scene virtual character in the dialogue scenario;
[0040] Among them, different character feature information corresponds to different character voice performances.
[0041] In some optional embodiments, the second generation unit is further used to input the dialogue data and the role feature information into a pre-trained speech generation model to obtain the role voice as the element audio data, and the speech generation model is used to generate a voice that matches the role feature information of the scene virtual character.
[0042] In some optional embodiments, the speech generation model includes a text encoder, a role encoder and a decoder;
[0043] The second generation unit is further used to input the dialogue data into the text encoder to obtain a text encoding representation; input the character feature information into the character encoder to obtain a character encoding representation; fuse the text encoding representation and the character encoding representation to obtain a joint encoding representation; input the joint encoding representation into the decoder to generate the character voice.
[0044] In some optional embodiments, the second generating unit is further used for, when the character characteristic information includes basic character information, inputting the basic character information into the first sub-encoder to obtain a first character coding representation; when the character characteristic information includes emotional character information, inputting the emotional character information into the second sub-encoder to obtain a second character coding representation; when the character characteristic information includes behavioral character information, inputting the behavioral character information into the third sub-encoder to obtain a third character coding representation.
[0045] In some optional embodiments, the second acquisition unit is further used to acquire speech rate setting information corresponding to the character element, where the speech rate setting information is used to indicate the speech rate setting of the scene virtual character;
[0046] The first acquisition module further includes:
[0047] A second determining unit, configured to determine an estimated playback duration corresponding to the dialogue data based on the speech rate setting information;
[0048] The second acquisition unit is further used to acquire the voice duration corresponding to the character's voice;
[0049] An adjustment unit is used to adjust the playback speed of the character's voice based on the difference between the voice duration and the estimated duration.
[0050] In some optional embodiments, the first acquisition unit is further used to acquire first position information of the character element in the virtual environment; and acquire second position information of the master virtual character in the virtual environment;
[0051] The first generating unit is further configured to generate a tone adjustment parameter when the position distance between the first position information and the second position information reaches a first threshold, wherein the tone adjustment parameter is used to adjust the tone of the character's voice; and determine the sound effect parameter based on the tone adjustment parameter.
[0052] In some optional embodiments, the device further comprises:
[0053] A receiving module, configured to receive a natural language command from a first account for the character element, wherein the first account is an account for controlling the master virtual character;
[0054] The second generating unit is further used to continuously generate a plurality of speech segments of the character element based on the natural language command to form the speech data, and record a first start timestamp and a first end timestamp when each speech segment is generated; when the i-th speech segment is generated, generate an i-th character segment voice matching the character feature information according to the i-th speech segment as the element audio data, and record a second start timestamp and a second end timestamp when the i-th character segment voice is generated, where i is a positive integer;
[0055] The second determining unit is further configured to determine a first difference between the first start timestamp and the second start timestamp; determine a second difference between the first end timestamp and the second end timestamp;
[0056] The adjustment unit is further used to adjust the transmission speed of sending the scene audio data corresponding to the i-th dialogue segment to the terminal based on the difference between the first difference and the second difference.
[0057] In some optional embodiments, the first acquisition unit is further used to acquire environmental sound information corresponding to the natural language command, where the environmental sound information is used to indicate information related to background environmental sound in the voice when the voice including the natural language command is collected;
[0058] The first generating unit is further configured to generate a tone adjustment parameter of the character's voice based on the ambient sound information; and determine the sound effect parameter based on the tone adjustment parameter.
[0059] In some optional embodiments, the ambient sound information includes the ambient volume, and the tone height corresponding to the tone adjustment parameter is positively correlated with the size of the ambient volume; or, the ambient sound information includes the environment identification type corresponding to the background ambient sound, when the environment identification type is an Internet cafe type, the tone adjustment parameter corresponds to a first tone, when the environment identification type is a day bedroom, the tone adjustment parameter corresponds to a second tone, and when the environment identification type is a night bedroom, the tone adjustment parameter corresponds to a third tone, wherein the first tone is higher than the second tone, and the second tone is higher than the third tone.
[0060] In some optional embodiments, the sound source generating the audio in the virtual environment includes a plurality of environmental sound source elements;
[0061] The first acquisition unit is further used to acquire a grid structure of the virtual environment, where the grid structure is used to indicate a scene division result of dividing the virtual environment by grids, and the grid structure includes a plurality of grid points;
[0062] The first determining unit is further used to determine the first grid points corresponding to the multiple ambient sound source elements respectively based on the positions of the multiple ambient sound source elements in the virtual environment, and the multiple ambient sound source elements correspond to at least one first grid point;
[0063] The first generating unit is further configured to generate sound cache data corresponding to the first grid point based on the element audio data;
[0064] The first determining unit is further configured to determine a second grid point corresponding to a position of the master virtual character in response to the master virtual character entering the virtual environment;
[0065] The first generating unit is further configured to generate a sound effect parameter corresponding to the first grid point based on a relative position relationship between the first grid point and the second grid point;
[0066] The generation module is also used to generate the element audio data corresponding to the first grid point based on the sound cache data and the sound effect parameters corresponding to the first grid point; and integrate the element audio data of at least one first grid point to obtain the scene audio data.
[0067] On the other hand, a computer device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the audio processing method in a virtual environment as described in any of the above-mentioned embodiments of the present application.
[0068] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction, at least one program, a code set or an instruction set is stored in the storage medium, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the audio processing method in a virtual environment as described in any of the above-mentioned embodiments of the present application.
[0069] On the other hand, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the audio processing method in a virtual environment described in any of the above embodiments.
[0070] The technical solution provided by this application includes at least the following beneficial effects:
[0071] When the player controls the main virtual character to move in the virtual environment, the sound effect parameters of the environmental sound source elements are obtained according to the relative position relationship between the main virtual character and the environmental sound source elements in the virtual environment as the sound source, and the element audio data is adjusted by the sound effect parameters to obtain spatial audio data, and the spatial audio data in the virtual environment is integrated to obtain the scene audio data provided to the client. Since the scene audio data is generated in real time based on the relative position relationship between the main virtual character and the environmental sound source elements, the application that provides the virtual environment does not need to pre-configure too many application resources in order to improve the diversity of sound effect performance effects, which reduces the waste of storage space of the computer device running the above application.
[0072] At the same time, after the sound effect parameters are adjusted, the element audio data corresponding to the environmental sound source elements can simulate the perception effect of the main virtual character on the audio generated by the environmental sound source elements under the current relative position relationship, and then generate scene audio data of the virtual environment through the spatial audio data, so that the scene audio played by the computer device can enable the player to replace the main virtual character to perceive at least one audio generated in the virtual environment, thereby enhancing the diversity of sound effects felt by the player during the game, thereby enhancing the player's sense of substitution in the virtual environment and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0074] Figure 1 is a flow chart of a solution for commanding non-player characters in a virtual environment using natural language commands in the form of voice, provided by an exemplary embodiment of the present application;
[0075] Figure 2 is a structural block diagram of a computer system provided by an exemplary embodiment of the present application;
[0076] Figure 3 is a flowchart of an audio processing method in a virtual environment provided by an exemplary embodiment of the present application;
[0077] Figure 4 is a flowchart of an audio processing method in a virtual environment provided by an exemplary embodiment of the present application;
[0078] Figure 5is a schematic diagram of a grid structure provided by an exemplary embodiment of the present application;
[0079] Figure 6 is a schematic diagram of a reverberant sound wave provided by an exemplary embodiment of the present application;
[0080] Figure 7 is a flowchart of an audio processing method in a virtual environment provided by an exemplary embodiment of the present application;
[0081] Figure 8 is a schematic diagram of a speech generation model provided by an exemplary embodiment of the present application;
[0082] Fig. 9 is a schematic diagram of an audio feedback system provided by an exemplary embodiment of the present application;
[0083] Fig.10 is a flow chart of a method for controlling a virtual character provided by an exemplary embodiment of the present application;
[0084] Fig.11 is a structural block diagram of an audio processing device in a virtual environment provided by an exemplary embodiment of the present application;
[0085] Fig.12 is a structural block diagram of an audio processing device in a virtual environment provided by an exemplary embodiment of the present application;
[0086] Fig.13 It is a schematic diagram of the structure of a server provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0087] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0088] The embodiments of the present application provide a solution for users to use natural language commands in the form of voice to command non-player characters in a virtual environment. In this solution, in addition to the main virtual character controlled by the user, the user usually has one or more NPCs as teammates. The user can use a relatively casual human conversation method rather than a mechanical command to command the NPC to make the desired feedback to the scene objects in the virtual environment, thereby commanding the NPC to work with the main virtual character to complete the task. Exemplary reference Figure 1 , the user controls the main virtual character 10 to play the game, and the main virtual character 10 has an NPC teammate 20. There is a car 30 in the field of vision of the main virtual character 10. The user speaks a natural voice command in the form of speech: "No. 2, you go to ambush behind the car 30", and then the NPC teammate 20 will move to the back of the car 30 to ambush. It should be noted that Figure 1There may be multiple cars in the scene shown, and the NPC teammate 20 will accurately understand that the car the user is talking about is the car 30 located within the user's field of vision. That is, the NPC teammate 20 has a relatively intelligent natural language understanding ability.
[0089] On the one hand, compared with the traditional technology of using mechanical fixed instructions to command NPC, the embodiment of the present application uses relatively random natural language commands to command NPC, which can provide users with more natural, more complex and more flexible language command capabilities.
[0090] On the other hand, the intelligence of the natural language understanding capability provided by the embodiment of the present application is reflected in that when understanding natural language commands, NPC teammates not only consider the literal information of natural language commands. NPC teammates will also combine the main virtual character and / or the NPC's own environmental perception information in the virtual environment to assist in understanding the semantics in natural language commands. That is, NPC not only considers the information of the natural language command mode, but also considers the perception information of other modes such as vision, hearing, radar, etc. to assist in the understanding and execution of natural language commands. Since natural language commands in the form of voice are spoken commands rather than written commands, there may be multiple candidate understanding methods or unclear places when considering the literal information of natural language commands alone. NPC teammates can determine a reasonable understanding method from multiple candidate understanding methods, or eliminate doubts about unclear places, by combining the main virtual character and / or the NPC's own environmental perception information in the virtual environment, thereby achieving a more intelligent natural language understanding capability. The above-mentioned environmental perception information includes, but is not limited to, at least one of the following:
[0091] Visual information perceived within the field of vision of the controlling virtual character;
[0092] Auditory information perceived within the hearing range of the controlling virtual character;
[0093] The information perceived by the master virtual character’s perception skills or perception tools;
[0094] Visual information perceived within the NPC's field of view;
[0095] Auditory information perceived within the NPC's hearing range;
[0096] Information perceived by the NPC's perception skills or perception tools.
[0097] Combined with reference Figure 1 The program includes at least one of the following five stages:
[0098] Phase 1: Preprocessing of spatial data;
[0099] The server will pre-process the scene objects in the virtual environment and construct the spatial data of the virtual environment.
[0100] The spatial data of the virtual environment includes the visual labels of scene objects and the spatial positions of scene objects. In some examples, the spatial data also includes the appearance images of scene objects. Scene objects are any objects that appear in the virtual environment, such as Figure 1 Cars, walls, boxes, etc.
[0101] First, the pre-acquisition process of the visual labels of the scene objects is introduced. The attribute information of the scene objects in the virtual environment is obtained, such as at least one of the information of the name and size of the scene objects; and the appearance image of the scene objects is obtained, and the appearance image includes an image obtained by observing the scene objects from at least two perspectives. Observing the scene objects from multiple perspectives can ensure that the appearance image carries comprehensive appearance information of the scene objects.
[0102] The server calls the multimodal model to predict the attribute information and appearance image of the scene object. Based on the multimodal model's ability to process text dimension and image dimension information, it extracts hidden features from the attribute information of the text dimension and the appearance image of the image dimension, and decodes the hidden features to predict the visual label of the scene object. The visual label is used to describe the scene object in at least one dimension in a textual manner; for example, the scene object is described in dimensions such as material, transparency, color, and shape. The natural language model is called to optimize the visual label to obtain the visual label of the scene object; the natural language model has the ability to generate text, and rewrites the visual label input to the natural language model in a manner that conforms to the spoken expression of natural language, thereby optimizing the visual label and obtaining the optimized visual label of the scene object. The optimized visual label conforms to the spoken expression of natural language, and describes the scene object in at least one dimension in a manner close to the spoken expression.
[0103] For example, when describing a virtual bed in a virtual environment in spoken language, people usually pay attention to the color, material, and placement of the virtual bed, but usually neglect to pay attention to the craftsmanship used for the headboard and the side panels of the bed, such as carving, embossing, etc. The purpose of performing pseudo-spoken rewriting on the visual labels of scene objects is to obtain matching labels that are closer to spoken expressions; for example, using multiple words with the same semantics to enrich the labels of dimensions such as color, material, and placement that are paid attention to in spoken expressions, and deleting the labels of the surface feature dimensions of the headboard and the side panels of the bed that are neglected in spoken expressions.
[0104] Next, the spatial position of the scene object is introduced. The spatial position includes at least one of the following of the scene object: coordinate position (Location), such as the coordinate information of the center point or preset point of the scene object in the virtual environment; orientation (Rotation), such as the direction the front of the scene object faces in the virtual environment; bounding box (Bounding Box), used to indicate the size of the scene object in the virtual environment; cover points, used to indicate the recommended virtual character position points when the virtual character approaches the scene object, so that the scene object can cover the virtual character.
[0105] Next, the process of pre-acquiring the appearance image of the scene object is introduced. The appearance image is acquired in the process of predicting the visual label of the scene object, and the appearance image includes images obtained by observing the scene object from at least two perspectives.
[0106] Optionally, the spatial data of each scene object in the entire virtual environment may be pre-acquired and organized into a data set for use in a subsequent query process.
[0107] Phase 2: Speech recognition and intent recognition;
[0108] When the user controls the main virtual character, the terminal receives the natural language command input by the user in the form of voice; the server performs voice recognition and intent recognition on the natural language command to analyze the user's input instruction;
[0109] Speech recognition is to perform text conversion on the natural language instructions input by the user through voice, obtain the instruction text corresponding to the natural language instructions, and convert the speech information into text information. Call the encoding network to perform feature encoding on the instruction text to obtain the feature representation of the natural language instructions in the latent space; call the text segmentation network to perform segmentation on the feature representation to obtain multiple clauses in the instruction text, and then perform intent recognition on each of the multiple clauses. In the case that the natural language instructions input by the user through voice are long sentences, the segmentation of the instruction text corresponding to the natural language instructions can be achieved to meet the needs of analyzing the user's input instructions in the long sentence scenario.
[0110] The following introduces the intent recognition of each clause; the user's input instruction is obtained through intent recognition, and the user's input instruction includes an entity, a semantic type, a subject type, and an intent type in at least one clause.
[0111] On the one hand, the Conditional Random Field (CRF) method is used to identify entities in clauses, such as identifying entities in clauses as scene objects such as buildings, virtual items, and virtual vegetation in virtual environments. The entities in the clauses are used to indicate the scene objects targeted by the virtual activities. For example, if the entity in the clause is a virtual building, and the clause carries the semantics of instructing the NPC to launch a virtual attack, then the virtual attack is executed against the virtual building, that is, a virtual attack is launched against the virtual building. On the other hand, the prediction network is called to predict the semantic type, subject type, and intention type in the clause respectively. Among them, the semantic type includes whether to instruct the NPC to launch a virtual attack; the subject type is used to indicate that the subject of the clause is one or more NPCs, or a master virtual character controlled by the user; the intention type is the expected virtual activity indicated by the clause, such as moving, launching a virtual attack, etc.
[0112] Phase 3: Query of spatial data;
[0113] For the entity in the input command, it is necessary to determine the spatial position of the entity in the virtual environment. In the case where there are multiple candidate entities in the virtual environment that match the entity in the input command, the target entity that matches the input command can be uniquely determined from the multiple candidate entities in combination with the environmental perception information of the main virtual character and / or NPC.
[0114] For example, the environment perception information is the field of view information of the main virtual character, the spatial data in the virtual environment is used as the query range, and the real-time position and orientation of the main virtual character is used as the query reference condition to query the spatial position of the target entity corresponding to the input instruction in the virtual environment, so as to subsequently control the NPC to move to the vicinity of the target entity, or to perform the behavior indicated by the input instruction on the target entity.
[0115] However, since the main virtual character and / or NPC may have multiple environmental perception information, multiple environmental perception information can be integrated to assist the determination process of the above-mentioned target entity, or multiple environmental perception information can be used according to priority to assist the determination process of the above-mentioned target entity, and there is no limitation on this.
[0116] Stage 4: NPC voice feedback;
[0117] NPC will give voice feedback to the user. The types of voice feedback include: at least one of instant feedback, command execution feedback, and dynamic feedback. Among them, instant feedback means that after the user issues a natural language command to the NPC, the NPC immediately gives voice feedback on the natural language command, such as "received", "start execution", "OK", etc.; execution command feedback means that after the NPC executes the control command indicated by the intention of the natural language command, the NPC gives voice feedback on the execution result of the control command, such as "successful execution", "failed to execute successfully", etc.; dynamic feedback means that when the user does not issue a natural language command to the NPC, the NPC gives voice feedback based on real-time environmental perception.
[0118] The above-mentioned voice feedback is obtained by converting text content into speech. The text content is inferred by a large language model combined with the above-mentioned spatial data and dynamic environmental perception information. Using a large language model to dynamically generate the text content of voice feedback can, on the one hand, break through the monotonous, mechanical, and easily repetitive voice feedback of fixed templated voice feedback; on the other hand, it does not need to save too many pre-made template voices in advance, which can avoid the problem of too large a total data volume on the client.
[0119] Stage 5: NPC behavior control;
[0120] Taking the user's input as input, and the spatial data of the virtual environment and the runtime information corresponding to the main virtual character as reference, the AI model is used to determine the target entity in the virtual space and the control instructions for the NPC;
[0121] Control instructions are instructions that can be used for NPC behavior tree execution; the subsequent actions that the control instruction indicates the NPC needs to perform can be a single action or a sequence of actions. In the case where the control instruction is a multi-action sequence instruction, the multi-action sequence instruction is used to instruct the NPC to perform a sequence of actions. The data structure storing the multi-action sequence instruction is in the form of a list, and the instructions to be executed in the sequence instruction are cached. When the NPC's behavior tree executes the current instruction, the cache is called back, and the instructions to be executed in the cache are continued to be sent for execution.
[0122] Hot word update function:
[0123] For phase 2, this solution also introduces a hot word system to improve the accuracy of speech recognition.
[0124] The hot word system is used to provide scene hot words related to the scenes involved in the natural language instructions during the speech recognition process, so that when a natural language instruction input by voice is received, it can preferentially search for words from the hot word library as the instruction analysis result based on the currently running virtual environment, so that the match between the instruction analysis result and the virtual environment is higher.
[0125] The virtual environment includes at least one of a plurality of virtual environments such as a virtual battle scene, a virtual transaction scene, a virtual office scene, and a virtual kitchen scene. Frequently used words in a plurality of virtual environments, specific virtual elements existing in a virtual environment, etc. (such as virtual buildings and virtual characters that only exist in a particular scene type, etc.) are pre-analyzed as scene hot words, and a scene hot word library consisting of a plurality of scene hot words is obtained, and the plurality of scene hot words correspond to virtual environments respectively. In addition, different scene language models are pre-trained for different virtual environments, such as a scene language model in a battle scene that pays more attention to words related to battle, and a scene language model in a transaction scene that pays more attention to words related to transaction; the scene language model can perform a more targeted analysis of natural language commands received in a virtual environment.
[0126] For example: when a natural language command is received during the process of a user controlling a non-player controlled character, based on the game state, object position and current task completion status, it is determined that the first virtual environment in which the target virtual character (at least one of the main virtual character and the non-player controlled character) is currently located is a virtual battle scene, and a battle scene language model corresponding to the virtual battle scene is obtained, and based on the field of view of the target virtual character, the first scene hot words in the virtual battle scene are obtained, including: "truck", "virtual grass", "virtual house", "enter", "open truck", "defense", "desert", "attack", "oak tree", "stable", etc. Under the constraints of the first scene hot words, the natural language command is decoded and processed by a pre-trained natural language analysis model (including acoustic network, language network, preset dictionary, etc.), and the instruction analysis result is output to accurately control the non-player controlled character. The instruction analysis result is illustrated as follows.
[0127] (1) The command analysis result is "No. 1, you go to the front Defense The command analysis result can be used to specifically control No. 1 to move forward and make a defensive posture, preventing the enemy virtual character from attacking the main control virtual character first; if there is no constraint of the hot words in the first scene, the natural language command is easily recognized as "No. 1, go to the front and make a sound", thereby affecting the player's virtual combat plan.
[0128] (2) The command analysis result is "No. 2, you go desert The command analysis result can be used to specifically control No. 2 to move to the desert to check whether there are virtual elements such as enemy virtual characters or virtual treasure chests. If there is no constraint of the hot words in the first scene, it is easy to recognize the natural language command as "No. 2, you go Mountains "Explore it", which causes No. 2 to move to the wrong position, and the human-computer interaction efficiency is low.
[0129] (3) The command analysis result is "No. 1, No. 2, give me attack ", the command analysis result can be used to specifically control No. 1 and No. 2 to carry out virtual attacks on nearby attackable virtual characters; if there is no constraint of the hot words in the first scene, it is easy to recognize the natural language command as "No. 1 No. 2, give me supply ", causing No. 1 and No. 2 to make incorrect behaviors that do not meet the players' expectations, which can neither protect the main virtual character nor easily allow the enemy virtual character to win the virtual game.
[0130] (4) The command analysis result is “No. 1, go find a nearby oak tree”. This command analysis result can be used to specifically control No. 1 to find an oak tree in the nearby area so that he can complete the game task or find an oak tree that can avoid attacks. If there is no constraint of the hot words in the first scene, it is easy to recognize the natural language command as “No. 1, go find a nearby oak tree”. Project Book ", causing No. 1 to search nearby for virtual elements that do not meet the player's expectations and fail to meet the player's virtual combat needs.
[0131] (5) The command analysis result is "No. 1, No. 2, go over there stable OK", the command analysis result can be used to specifically control No. 1 and No. 2 to search for nearby stables and move to the location of the stables; if there is no constraint of the hot words in the first scene, it is easy to recognize the natural language command as "No. 1, No. 2, go over there , right away OK", which makes No. 1 and No. 2 mistakenly believe that the main virtual character currently hopes to complete the virtual game by itself, and therefore cannot provide good game assistance to the main virtual character.
[0132] Ambient sound function:
[0133] In addition, the solution also provides a spatial audio enhancement solution for the ambient sound effects of the entire virtual environment.
[0134] The audio played by the terminal includes environmental audio and NPC audio. Environmental audio is the audio generated based on the scene characteristics of the virtual environment in which the main virtual character is currently located, so that the user can feel immersive; NPC audio is the audio generated based on the characteristics of the NPC, so that the user can intuitively feel the character's emotions and physical state through the sound heard.
[0135] Environmental audio: Identify the scene elements in the virtual environment where the main virtual character is located, generate appropriate element sound effects in real time based on the scene elements / select appropriate element sound effects from the sound effect library, and synthesize the element sound effects to obtain environmental audio. For example, if the virtual environment is a forest at night, the scene elements include trees, owls, insects, etc., and the environmental audio includes the rustling of leaves, the calls of owls, the chirping of insects, etc.
[0136] NPC audio: Determine the NPCs included in the virtual environment, and generate corresponding character voices based on the NPC's character type, current emotion, and current behavior. For example, if the NPC is a middle-aged man running, the generated character voice is a deep male voice with the sound of panting when running.
[0137] When the terminal plays the ambient audio and / or NPC audio to the user, the terminal performs audio enhancement processing on the ambient audio and / or NPC audio to improve the realism of the audio.
[0138] Figure 2 The structure block diagram of a computer system provided by an exemplary embodiment of the present application is shown. The computer system 200 includes: a terminal 220 and a server 240 .
[0139] The terminal 220 has installed and runs an application supporting a virtual environment. The application may be any one of a virtual reality application, a three-dimensional map program, a third-person shooter (TPS) game, a first-person shooter (FPS) game, a multiplayer online tactical competitive (MOBA) game, and a multiplayer gunfight survival game.
[0140] The device type of the terminal 220 includes at least one of a game console, a desktop computer, a smart phone, a tablet computer, an e-book reader, a Moving Picture Experts Group Audio Layer III (MP3) player, a Moving Picture Experts Group Audio Layer IV (MP4) player, and a laptop computer. The following embodiments are described by taking the device as a desktop computer as an example.
[0141] The terminal 220 is connected to the server 240 via a wireless network or a wired network.
[0142] Those skilled in the art will appreciate that the number of the above devices may be more or less. For example, the above device may be only one, or the above devices may be dozens or hundreds, or more. The embodiment of the present application does not limit the number and type of devices.
[0143] The server 240 includes at least one of a single server, multiple servers, a cloud computing platform, and a virtualization center. The server 240 is used to provide background services for applications that support a three-dimensional virtual environment. Optionally, the server 240 undertakes the main computing work, and the terminal 220 undertakes the secondary computing work; or, the server 240 undertakes the secondary computing work, and the terminal 220 undertakes the main computing work; or, the server 240 and the terminal 220 adopt a distributed computing architecture for collaborative computing.
[0144] It is worth noting that the above-mentioned server 240 can be implemented as a physical server or as a cloud server in the cloud.
[0145] Schematically, the terminal 220 runs an application that can provide a virtual environment. Taking the application as a game application as an example, the user logs in to the game application through the first account, triggers the virtual environment start operation in the game application, and the terminal 220 sends a scene audio acquisition request of the virtual environment to the server 240 in response to receiving the virtual environment start operation. After receiving the scene audio acquisition request, the server 240 determines the virtual environment that the main control virtual character corresponding to the first account is to enter, obtains the element audio data of the environmental sound source element in the virtual environment, obtains the sound effect parameters corresponding to the environmental sound source element based on the relative position relationship between the environmental sound source element and the main control virtual character in the virtual environment, adjusts the element audio data based on the sound effect parameters, and generates spatial audio data corresponding to the environmental sound source element. The spatial audio data is used to express the perceived effect of the main control virtual character on the audio generated by the environmental sound source element under the relative position relationship, and generates scene audio data based on the spatial audio data. The server 240 sends the generated scene audio data to the terminal 220. After receiving the scene audio data, the terminal 220 plays the scene audio corresponding to the scene audio data while displaying the virtual environment screen of the virtual environment.
[0146] In some embodiments, when the user controls the main virtual character to move in the virtual environment, the server 240 generates corresponding scene audio data for the terminal 220 in real time according to the position change of the main virtual character in the virtual environment.
[0147] It is worth noting that the calculations of these methods provided in the embodiments of the present application can be completely executed by the client in the terminal 220, such as a stand-alone game; it can also be completely executed by the server 240, such as in a cloud game, where the server performs all calculations and the client is only responsible for displaying and collecting the user's operation behavior; the client and server 240 can also collaborate, with the client being responsible for one part and the server 240 being responsible for another part, which is not limited here.
[0148] In some embodiments, the method provided in the embodiments of the present application can be applied to a cloud gaming scenario, so that the calculation of data logic during the game is completed through the cloud server, while the terminal is responsible for the display of the game interface.
[0149] In some embodiments, the server 240 may also be implemented as a node in a blockchain system.
[0150] In combination with the above-mentioned noun introduction and application scenarios, the method for displaying virtual items provided by the present application is described, and the method is described by taking the execution of the method by the server as an example. Figure 3 As shown, the method includes the following steps 310 to 330.
[0151] Step 310, obtaining element audio data of environmental sound source elements in the virtual environment.
[0152] The virtual environment is a scene provided when the application is running on the terminal. Optionally, the virtual environment can be any one of a two-dimensional virtual environment, a 2.5-dimensional virtual environment and a three-dimensional virtual environment.
[0153] In the embodiment of the present application, the virtual environment includes a master virtual character, which is a virtual character controlled by the user through the first account. The master virtual character is a virtual character that is currently controlled by the terminal and is active in the virtual environment.
[0154] Optionally, the method provided in the embodiment of the present application may be applied to a virtual environment that the controlling virtual character is about to enter, or the method provided in the embodiment of the present application may also be applied to a virtual environment in which the controlling virtual character is currently located.
[0155] Optionally, the above virtual environment may be implemented as a two-dimensional virtual environment or a three-dimensional virtual environment, which is not limited here.
[0156] In an embodiment of the present application, the above-mentioned environmental sound source element is used to indicate the sound source that generates audio in the virtual environment. Optionally, the above-mentioned environmental sound source element can be implemented as a character element, a space element, a prop element, and an environmental element in the virtual environment. Among them, the character element is used to indicate the virtual characters existing in the virtual environment; for example, NPCs, hostile virtual characters, teammate virtual characters, etc., the space element is used to indicate the elements that form the virtual space in the virtual environment; for example, virtual buildings, virtual terrain (for example, grasslands, caves, mountains, canyons, etc.); the prop element is used to indicate the virtual props existing in the virtual environment, for example, attack props, virtual throwing objects, interactive virtual props, etc.; the environmental element is used to indicate the environment-related elements in the virtual environment, for example, virtual animals, virtual plants, virtual streams, etc.
[0157] It is worth noting that the above-mentioned NPC is a virtual character with autonomous behavior capabilities. In the solution of the embodiment of the present application, the user can command the NPC through natural language commands, that is, the user gives commands, and the NPC understands and executes the commands based on its own autonomous behavior capabilities.
[0158] Optionally, the determination of the ambient sound source element may be implemented in at least one of the following ways:
[0159] The first type is that the environmental sound source elements are scene elements preset in the virtual environment.
[0160] In some embodiments, the environmental sound source element can be implemented as a sound source that emits audio in a virtual environment, that is, at least one environmental sound source element is pre-set in the virtual environment. In an illustrative manner, a correspondence table between the virtual environment and the environmental sound source element is obtained, a scene identifier of the virtual environment currently located / entered by the master virtual character is obtained, and the environmental sound source element corresponding to the virtual environment is queried from the above correspondence table according to the scene identifier.
[0161] The second type is that the environmental sound source element is a scene element determined after detecting the scene state of the virtual environment.
[0162] In some embodiments, a virtual environment with the same layout emits different audio sound sources in different scene states. For example, when the virtual environment is a forest at night, the environmental sound source elements in the virtual environment include insects, owls, leaves blown by the wind, etc.; when the virtual environment is a forest during the day, the scene sound sources in the virtual environment include birds, virtual characters, vehicles, etc.
[0163] Illustratively, scene data of a virtual environment is obtained, the scene data including element data of a plurality of candidate environmental elements, a scene state of the virtual environment is identified based on the scene data, and at least one ambient sound source element is determined from the plurality of candidate environmental elements based on the scene state.
[0164] Optionally, the above-mentioned identification of the scene state of the virtual environment based on the scene data can be implemented as determining the scene state of the virtual environment by condition matching. Schematically, a plurality of candidate conditions are pre-set, and the scene state is determined based on the matching between the scene data and each candidate condition. In one example, a target scene element is screened out from a plurality of candidate environment elements based on whether the candidate environment element is a sound source, that is, a plurality of candidate environment elements are first pre-screened based on whether the candidate environment element is a scene element that emits audio, and for the ith candidate condition, it is determined whether the jth target scene element will be used as a sound that emits audio in the virtual environment corresponding to the ith candidate condition, so as to screen out the environmental sound source element from the target scene element.
[0165] Optionally, the candidate conditions include at least one of weather conditions, time conditions, and season conditions. The weather conditions are used to determine whether the candidate environmental elements will be used as the sound source of the audio under the scene weather of the current virtual environment; the time conditions are used to determine whether the candidate environmental elements will be used as the sound source of the audio under the scene time period of the current virtual environment; and the season conditions are used to determine whether the candidate environmental elements will be used as the sound source of the audio under the scene season of the current virtual environment.
[0166] For example, the filtered target scene elements include birds, and the current weather condition of the virtual environment is rainy, then it is determined whether the birds are the sound source that will emit audio in the rainy day scene, and if the judgment result is no, the target scene element will not be determined as an environmental sound source element; for another example, the filtered target scene elements include owls, and the current time condition of the virtual environment is night, then it is determined whether the owl is the sound source that will emit audio in the night scene, and if the judgment result is yes, the target scene element is determined as an environmental sound source element.
[0167] Optionally, the above-mentioned recognition of the scene state of the virtual environment based on scene data can also be implemented as automatic recognition through an artificial intelligence (AI) model. Schematically, the scene data of the virtual environment is obtained, the scene data includes element data of multiple candidate environmental elements, the scene data is input into a pre-trained scene recognition model, and the environmental sound source element is screened from multiple candidate environmental sound source elements. The scene recognition model is used to identify the sound source that generates audio in the virtual environment as the environmental sound source element in combination with the overall situation of the virtual environment.
[0168] Optionally, the above-mentioned scene recognition model can be implemented by neural network models such as Convolutional Neural Networks (CNN), Feedforward Neural Network (FNN), Residual Network (ResNet), Transformer, etc., which are not specifically limited here.
[0169] Thirdly, the environmental sound source element can also be implemented as a sound source that emits audio through user-defined settings.
[0170] Illustratively, the application provides a scene sound source customization interface to the user, in which multiple candidate ambient sound source elements are displayed. In response to receiving a selection operation to select at least one ambient sound source element from the multiple candidate ambient sound source elements, the at least one ambient sound source element is saved as a scene sound source configuration corresponding to a first account. When there is a need to generate scene audio data, the scene sound source configuration corresponding to the first account is obtained, and at least one ambient sound source element is determined from the scene sound source configuration.
[0171] In the embodiment of the present application, the element audio data of the environmental sound source element is used to indicate the audio data emitted when the environmental sound source element is used as a sound source in the virtual environment. In one example, when the environmental sound source element is a virtual stream, the element audio data is the sound of water flowing in the virtual stream; in another example, when the environmental sound source element is an NPC, the element audio data is the voice of the NPC character.
[0172] In some embodiments, the element audio data of the ambient sound source element can be directly obtained from a database, that is, the element identifier corresponding to the ambient sound source element is obtained, and the element audio data corresponding to the ambient sound source element is searched from the database based on the element identifier.
[0173] In other embodiments, the elemental audio data of the ambient sound source element can be implemented as real-time synthesis, that is, the elemental audio material corresponding to the ambient sound source element is obtained, the audio duration of the audio emitted by the ambient sound source element in the virtual environment is determined, and the above-mentioned elemental audio data is generated based on the elemental audio material and the audio duration.
[0174] In other embodiments, the environmental sound source element also includes a guidance element associated with the main virtual character, wherein the guidance element is used to indicate a virtual identifier for guiding the main virtual character, and the guidance element corresponds to element audio data, which assists the user in understanding the game environment or guides the player to take action through specific sound effects, such as directional sounds or sounds of environmental changes. For example, if the user is lost in a maze, the client indicates the correct direction through the guidance element and the corresponding element audio, or when the user approaches a hidden object, the guidance element and the corresponding element audio are used to prompt the user to pay attention.
[0175] Step 320: Acquire the sound effect parameters corresponding to the environmental sound source elements based on the relative position relationship between the environmental sound source elements and the main control virtual character in the virtual environment.
[0176] In an embodiment of the present application, the relative position relationship between the ambient sound source element and the master virtual character in the virtual environment is used to indicate the relative relationship between the first position corresponding to the ambient sound source element and the second position corresponding to the master virtual character in the virtual environment.
[0177] Optionally, the above-mentioned relative orientation relationship includes at least one of position distance, position direction, and surrounding situation between the ambient sound source element and the main virtual character, wherein the position distance is used to indicate the distance relationship between the ambient sound source element and the main virtual character, the position direction is used to indicate the angle relationship between the first position of the ambient sound source element and the orientation direction of the main virtual character, and the surrounding situation is used to indicate the surrounding situation of the ambient sound source element around the main virtual character.
[0178] In some embodiments, the determination of the relative orientation relationship between the environmental sound source element and the main virtual character can be implemented as follows: obtaining first position information of the environmental sound source element in the virtual environment, obtaining second position information of the main virtual character in the virtual environment, and determining the relative orientation relationship between the environmental sound source element and the main virtual character based on the first position information and the second position information.
[0179] In some embodiments, the first position information of the ambient sound source element and the second position information of the controlling virtual character are position information determined based on the same preset coordinate system. Optionally, the preset coordinate system can be implemented as a world coordinate system corresponding to the virtual environment, or the preset coordinate system can be implemented as a coordinate system established with the controlling virtual character as the origin.
[0180] In some embodiments, when the sound effect parameters corresponding to the ambient sound source elements are pre-generated and stored in a database, the sound effect parameters corresponding to the ambient sound source elements are obtained from the database. In other embodiments, the sound effect parameters corresponding to the ambient sound source elements may also be generated in real time, that is, the sound effect parameters corresponding to the ambient sound source elements are generated based on the relative orientation relationship.
[0181] Optionally, the sound effect parameters corresponding to the ambient sound source element may include at least one of the following types:
[0182] The first type is distance type
[0183] Illustratively, the distance-type sound effect parameter is used to indicate that the sound effect of the element audio is adjusted based on the distance between the ambient sound source element and the main virtual character. In some embodiments, the distance-type sound effect parameter can adjust the audio volume of the element audio to simulate the effect of distance on the sound volume; and / or, the distance-type sound effect parameter can adjust the audio delay of the element audio to simulate the effect of distance on the sound propagation time.
[0184] Second, direction type
[0185] Illustratively, the direction-type sound effect parameter is used to indicate the adjustment of the sound effect of the element audio based on the direction of the ambient sound source element relative to the main virtual character. In some embodiments, the direction-type sound effect parameter can adjust the audio volume of the element audio to simulate whether the main virtual character is facing the scene audio element; and / or, the direction-type sound effect parameter can adjust the volume parameters of the element audio in different channels to simulate the direction of the audio emitted by the ambient sound source element.
[0186] The third type is space effects
[0187] Illustratively, the sound effect parameters of the spatial special effect type are used to indicate that the virtual space formed based on the environmental sound source elements adjusts the sound effects in the virtual space, that is, the sound effect parameters of the spatial special effect type are used to indicate the effect of the virtual space on the sound performance of the audio emitted by the environmental sound source elements. In some embodiments, the sound effect parameters of the spatial special effect type can add echo sound effects and reverberation sound effects to simulate the effect of sound in the space.
[0188] Optionally, the sound effect parameters of the spatial special effect type include at least one of a reverberation time parameter, a pre-delay parameter, a wetness (Wet / DryMix) parameter, a space width parameter, and a distance effect parameter. Among them, the reverberation time parameter is used to indicate the speed at which the audio decays in the virtual space; the pre-delay parameter is used to indicate the time difference between the audio directly reaching the main virtual character and the audio reaching the main virtual character after the first reflection; the wetness parameter is used to indicate the ratio between the audio directly transmitted and the audio transmitted through reflection; the space width parameter is used to indicate the degree of diffusion of the audio on the horizontal plane in the virtual space; and the distance effect parameter is used to indicate the attenuation of the audio with the propagation distance during the propagation process.
[0189] The fourth type is custom type
[0190] Schematically, the custom type of sound effect parameters are user-defined parameters for sound effect adjustment. Optionally, the user can customize the overall volume of the scene audio, whether to add background music, customize the volume of different types of audio, etc.
[0191] In some embodiments, the client provides a customization interface for sound effect parameters to the user, and the user configures the customized sound effect parameters through the customization interface.
[0192] In some embodiments, a parameter prediction model for personalized learning of the custom sound effect parameters is configured in the custom sound effect parameter server for the user. Schematically, the custom sound effect parameters of multiple candidate accounts are obtained, the multiple custom sound effect parameters are input into the parameter prediction model to be trained, the parameter prediction model to be trained is iteratively trained to obtain the parameter prediction model, and the sound effect parameters generated by the system (for example, the sound effect parameters of the above-mentioned distance type, direction type, and spatial special effect type) are optimized through the parameter prediction model.
[0193] Step 330, adjusting the element audio data based on the sound effect parameters to generate spatial audio data corresponding to the environmental sound source element.
[0194] Among them, spatial audio data is used to express the perceptual effect of the audio generated by the main virtual character on the environmental sound source elements under the relative orientation relationship, that is, by adjusting the element audio data through the sound effect parameters, the element audio can simulate the sound effect of the relative orientation relationship between the main virtual character and the environmental sound source elements when the main virtual character is at the current position in the virtual environment.
[0195] In an embodiment of the present application, the element audio data is adjusted according to the sound effect parameters corresponding to the environmental sound source element, thereby generating spatial audio data corresponding to the environmental sound source element. That is, the spatial audio data is the audio data corresponding to the environmental sound source element obtained by adjusting the element audio data by the sound effect parameters. In some embodiments, the spatial audio data includes the audio after the sound effect parameters are adjusted, as well as at least one of the audio duration information, the audio playback start timestamp, the audio playback end timestamp, the audio playback condition information, and the element identification information corresponding to the audio.
[0196] Optionally, when the sound effect parameter indicates that the volume of the element audio of the ambient sound source element is adjusted, the volume of the element audio of the ambient sound source element on at least one channel is adjusted based on the sound effect parameter. Optionally, when the sound effect parameter indicates that the playback delay of the element audio of the ambient sound source element is adjusted, the audio playback start time corresponding to the element audio of the ambient sound source element is adjusted based on the sound effect parameter. Optionally, when the sound effect parameter indicates that the sound speed of the element audio of the ambient sound source element is adjusted, the playback speed of the element audio of the ambient sound source element is adjusted based on the sound effect parameter. Optionally, when the sound effect parameter indicates the pitch of the element audio of the ambient sound source element, the frequency in the spectrum of the element audio of the ambient sound source element is adjusted based on the sound effect parameter. When the sound effect parameter indicates the timbre of the element audio of the ambient sound source element, the filter corresponding to the ambient sound source element is determined based on the sound effect parameter, and the timbre corresponding to the element audio is adjusted through the filter.
[0197] Step 340: Generate scene audio data based on the spatial audio data.
[0198] The scene audio data is the perception effect of the main virtual character on at least one audio generated in the virtual environment.
[0199] In an embodiment of the present application, after corresponding spatial audio data is generated for the ambient sound source elements in the virtual environment, scene audio data is generated based on the spatial audio data.
[0200] In some embodiments, when the virtual environment includes one ambient sound source element, the spatial audio data is directly used as the scene audio data. In other embodiments, when the virtual environment includes multiple ambient sound source elements, the spatial audio data corresponding to the multiple ambient sound source elements are synthesized to obtain the scene audio data.
[0201] In some embodiments, when the virtual environment includes multiple ambient sound source elements, the synthesis of multiple spatial audio data is implemented as follows: based on the spatial audio data, the playback start time of the spatial audio corresponding to each ambient sound source element is determined, and based on the playback start time of each spatial audio, the audio tracks corresponding to each spatial audio data are synthesized to obtain scene audio data.
[0202] In some embodiments, after the scene audio data is obtained, the scene audio data is sent to the client of the application, and the client plays the scene audio corresponding to the virtual environment based on the scene audio data.
[0203] In some optional embodiments, when scene audio data is generated based on spatial audio data, event-triggered sound effects may also be added during the generation of scene audio data. Indicatively, in response to a target event being triggered by a master virtual character, an event sound effect audio corresponding to the target event is obtained, and scene audio data is generated based on the spatial audio data and the event sound effect audio. The event sound effect audio is a sound effect audio used to indicate an event state associated with the target event.
[0204] For example, when the main virtual character triggers a combat event and enters a combat state, the event sound effects audio includes tense combat music. For another example, when the main virtual character triggers a decryption event, the event sound effects audio includes decryption success music and decryption failure music. When the main virtual character decrypts successfully, the scene audio played by the client includes decryption success music, and when the main virtual character decrypts unsuccessfully, the scene audio played by the client includes decryption failure music.
[0205] In summary, when the player controls the main virtual character to move in the virtual environment, the sound effect parameters of the environmental sound source elements are obtained according to the relative position relationship between the main virtual character and the environmental sound source elements in the virtual environment as the sound source, and the element audio data is adjusted by the sound effect parameters to obtain spatial audio data, and the spatial audio data in the virtual environment is integrated to obtain the scene audio data provided to the client. Since the scene audio data is generated in real time based on the relative position relationship between the main virtual character and the environmental sound source elements, the application that provides the virtual environment does not need to pre-configure too many application resources in order to improve the diversity of sound effect performance effects, which reduces the waste of storage space of the computer device running the above application.
[0206] At the same time, after the sound effect parameters are adjusted, the element audio data corresponding to the environmental sound source elements can simulate the perception effect of the main virtual character on the audio generated by the environmental sound source elements under the current relative position relationship, and then generate scene audio data of the virtual environment through the spatial audio data, so that the scene audio played by the computer device can enable the player to replace the main virtual character to perceive at least one audio generated in the virtual environment, thereby enhancing the diversity of sound effects felt by the player during the game, thereby enhancing the player's sense of substitution in the virtual environment and improving the user experience.
[0207] Please refer to Figure 4 , which shows a flowchart of an audio processing method in a virtual environment provided by an exemplary embodiment of the present application. In the embodiment of the present application, the process of generating sound effect parameters is schematically described. The method includes steps 321 to 324, wherein steps 321 to 324 are lower steps of step 320.
[0208] Step 321, obtaining first position information of the ambient sound source element in the virtual environment.
[0209] In some embodiments, the ambient sound source element includes a scene element with a fixed distribution in the virtual environment, and the position of the ambient sound source element in the virtual environment is determined by the scene element distribution data corresponding to the virtual environment. Schematically, the scene element distribution data corresponding to the virtual environment is obtained, and the scene element distribution data is used to indicate the distribution position information corresponding to multiple scene elements constituting the virtual environment, and the ambient sound source element is determined from the multiple scene elements, and the first position information corresponding to the ambient sound source element is obtained based on the scene element distribution data.
[0210] In other embodiments, the environmental sound source element includes a scene element moving in the virtual environment, and the position of the environmental sound source element in the virtual environment is determined by real-time monitoring of the position of the environmental sound source element. Schematically, an audio timestamp corresponding to a scene audio acquisition request sent by a receiving client is obtained, and the audio timestamp is used to indicate the moment of the scene audio to be played in the scene time corresponding to the virtual environment, wherein the audio timestamp is also used to determine the position of the master virtual character, and determine the position of the environmental sound source element in the virtual environment at the moment corresponding to the audio timestamp, and obtain the first position information.
[0211] In some embodiments, the first position information is coordinate point data determined based on a preset coordinate system.
[0212] In other embodiments, the virtual environment is divided into a grid structure, and the position information of the scene elements in the virtual environment is stored by the grid points in the grid structure. Schematically, the preset correspondence between the grid points and the scene elements is stored in the grid structure of the virtual environment. In one example, a preset relationship list corresponding to the grid structure is obtained, and the preset relationship list indicates the correspondence between the grid points and the scene elements by establishing a correspondence between the grid point identifier and the element point identifier, and the element identifier corresponding to the environmental sound source element is obtained. Based on the element identifier, the corresponding first grid point is found from the preset relationship list, and the position of the first grid point in the grid is determined as the first position information.
[0213] like Figure 5 As shown, it shows a schematic diagram of a grid structure provided by an exemplary embodiment of the present application, in which a virtual environment 500 is divided into a grid structure composed of multiple grids, and a scene element 501 in the virtual environment occupies a certain number of grid points in the grid structure.
[0214] Optionally, multiple scene elements can be configured on a grid point; or, a scene element can correspond to multiple grid points, that is, when the element volume of the scene element is larger, schematically, when the determined ambient sound source element corresponds to multiple grid points, the grid point corresponding to the element center corresponding to the ambient sound source element is determined as the first grid point, and the position of the first grid point in the grid is determined as the first position information.
[0215] Step 322, obtaining second position information of the master virtual character in the virtual environment.
[0216] The user can control the main virtual character to move in the virtual environment. Therefore, the position of the main virtual character in the virtual environment is not fixed. Schematically, the position of the main virtual character in the virtual environment is detected to obtain the second position information.
[0217] In some embodiments, the second position information is coordinate point data determined based on a preset coordinate system.
[0218] In other embodiments, the virtual environment is divided into a grid structure. Schematically, a second grid point corresponding to the position of the master virtual character in the virtual environment in the grid structure is determined, and the position of the second grid point in the grid is determined as the second position information.
[0219] Step 323: Determine the relative position relationship between the ambient sound source element and the main control virtual character based on the first position information and the second position information.
[0220] In some embodiments, when the first position information and the second position information are coordinate point data determined based on a preset coordinate system, the relative orientation relationship between the ambient sound source element and the master virtual character is determined based on the first coordinate point indicated by the first position information and the second coordinate point indicated by the second position information.
[0221] In other embodiments, when the first position information and the second position information are based on grid points indicated by a grid structure, the relative orientation relationship between the ambient sound source element and the master virtual character is determined based on the first grid point corresponding to the first position information and the second grid point indicated by the second position information.
[0222] Optionally, the above-mentioned relative orientation relationship includes at least one of position distance, position direction, and surrounding situation between the ambient sound source element and the main virtual character, wherein the position distance is used to indicate the distance relationship between the ambient sound source element and the main virtual character, the position direction is used to indicate the angle relationship between the first position of the ambient sound source element and the orientation direction of the main virtual character, and the surrounding situation is used to indicate the surrounding situation of the ambient sound source element around the main virtual character.
[0223] Step 324, generating sound effect parameters corresponding to the environmental sound source elements based on the relative orientation relationship.
[0224] Optionally, the sound effect parameters corresponding to the ambient sound source elements may be generated in at least one of the following ways:
[0225] The first one generates corresponding sound effect parameters based on the sound propagation path corresponding to the audio generated by the environmental sound source elements under relative orientation relationships.
[0226] The above-mentioned sound propagation path is used to indicate the propagation path of the sound wave when the environmental sound source element is used as the sound source. It is worth noting that one environmental sound source element can correspond to multiple sound propagation paths.
[0227] In an illustrative manner, based on the relative orientation relationship, the sound propagation path of the audio generated by the ambient sound source element between the ambient sound source element and the main virtual character is determined, and the sound effect parameters corresponding to the ambient sound source element are generated based on the sound propagation path. That is, since the ambient sound source element is the sound source in the virtual environment, the audio it emits propagates in the virtual environment, and the path pointing to the main virtual character is the sound propagation path of the audio between the ambient sound source element and the main virtual character.
[0228] In some embodiments, the sound propagation path between the ambient sound source element and the main virtual character can be implemented as a ray path from the ambient sound source element to the main virtual character, that is, the sound propagates directly from the ambient sound source element to the main virtual character.
[0229] In some embodiments, since the audio emitted by the environmental sound source elements has propagation paths in other directions, and after being reflected by other scene elements in the virtual environment, there will also be a sound propagation path for the main virtual character to receive the audio, that is, the sound propagation path is the path of the audio emitted by the environmental sound source elements after being reflected in the virtual environment.
[0230] In an example, taking the example that the sound propagation path of the audio received by the main virtual character includes a direct propagation path and a propagation path after reflection, schematically, based on the relative orientation relationship, a first propagation path is determined for the audio generated by the environmental sound source element to be directly propagated from the environmental sound source element to the main virtual character; based on the relative orientation relationship, a second propagation path is determined for the audio generated by the environmental sound source element to be propagated to the main virtual character after reflection in the virtual environment; based on the first propagation path and the second propagation path, the sound effect parameters corresponding to the environmental sound source element are determined.
[0231] Specifically, please refer to Formula 1 and Formula 2, which show the radiation process of sound propagation in a virtual environment. Formula 1 and Formula 2 jointly describe the change in sound energy in the process of audio being emitted from the environmental sound source element and propagating to the main virtual character. Among them, Formula 1 is the change in total energy, and Formula 2 is the energy change of audio during transmission due to the inhomogeneity of the medium or the scattering effect caused by other sound sources.
[0232] Formula 1:
[0233] Formula 2:
[0234] Where t is time, x′ is the first position of the ambient sound source element, x is the second position of the main control virtual character, L(x′→x,t) represents the sound field contribution from x′ to x at time t, L0(x′→x,t) represents the primary sound field directly radiated from x′ to x, and L s(x′→x,t) represents the scattering effect of the sound wave due to the inhomogeneity of the medium or other sound sources during the propagation from x′ to x. is the scattering operator corresponding to the sound source / medium at x″, L(x″→x′,t) represents the contribution of the sound field from x″ to x′ at time t, is the acoustic geometry term of the field of view object for the propagation of sound waves between x″ and x′, and ρ(x″→x′→x) is used to indicate the two-way propagation function of sound on the surface of the object on the scattering path.
[0235] In some embodiments, the detection of the sound propagation path can be achieved by simulating the direct propagation or reflected propagation of sound through ray tracing or image source method.
[0236] In some embodiments, when adding the sound effects generated by the sound during the reflection propagation process in the process of determining the sound effect parameters, reverberation calculation can also be incorporated. Specifically, the early reflections of the audio emitted by the environmental sound source elements in the virtual environment are calculated. These reflections usually reach the main control virtual character within a specified time length (for example, 50 milliseconds), and then a first in first out (FIFO) sound queue and Schroeder algorithm are used to simulate the environmental tail sound, thereby adding the audio effect of the reverberation tail. Figure 6 As shown, it shows a schematic diagram of a reverberation sound wave provided by an exemplary embodiment of the present application. In the reverberation sound wave schematic diagram chart 600, the horizontal axis is used to represent the time when the sound reaches the master virtual character, and the vertical axis is used to represent the volume of the received sound, wherein the volume of the first sound 601 received at time t1 and transmitted to the master virtual character through the direct propagation path is the largest, the volume of the second sound 602 received during the time period t2 and transmitted to the master virtual character through the early reflection propagation path is reduced to a certain extent, and the volume of the third sound 603 as the reverberation tail received during the time period t3 is relatively low.
[0237] That is, by simulating the propagation path of sound in a virtual environment to generate corresponding sound effect parameters, the scene audio can reflect the result of the audio emitted by each environmental sound source element propagating in the virtual environment and reaching the main virtual character, thereby improving the authenticity of the scene audio, making the user feel more involved, and improving the user experience. Furthermore, when simulating the propagation path of sound, in addition to directly broadcasting the propagation path to the main virtual character, the result of the sound after reflection in the virtual environment is also simulated, which can enhance the spatial sense of the spatial audio corresponding to the environmental sound source element, that is, the reflected sound can increase the depth and width of the space, making the sound sound richer and more three-dimensional, thereby improving the audio effect of the scene audio and improving the user experience.
[0238] The second method is to determine the corresponding sound effect parameters based on whether the environmental sound source elements are within the field of vision of the main virtual character.
[0239] In an illustrative manner, the visual field corresponding to the master virtual character is determined based on the orientation of the master virtual character in the virtual environment. When the ambient sound source element is within the visual field, the sound effect parameter is determined based on the first parameter. When the ambient sound source element is outside the visual field, the sound effect parameter is determined based on the second parameter, wherein the audio volume corresponding to the first parameter is greater than the audio volume corresponding to the second parameter. That is, when the master virtual character faces the ambient sound source element, the audio volume corresponding to the played ambient sound source element is increased to let the user know that the sound source is in front of the master virtual character.
[0240] In some embodiments, the field of view of the controlling virtual character is the range of the virtual environment displayed when the client provides the virtual environment screen to the user, that is, the virtual environment screen is a screen in which the virtual environment is observed from the perspective of the controlling virtual character, and the range of the virtual environment corresponding to the screen is the above-mentioned field of view.
[0241] In some embodiments, the field of view of the main virtual character is determined by a virtual camera (Camera), wherein the virtual camera is a crucial component in the virtual environment, which determines the content and perspective of the user on the screen. The position of the virtual camera in three-dimensional space determines the observation point of the virtual environment, the orientation of the virtual camera in three-dimensional space determines the observation direction of the virtual environment, and the field of view (FOV) of the virtual camera determines the size of the range of the virtual environment that can be displayed on the screen. Usually, the user cannot directly observe the virtual camera in the virtual environment.
[0242] Optionally, when the main virtual character controlled by the user observes the virtual environment from a first-person perspective, the virtual camera is bound to the head position of the main virtual character; when the main virtual character controlled by the user observes the virtual environment from a third-person perspective, the virtual camera is bound to the back position of the main virtual character.
[0243] In one example, the field of view is determined by the frustum of the virtual camera, where the frustum is a spatial region defined by the virtual camera position and FOV. Schematically, after determining the loading range corresponding to the virtual environment, frustum culling is performed to calculate which scene elements are within the frustum, thereby determining which scene elements need to be rendered, and then determining the ambient sound source elements that emit audio from the rendered scene elements, that is, as the ambient sound source elements within the field of view, the sound effect parameters corresponding to the first parameter are configured.
[0244] Specifically, six planes (upper, lower, left, right, front, and back) are extracted from the camera's view frustum. For each scene element, its bounding box is tested with the view frustum plane. If the bounding box is completely outside the view frustum, the scene element is removed from the field of view of the master virtual character.
[0245] When configuring sound effect parameters of different volumes according to the visual range of the main virtual character, users can distinguish the positions of different environmental sound source elements in the virtual environment through scene audio, and determine whether the environmental sound source elements are within their own visual range. While enhancing the sense of reality, users can more accurately judge the direction of the sound source and improve their ability to determine the position of environmental sound source elements. At the same time, when the user rotates the viewing angle of the main virtual character, the volume of the audio emitted by the environmental sound source elements in different positions will change, thereby realizing interactive feedback of the change of viewing angle at the sound experience level.
[0246] The third method is to determine the corresponding sound effect parameters based on the space type of the virtual space formed by the environmental sound source elements.
[0247] In some embodiments, the environmental sound source elements include space elements that form a virtual space in a virtual environment, the main virtual character is in the virtual space, based on the relative orientation relationship, the surrounding state information of the space elements to the main virtual character is determined, the space type of the virtual space where the main virtual character is located is determined based on the surrounding state information, and the sound effect parameters matching the space type are obtained. The surrounding state information is used to indicate the relative relationship between the location of the main virtual character and the distribution of the space elements in the virtual environment.
[0248] Optionally, the space type can be implemented as at least one of an open type, a closed type, and a semi-closed type. When the space type is an open type, the virtual environment can be implemented as scenes such as grasslands, plains, and sea surfaces; when the space type is a closed type, the virtual environment can be implemented as scenes such as caves and rooms; when the space type is a semi-closed type, the virtual environment can be implemented as scenes such as canyons and forests.
[0249] In some embodiments, different space types correspond to different sound effect parameters. For example, when the space type is an open type, the corresponding sound effect parameters will make the audio more transparent and clear, with corresponding characteristics such as lower reverberation and faster sound attenuation. Indicatively, the sound effect parameters corresponding to different space types can be pre-configured, that is, the database pre-stores pre-configured sound effect parameter strategies corresponding to different space types. After the space type of the virtual space where the master virtual character is located is determined based on the surround state information, the sound effect parameter strategy corresponding to the space type is found from the database based on the type identifier of the space type, and the sound effect parameters matching the space type are obtained from the sound effect parameter strategy.
[0250] That is, by obtaining sound effect parameters that match the space type formed by the scene elements in the virtual environment, the user can feel the virtual space of the virtual environment from the auditory perception level, enhance the user's sense of immersion, and make the user feel more immersed in the virtual environment.
[0251] The fourth method is to determine the corresponding sound effect parameters based on the volume attenuation and delay of the sound during sound propagation based on the distance between the main virtual character and the environmental sound source elements.
[0252] In some embodiments, since there is a certain distance between the main virtual character and the environmental sound source element, the sound effect parameters are also used to adjust the attenuation effect and / or delay effect of the sound. In an exemplary manner, based on the relative position relationship, the distance information between the main virtual character and the environmental sound source element is determined, based on the distance information, the attenuation parameter and delay parameter corresponding to the audio generated by the environmental sound source element are determined, and based on the attenuation parameter and delay parameter, the sound effect parameters are determined.
[0253] In some embodiments, the attenuation parameter is a preset sound attenuation function. In some embodiments, the delay parameter is a delay duration determined based on distance information and sound propagation speed.
[0254] That is, the attenuation effect of sound after propagation in the virtual environment is simulated by the attenuation parameter, and the delay effect of sound in the virtual environment is simulated by the delay parameter, thereby improving the authenticity of the scene audio.
[0255] In some embodiments, the virtual environment is divided into a grid structure, wherein the grid structure is used to indicate the scene division result of the virtual environment divided by the grid, and the grid structure includes multiple grid points, and the audio of the environmental sound source element is cached through each grid point in the grid structure. Schematically, the sound source that generates audio in the virtual environment includes multiple environmental sound source elements, the grid structure of the virtual environment is obtained, and based on the positions of the multiple environmental sound source elements in the virtual environment, the first grid points corresponding to the multiple environmental sound source elements are determined, and the multiple environmental sound source elements correspond to at least one first grid point, and the sound cache data corresponding to the first grid point is generated based on the element audio data.
[0256] In some embodiments, when the master virtual character enters the virtual environment, the grid point where the master virtual character is located in the grid structure is determined, so as to generate corresponding sound effect parameters according to the relative position relationship between the master virtual character and the environmental sound source element. In an exemplary manner, in response to the master virtual character entering the virtual environment, the second grid point corresponding to the position of the master virtual character is determined, and the sound effect parameters corresponding to the first grid point are generated based on the relative position relationship between the first grid point and the second grid point.
[0257] In some embodiments, the sound cache data cached in the grid point is processed according to the generated sound effect parameters to obtain the element audio data corresponding to the grid point, and the scene audio data of the virtual environment is obtained by integrating the data of each grid point of the entire grid structure. Schematically, based on the sound cache data and sound effect parameters corresponding to the first grid point, the element audio data corresponding to the first grid point is generated, and the element audio data of at least one first grid point is integrated to obtain the scene audio data.
[0258] By caching the sound cache data through the grid points in the grid structure, when providing scene audio data to the client, the audio data corresponding to each predetermined position can be quickly obtained, which improves the efficiency of obtaining audio data. And because the distance between the grid points in the grid structure is fixed, when determining the relative orientation relationship between the grid points configured with the environmental sound source elements and the grid points of the master virtual character, the speed of determining the relative orientation relationship can be improved, thereby improving the efficiency of scene audio data feedback and ensuring the real-time response of the client to the changes in the scene audio effect when the master virtual character is active in the virtual environment.
[0259] In summary, when the player controls the main virtual character to move in the virtual environment, the sound effect parameters of the environmental sound source elements are obtained according to the relative position relationship between the main virtual character and the environmental sound source elements in the virtual environment as the sound source, and the element audio data is adjusted by the sound effect parameters to obtain spatial audio data, and the spatial audio data in the virtual environment is integrated to obtain the scene audio data provided to the client. Since the scene audio data is generated in real time based on the relative position relationship between the main virtual character and the environmental sound source elements, the application that provides the virtual environment does not need to pre-configure too many application resources in order to improve the diversity of sound effect performance effects, which reduces the waste of storage space of the computer device running the above application.
[0260] At the same time, after the sound effect parameters are adjusted, the element audio data corresponding to the environmental sound source elements can simulate the perception effect of the main virtual character on the audio generated by the environmental sound source elements under the current relative position relationship, and then generate scene audio data of the virtual environment through the spatial audio data, so that the scene audio played by the computer device can enable the player to replace the main virtual character to perceive at least one audio generated in the virtual environment, thereby enhancing the diversity of sound effects felt by the player during the game, thereby enhancing the player's sense of substitution in the virtual environment and improving the user experience.
[0261] In an embodiment of the present application, based on the first position information of the environmental sound source element in the virtual environment and the second position information of the main virtual character in the virtual environment, sound effect parameters that conform to the relative position relationship between the two are generated in real time, so that the scene audio finally played by the client can truly simulate the main virtual character's perception of the sound of the entire virtual environment at its current position in the virtual environment, thereby improving the user experience.
[0262] Please refer to Figure 7 , which shows a flowchart of an audio processing method in a virtual environment provided by an exemplary embodiment of the present application. In the embodiment of the present application, the environmental sound source elements include character elements, and the character elements are used to indicate scene virtual characters other than the main virtual character in the virtual environment. The method for obtaining the element audio data corresponding to the character elements can be implemented as steps 311 to 312, wherein steps 311 to 312 are lower steps of step 310.
[0263] Step 311, obtaining the dialogue data and character feature information of the character element.
[0264] In the embodiment of the present application, the dialogue data of the character element is used to indicate the voice content uttered by the scene virtual character. Optionally, the dialogue data may be the dialogue content when the main control virtual character talks to the scene virtual character; or, the dialogue data may be the fixed sentence content preset by the scene virtual character; or, the dialogue data may be the event sentence content triggered by the scene virtual character under a specified event.
[0265] Optionally, the above-mentioned dialogue data may be directly obtained from a database; or, the above-mentioned dialogue data may be generated in real time based on the natural language commands of the first account to the virtual character in the scene.
[0266] In the embodiment of the present application, the sound source of the audio in the virtual environment also includes the scene virtual character in the virtual environment. Optionally, the scene virtual character can be implemented as an NPC, a hostile virtual character, a teammate virtual character, a subordinate virtual character (for example, a pet), etc., which is not limited here.
[0267] Illustratively, the above-mentioned role characteristic information is used to describe the attributes of the scene virtual character, that is, the role characteristic information is information used to describe the current state and characteristics of the scene virtual character.
[0268] In some embodiments, the attributes of the scene virtual character include at least one of the basic attributes of the scene virtual character and the scene performance attributes. Among them, the basic attributes are attributes pre-configured for the scene virtual character, that is, the attributes of the scene virtual character that do not change due to the virtual environment or the current scene, such as the age information of the scene virtual character, the male / female information of the scene virtual character, the martial arts information of the scene virtual character, etc. The scene performance attributes are attributes determined in real time by the scene virtual character in the scene of the virtual environment, that is, attributes associated with the current scene, such as the emotional information and behavioral information of the scene virtual character in the current scene.
[0269] Optionally, the character feature information includes at least one of basic character information, character emotion information, and character behavior information. The basic character information is used to indicate the basic situation of the scene virtual character, and the basic character information is information about the basic attributes of the scene virtual character, such as the age information of the scene virtual character, the male / female information of the scene virtual character, and the martial arts information of the scene virtual character; the character emotion information is used to indicate the emotional state of the scene virtual character in the dialogue scenario corresponding to the lines data, and the character emotion information is the scene performance attribute of the scene virtual character, such as the character emotion information indicates that the scene virtual character is in an excited state, an angry state, a sad state, etc.; the character behavior information is used to indicate the actions performed by the scene virtual character in the dialogue scenario, and the character behavior information is the scene performance attribute of the scene virtual character, such as being in a running state, an attacking state, an injured treatment state, etc.
[0270] It is worth noting that in the embodiments of the present application, different character feature information corresponds to different performances of character voices. In one example, when the character feature information indicates that the scene virtual character is a young man, who is currently in a combat state and is emotionally excited, the timbre of the corresponding character voice is the timbre of a young man. Because the character is in a combat state, the character voice is mixed with the panting sound of the combat process, and because the scene virtual character is emotionally excited when speaking, the character voice has a higher pitch. That is, generating character voices with different performances according to different character feature information can enhance the authenticity of the character voice of the scene virtual character, so that users have a greater sense of substitution when interacting with the scene virtual character.
[0271] Step 312: Generate a character voice that matches the character feature information based on the dialogue data as element audio data corresponding to the character element.
[0272] In an embodiment of the present application, the character voice of a scene virtual character is generated based on the dialogue data and the character feature information, wherein the voice content of the character voice is determined by the dialogue data, and the voice expression of the character voice is determined by the character feature information.
[0273] In some embodiments, the character voice is generated by a pre-trained voice generation model, and the voice generation model is used to generate a voice that matches the character feature information of the scene virtual character. In an illustrative example, the line data and the character feature information are input into the pre-trained voice generation model to obtain the character voice as the element audio data.
[0274] Optionally, the above-mentioned speech generation model can be implemented by a neural network model such as a convolutional neural network, a feedforward neural network, a residual network, a Transformer, a multimodal large language model (Multimodal Large Language Model, MLLM), etc., which is not specifically limited here.
[0275] In some embodiments, the speech generation model includes a text encoder, a role encoder and a decoder. The text encoder is used to perform text encoding on the input speech data, that is, the speech data is input into the text encoder to obtain a text encoding representation. The role encoder is used to perform feature encoding on the input role feature information, that is, the role feature information is input into the role encoder to obtain a role encoding representation.
[0276] Illustratively, after obtaining the text encoding representation and the role encoding representation, the text encoding representation and the role encoding representation are fused to obtain the encoding representation input to the decoder, that is, the text encoding representation and the role encoding representation are fused to obtain a joint encoding representation, and the joint encoding representation is input into the decoder to generate the role voice.
[0277] In some embodiments, the character encoder includes at least one of a first sub-encoder, a second sub-encoder, and a third sub-encoder. The first sub-encoder is used to perform feature encoding based on the basic attributes of the scene virtual character, that is, when the character feature information includes the character basic information, the character basic information is input into the first sub-encoder to obtain the first character encoding representation; the second sub-encoder is used to perform feature encoding based on the emotional state of the scene virtual character, that is, when the character feature information includes the character emotional information, the character emotional information is input into the second sub-encoder to obtain the second character encoding representation; the third sub-encoder is used to perform feature encoding based on the behavior state of the scene virtual character, that is, when the character feature information includes the character behavioral information, the character behavioral information is input into the third sub-encoder to obtain the third character encoding representation.
[0278] like Figure 8As shown, it shows a schematic diagram of a speech generation model 800 provided by an exemplary embodiment of the present application, wherein the speech generation model 800 includes an encoder part 810 and a decoder part 820, wherein the encoder part 810 includes a text encoder 811, a first sub-encoder 812, a second sub-encoder 813, and a third sub-encoder 814, the line data 801 is input to the text encoder 811, and the output is a text encoding representation, the role basic information 802 of the scene virtual character is input to the first sub-encoder 812, and the output is a first role encoding representation, the role emotion information 803 of the scene virtual character is input to the second sub-encoder 813, and the output is a second role encoding representation, and the role behavior information 804 of the scene virtual character is input to the third sub-encoder 814, and the output is a third role encoding representation. The text encoding representation, the first role encoding representation, the second role encoding representation, and the third role encoding representation are feature fused through the fusion layer 830 to obtain a joint encoding representation, which is input to the decoder part 820, and the character voice is output through the decoder.
[0279] In some embodiments, after the character voice of the character element is obtained, the element audio data is generated based on the character voice. In some embodiments, the element audio data includes at least one of the following data, such as the play start timestamp, play end timestamp, play speed, and play relative delay of the character voice in addition to the character voice of the character element.
[0280] In the embodiment of the present application, when the element audio data is implemented as a character voice, the method for generating the sound effect parameters of the element audio data can be implemented as at least one of the following methods in addition to the method provided in the aforementioned embodiment:
[0281] The first method is to generate adjustment parameters based on the distance between the scene virtual character and the master virtual character to determine the sound effect parameters.
[0282] Schematically, first position information of a character element in a virtual environment is obtained; and second position information of a master virtual character in the virtual environment is obtained; when the position distance between the first position information and the second position information reaches a first threshold, a voice adjustment parameter is generated, and the voice adjustment parameter is used to adjust the voice of the character; and the sound effect parameter is determined based on the voice adjustment parameter.
[0283] In some embodiments, the first position information of the ambient sound source element and the second position information of the controlling virtual character are position information determined based on the same preset coordinate system. Optionally, the preset coordinate system can be implemented as a world coordinate system corresponding to the virtual environment, or the preset coordinate system can be implemented as a coordinate system established with the controlling virtual character as the origin.
[0284] In some embodiments, when the position distance between the first position information and the second position information reaches a first threshold, a first intonation adjustment parameter is generated; when the position distance between the first position information and the second position information does not reach the first threshold, a second intonation adjustment parameter is generated, wherein the pitch of the intonation corresponding to the first intonation adjustment parameter is greater than the pitch of the intonation corresponding to the second intonation adjustment parameter.
[0285] In some embodiments, the first intonation adjustment parameter and the second intonation adjustment parameter may be pre-set parameters; in other embodiments, the first intonation adjustment parameter may be determined based on a first control function, and the second intonation adjustment parameter may be determined based on a second control function. Optionally, the first control function and the second control function may be implemented as the same function or as different functions.
[0286] In other embodiments, the above-mentioned adjustment parameters can also be implemented as volume control parameters. Schematically, first position information of the character element in the virtual environment is obtained, and second position information of the main virtual character in the virtual environment is obtained. When the position distance between the first position information and the second position information reaches a first threshold, a volume control parameter is generated, and the sound effect parameter is determined based on the volume control parameter, wherein the volume control parameter is used to adjust the volume of the character's voice so that the volume of the character's voice is positively correlated with the position distance.
[0287] In some embodiments, when the position distance between the first position information and the second position information reaches a first threshold, a first volume control parameter is generated; when the position distance between the first position information and the second position information does not reach the first threshold, a second volume control parameter is generated, wherein the volume level corresponding to the first volume control parameter is greater than the volume level corresponding to the second volume control parameter.
[0288] In some embodiments, the first volume control parameter and the second volume control parameter may be pre-set parameters; in other embodiments, the first volume control parameter may be determined based on a third control function, and the second volume control parameter may be determined based on a fourth control function. Optionally, the third control function and the fourth control function may be implemented as the same function or as different functions.
[0289] In one example, when the main virtual character is outside the virtual building and the NPC is on the second floor of the virtual building, the voice tone and / or voice volume of the NPC's character voice is increased through volume control parameters, so that the user can receive clearer feedback voice from the NPC.
[0290] The second method is to detect scene changes of the virtual environment during the movement when the scene virtual character is a continuously moving virtual character, and generate corresponding scene sound effect parameters based on the scene changes to determine the sound effect parameters.
[0291] Schematically, a moving path of a character element in a virtual environment is obtained; when the moving path indicates that the character element moves between multiple virtual sub-scenes, scene sound effect parameters corresponding to the multiple virtual sub-scenes are obtained; and sound effect parameters are determined based on the scene sound effect parameters.
[0292] In some embodiments, the virtual environment is a scene composed of multiple virtual sub-scenes, and the virtual sub-scenes are connected to obtain the virtual environment. For example, a virtual character gets off a virtual vehicle, walks through a path and enters a virtual building, then the multiple virtual sub-scenes include a scene inside the vehicle, a road scene and a scene inside the building.
[0293] In some embodiments, different virtual sub-scenes are pre-configured with different scene sound effect parameters. For example, when the virtual sub-scene is a scene inside a vehicle, since the vehicle is a smaller enclosed space, the corresponding scene sound effect parameters will process the character's voice into a lower volume and a lower tone.
[0294] In some embodiments, after obtaining the scene sound effect parameters corresponding to different virtual sub-scenes, the scene change nodes in the moving path are determined based on the moving path, the time points of the scene change in the voice timeline are determined based on the voice timeline of the character's voice, the moving timeline corresponding to the moving path, and the scene change nodes, and the scene sound effect parameters corresponding to the corresponding virtual sub-scenes are allocated to different time periods in the character's voice based on the time points of the scene change. In the process of determining the sound effect parameters based on the scene sound effect parameters, the parameter effective timestamps of the different scene sound effect parameters are recorded.
[0295] Thirdly, when the character voice of the scene virtual character is a response to a natural language command based on the first account, a voice adjustment parameter is generated based on the ambient sound information corresponding to the natural language command to determine the sound effect parameter.
[0296] Illustratively, ambient sound information corresponding to a natural language command is obtained, the ambient sound information being used to indicate information related to background ambient sound in speech when collecting speech including natural language commands; intonation adjustment parameters of the character's voice are generated based on the ambient sound information; and sound effect parameters are determined based on the intonation adjustment parameters.
[0297] Among them, the above-mentioned natural language command is the user voice recorded by the terminal. After receiving the above-mentioned natural language command, the server detects the ambient sound information corresponding to the natural language command. Schematically, the user's voice content is filtered out from the sound spectrum corresponding to the natural language command to obtain ambient sound data, and the ambient sound data is detected to determine the corresponding ambient sound information.
[0298] In some embodiments, the ambient sound information includes the ambient volume, and the pitch height corresponding to the pitch adjustment parameter is positively correlated with the ambient volume. In an exemplary embodiment, the ambient volume corresponding to the ambient sound data is detected, and when the ambient volume is less than a preset volume threshold, a third pitch adjustment parameter is generated, and when the ambient sound volume is greater than or equal to the preset volume threshold, a fourth pitch adjustment parameter is generated, wherein the pitch of the third pitch adjustment parameter is lower than the pitch of the fourth pitch adjustment parameter.
[0299] In some other embodiments, the ambient sound information includes an environment recognition type corresponding to the background ambient sound, and the fifth intonation adjustment parameter is generated based on the environment recognition type. Schematically, different environment recognition types are pre-configured with different intonation adjustment parameters.
[0300] In one example, when the environment recognition type is an Internet cafe type, the tone adjustment parameter corresponds to the first tone, when the environment recognition type is a day bedroom, the tone adjustment parameter corresponds to the second tone, and when the environment recognition type is a night bedroom, the tone adjustment parameter corresponds to the third tone, wherein the first tone is higher than the second tone, and the second tone is higher than the third tone. That is, in a noisy environment, the tone of the dialogue voice replied by the scene virtual character is higher, and in a quiet environment, the tone of the dialogue voice replied by the scene virtual character is lower.
[0301] In other embodiments, the ambient sound information also affects the volume of the character's voice. Schematically, the ambient sound information corresponding to the natural language command is obtained, and the volume adjustment parameters of the character's voice are generated based on the ambient sound information; the sound effect parameters are determined based on the volume adjustment parameters. Schematically, the ambient volume corresponding to the ambient sound data is detected, and when the ambient volume is less than a preset volume threshold, it is determined that the natural language command corresponds to a first ambient sound state, and when the ambient sound volume is greater than or equal to the preset volume threshold, it is determined that the natural language command corresponds to a second ambient sound state, and a first volume adjustment parameter is obtained based on the first ambient sound state, and a second volume adjustment parameter is obtained based on the second ambient sound state, wherein the volume corresponding to the first volume adjustment parameter is less than the volume of the second volume adjustment parameter.
[0302] That is, when the ambient sound status corresponding to the natural language command indicates that the ambient sound is relatively noisy, the volume adjustment parameter is increased to increase the volume corresponding to the character's voice, so that the user can better receive the reply result of the scene virtual character.
[0303] In some embodiments, in order to ensure the accuracy of the output character voice, the voice duration of the character voice is synchronized by static synchronization. Schematically, before generating the character voice, the speech rate setting information corresponding to the character element is obtained, wherein the speech rate setting information is used to indicate the speech rate setting of the scene virtual character, the estimated playback duration corresponding to the line data is determined based on the speech rate setting information, the voice duration corresponding to the character voice is obtained, and the playback speed of the character voice is adjusted based on the difference between the voice duration and the estimated duration.
[0304] That is, in the static synchronization execution process, before generating the character voice, the time length of each text segment in the dialogue data is pre-calculated, and the generated voice segment is ensured to match it. Specifically, the input segment text is analyzed, and the voice length of each segment text is estimated. In one example, the estimation can be based on a preset speech rate (such as how many words per second), so that an estimated time length is assigned to each segment text. After generating the character voice, the difference between the voice length of the actual generated character voice and the estimated time length is corrected to ensure accurate synchronization of voice and text, so that the voice performance of the final character voice is more natural, while ensuring the readability of the character voice that can keep synchronization with the text.
[0305] In some embodiments, when the character voice is a response voice generated based on the natural language command of the first account to the character element, it is necessary to ensure the real-time and continuity of the character voice when playing the generated character voice to feedback the natural language command. Therefore, it is necessary to ensure the synchronization of dynamic voice data.
[0306] Illustratively, a natural language command for a character element is received from a first account, wherein the first account is an account for controlling a main virtual character, and multiple dialogue segments of the character element are continuously generated based on the natural language command to form dialogue data, and a first start timestamp and a first end timestamp when each dialogue segment is generated are recorded; when the i-th dialogue segment is generated, an i-th character segment voice matching the character feature information is generated according to the i-th dialogue segment as element audio data, and a second start timestamp and a second end timestamp are recorded when the i-th character segment voice is generated, where i is a positive integer, a first difference between the first start timestamp and the second start timestamp is determined, and a second difference between the first end timestamp and the second end timestamp is determined.
[0307] Optionally, based on the difference between the first difference and the second difference, the first generation speed of the i+1th dialogue segment is adjusted; or, based on the difference between the first difference and the second difference, the second generation speed of the i+1th character segment voice is adjusted; or, based on the difference between the first difference and the second difference, the transmission speed of the scene audio data corresponding to the i-th dialogue segment to the terminal is adjusted.
[0308] That is, dynamic synchronization is achieved by adjusting the speech generation speed and text processing speed in real time during the process of generating the character's speech. During the speech generation process, the length of the generated speech and the progress of text processing are detected in real time. Based on the real-time detected data, the speech generation speed and / or text processing speed can be dynamically adjusted to ensure that the speech generation and text processing are consistent in time through the feedback mechanism.
[0309] Specifically, a timer or clock is used to record the time of speech generation and text processing in real time, and the speech generation speed or text processing speed is dynamically adjusted according to the real-time detected data. The speech generation speed is adjusted by changing the speech rate parameter of the text-to-speech (TTS) engine.
[0310] In other embodiments, the buffer can also be managed to control the transmission speed of the generated character voice, wherein the buffer is used to store the generated character segment voice and line segment to ensure that they can be output on time. The generated character segment voice and line segment are stored in the buffer. The character segment voice and line segment are output from the buffer on time. In one example, a circular buffer is used to manage data storage and output to ensure that the data is output on time. In the process of generating the line segment and the character segment voice, an accurate timestamp is added to each line segment and the character segment voice, and its start and end time is recorded, and the timestamp is recorded in the data structure. The text processing module for generating the line segment and the voice generation module for generating the character segment voice exchange time information in real time. The server detects the status of text processing and voice generation in real time during communication interaction to ensure that they are consistent in time, and detects the time error of text processing and voice generation in real time, calculates the error through the timestamp information in the circular buffer area and adjusts the system parameters in real time according to the error to control the transmission speed of the scene audio data corresponding to the character voice sent by the circular buffer to the client to ensure time synchronization.
[0311] By dynamically adjusting the text / voice generation speed and the transmission speed of the generated voice by recording the timestamps corresponding to the text generation and the voice generation, it is possible to ensure the real-time and continuity of the output voice when the virtual character in the scene gives feedback to the natural language commands issued by the user, avoid the problem of stuttering in the output character voice and improve the time accuracy of data output.
[0312] In summary, when the player controls the main virtual character to move in the virtual environment, the sound effect parameters of the environmental sound source elements are obtained according to the relative position relationship between the main virtual character and the environmental sound source elements in the virtual environment as the sound source, and the element audio data is adjusted by the sound effect parameters to obtain spatial audio data, and the spatial audio data in the virtual environment is integrated to obtain the scene audio data provided to the client. Since the scene audio data is generated in real time based on the relative position relationship between the main virtual character and the environmental sound source elements, the application that provides the virtual environment does not need to pre-configure too many application resources in order to improve the diversity of sound effect performance effects, which reduces the waste of storage space of the computer device running the above application.
[0313] At the same time, after the sound effect parameters are adjusted, the element audio data corresponding to the environmental sound source elements can simulate the perception effect of the main virtual character on the audio generated by the environmental sound source elements under the current relative position relationship, and then generate scene audio data of the virtual environment through the spatial audio data, so that the scene audio played by the computer device can enable the player to replace the main virtual character to perceive at least one audio generated in the virtual environment, thereby enhancing the diversity of sound effects felt by the player during the game, thereby enhancing the player's sense of substitution in the virtual environment and improving the user experience.
[0314] In an embodiment of the present application, sound effect parameters are applied to the character voice of the scene virtual character in the virtual environment, so that the character voice received by the user also has the effect after it is propagated in the virtual environment, thereby improving the sound effect authenticity of the scene virtual character's voice when the scene virtual character talks with the main virtual character, and improving the user experience of the user when perceiving the character voice of the scene virtual character.
[0315] In some embodiments, the audio processing method in a virtual environment provided by the embodiments of the present application can be applied to an audio feedback system, such as Fig. 9 As shown, it shows a schematic diagram of an audio feedback system 900 provided by an exemplary embodiment of the present application, in which the audio feedback system 900 includes an environmental audio module 910, an NPC human voice audio module 920, a spatial sound effect processing module 930 and a comprehensive output module 940.
[0316] The environment audio module 910 is used to generate element audio data corresponding to the environment sound source element corresponding to the environment element in the virtual environment. In some embodiments, the environment audio module 910 includes an environment perception unit 911 and an environment synthesis unit 912.
[0317] Illustratively, the environment perception unit 911 can analyze scene elements in the virtual environment, such as terrain, time, climate, roles, and events, and determine the ambient sound source element as the sound source from the scene elements. In some embodiments, the environment perception unit 911 is configured with a scene recognition model, which can filter the ambient sound source element from multiple candidate ambient sound source elements in the virtual environment.
[0318] In one example, the environment sensing unit 911 can sense the virtual weather of the virtual environment, thereby filtering out different environmental sound source elements for different virtual weathers.
[0319] Illustratively, the environment synthesis unit 912 is used to synthesize element audio data corresponding to the environment sound source element by calling the sound source library.
[0320] The NPC human voice audio module 920 is used to generate a character voice corresponding to the scene virtual character as a character element, and the character voice is used as the element audio data corresponding to the character element. In some embodiments, the NPC human voice audio module 920 includes an offline human voice unit 921, an online human voice unit 922, and a scene performance synthesis unit 923.
[0321] Illustratively, the offline vocal unit 921 is used to obtain pre-generated character voices. In some embodiments, the character voices emitted by the scene virtual characters are fixed. For example, the NPC plays the character voice "Hello" when the main virtual character passes by. Therefore, such voices can be realized by pre-generated and stored character voices, that is, the offline vocal unit 921 directly calls the local character voice database to obtain the corresponding character voices.
[0322] Illustratively, the online human voice unit 922 is a voice generation unit that is called when the character voice of the virtual character in the scene is generated in real time based on the natural language command of the first account, that is, the online human voice unit 922 generates dialogue data in response to the natural language command based on the natural language command, and generates the corresponding character voice based on the dialogue data.
[0323] Illustratively, the scenario expression synthesis unit 923 is used to further process the character voice output by the offline vocal unit 921 and / or the online vocal unit 922, add voice expression effects that increase emotional expression and behavioral expression, and obtain output element audio data.
[0324] The spatial sound effect processing module 930 is used to generate sound effect parameters of the audio propagated in the virtual environment. In some embodiments, the spatial sound effect processing module 930 includes a spatial sound effect unit 931 and a scene space unit 932.
[0325] Schematically, the spatial sound effect unit 931 is used to generate sound effect parameters associated with the space. Optionally, the above-mentioned sound effect parameters may include: generating corresponding sound effect parameters based on the sound propagation path corresponding to the audio generated by the environmental sound source element under the relative orientation relationship, determining the corresponding sound effect parameters based on whether the environmental sound source element is within the field of vision of the main virtual character, determining the corresponding sound effect parameters based on the space type of the virtual space formed by the environmental sound source element, and determining the corresponding sound effect parameters based on the volume attenuation and delay during sound propagation based on the distance between the main virtual character and the environmental sound source element. In one example, stereo technology and head-related transfer function (HRTF) data are combined to simulate the propagation and reflection of sound in the real world.
[0326] Illustratively, the scene space unit 932 is used to generate sound effect parameters associated with the scene. In one example, the scene space unit 932 detects the scene state of the virtual environment and generates sound effect parameters added to all environmental sound source elements based on the scene state. Optionally, the scene state includes the weather of the virtual environment, the event currently triggered by the virtual environment, etc.
[0327] The element audio data output by the environmental audio module 910 and the NPC human voice audio module 920, as well as the sound effect parameters output by the spatial sound effect processing module 930, are input together into the comprehensive output module 940. The sound effect parameters are applied to the corresponding element audio data through the comprehensive output module 940 to obtain spatial audio data. The spatial audio data corresponding to all environmental sound source elements in the virtual environment are integrated to output scene audio data. The server provides the scene audio data to the client.
[0328] In some embodiments, the audio feedback system further includes a resource management module, which is used to efficiently manage audio resources to optimize game performance and loading time. In some embodiments, the resource management module dynamically loads and unloads scene audio resources. Schematically, when the main virtual character leaves the current virtual environment, the resource management module controls the client to unload the scene audio resources.
[0329] Optionally, the resource management module may be a functional module configured in a server, that is, cloud management of client resources is implemented through the resource management module; or, the resource management module may be a functional module configured in a terminal, and client resources are managed locally in the terminal.
[0330] An exemplary embodiment of the present application provides a method for controlling a virtual character. The method comprises:
[0331] Displaying at least one of a main control virtual character and an NPC in a virtual environment;
[0332] Exemplarily, the main virtual character is a virtual character that the user directly controls in the virtual environment. There are also one or more non-player characters (NPC) in the virtual environment; the NPC and the main virtual character belong to the same virtual camp and are teammates of the main virtual character. The NPC follows the main virtual character in the virtual environment. In addition, the NPC can also be a follower character, a pet character, etc. controlled by the main virtual character. In addition, the NPC can also be a neutral character, and only cooperates with the main virtual character when certain conditions are met.
[0333] Obtain natural language commands;
[0334] Exemplarily, the natural language command includes the natural semantics of commanding the NPC; the NPC is commanded in the virtual scene through the natural language command, and the natural language command can be directly input by the user or extracted from the voice information input by the user. The present application does not limit the method of obtaining the natural language command.
[0335] The natural language command includes at least one of a behavior intention and a scene entity; the behavior intention is used to indicate the type of virtual activity performed by the NPC, such as indicating what type of virtual activity is performed in the virtual environment; the scene entity includes a first scene object, such as indicating what scene object in the virtual environment the virtual activity is performed on. The behavior intention and scene entity included in the natural language command are partial words in the natural language command.
[0336] In one example, the natural language command controls the NPC in terms of what type of virtual activity to perform and for what scene object in the virtual environment to perform the virtual activity; it is a complex instruction to control the NPC.
[0337] Controlling NPCs to perform virtual activities in response to natural language commands;
[0338] Exemplarily, controlling the NPC to perform virtual activities is determined based on the environmental perception information of the main virtual character and / or NPC. In some examples, the main virtual character and / or NPC obtains environmental perception information within the perception range of vision, hearing, movement trajectory and other perception methods. Exemplarily, the virtual activity is close to the current perception of the virtual environment by the main virtual character and / or NPC, and the NPC is controlled with reference to the current perception of the virtual character and / or NPC of the virtual environment. Exemplarily, the NPC has autonomous behavior capabilities, and the user only directs the NPC. The user gives commands, and the NPC understands and executes the commands based on its own autonomous behavior capabilities.
[0339] To sum up, the method provided in this embodiment determines the virtual activities that need to be performed by facing complex instructions for controlling the NPC in terms of what type of virtual activities to perform and for what scene objects in the virtual environment to perform the virtual activities, with reference to the environmental perception information of the master virtual character and / or the NPC; and ensures that the NPC and the master virtual character perform virtual activities in collaboration with each other by using the environmental perception information of the master virtual character and / or the NPC as a reference.
[0340] Fig.10 A flowchart of a method for controlling a virtual character provided by an exemplary embodiment of the present application is shown. The method comprises:
[0341] Step 201: Acquire a spatial dataset;
[0342] The spatial dataset of the virtual environment includes visual labels of scene objects, and the visual labels are used to describe the visual characteristics of the scene objects in at least one dimension, such as describing the scene objects in dimensions such as material, transparency, color, and shape.
[0343] Step 202: displaying at least one of a main control virtual character and an NPC in a virtual environment;
[0344] Exemplarily, the main control virtual character is a virtual character that the user directly controls in the virtual environment. There are also one or more NPCs in the virtual environment; the NPCs and the main control virtual character belong to the same virtual camp and are teammates of the main control virtual character.
[0345] Step 203: Acquire a natural language command in voice form;
[0346] The natural language command includes natural semantics for commanding the NPC, and the command information includes behavioral intention and scene entity; the behavioral intention is used to indicate the type of virtual activity performed by the NPC, and the scene entity is used to indicate the target entity of the virtual activity;
[0347] Step 204: converting the natural language command in voice form into the natural language command in text form;
[0348] Exemplarily, speech-to-text (Automatic Speech Recognition, ASR) processing is performed on the natural language command in the form of speech to determine the natural language command in the form of text. Speech-to-text processing generally includes calling components such as acoustic models and language models to recognize the pronunciation, vocabulary, grammatical structure and other information of the natural language command in the form of speech, and convert it into a natural language command in the form of text.
[0349] Step 205: performing intent recognition on the natural language command to obtain a first classification label;
[0350] Exemplarily, the first intention indication corresponding to the first classification label includes a command intention for a non-player character on an intention dimension; for example, at least one of the following: indicating which of a plurality of non-player characters the non-player character commanded by the command text is, indicating whether the virtual activity performed by the non-player character is related to initiating a virtual attack, and indicating what kind of virtual activity the non-player character performs.
[0351] Step 206: Perform entity recognition on the natural language command to obtain a target entity;
[0352] The target entity is determined from the virtual environment in combination with the environmental perception information, which includes information perceived by at least one of the main virtual character and the non-player character from the virtual environment. The target entity may be the entity currently seen by the player, or may be an entity that the player has seen in the past.
[0353] Step 207: In response to the natural language command, the NPC is controlled to perform a virtual activity according to the first intention corresponding to the first classification label, or the NPC is controlled to perform a virtual activity associated with the target entity, or the NPC is controlled to perform a virtual activity associated with the target entity according to the first intention corresponding to the first classification label;
[0354] Exemplarily, the NPC is controlled to perform a virtual activity according to the first classification tag and / or the instruction of the target entity.
[0355] Step 208: reporting the NPC's feedback information;
[0356] Exemplarily, the game application can generate corresponding feedback information in real time according to the environmental perception information of the non-player character and make a broadcast. For example, when the environmental perception information of the non-player character triggers the broadcast condition, the game application can generate corresponding feedback information in real time according to the environmental perception information that triggers the broadcast condition; or, when the non-player character or the main control virtual character triggers the broadcast condition, the game application can generate corresponding feedback information in real time according to the environmental perception information of the non-player character.
[0357] The preprocessing stage of step 201 can be implemented as follows:
[0358] Sub-step 1: Obtaining attribute text of scene objects in the virtual scene;
[0359] Exemplarily, attribute text is used to introduce the inherent attributes of scene objects in a virtual scene; on the one hand, attribute text realizes the description of scene objects in a textual mode, and while describing scene objects, it provides semantic information for the prediction of the visual labels of scene objects. On the other hand, attribute text is the description of scene objects in a virtual scene. In the face of a large number of scene objects in a virtual scene and the existence of reused object models, it can more accurately describe the inherent attributes of scene objects in a virtual scene.
[0360] In an optional implementation, the attribute text includes at least one of a name of the scene object in the virtual scene and a size of the scene object in the virtual scene.
[0361] Sub-step 2: obtaining an appearance image of a scene object in a virtual scene;
[0362] Exemplarily, the appearance image is used to describe the style of the scene object; the appearance image carries the appearance style of the scene object such as color, texture, shape, etc., and the relative position relationship between each sub-part in the picture mode, and can fully describe the scene object from the picture mode (or visual mode). In an optional implementation, the appearance image of the scene object includes images obtained by observing the scene object from at least two perspectives.
[0363] Sub-step 3: Call the multimodal model to perform prediction on the attribute text and appearance image of the scene object to obtain the visual label of the scene object;
[0364] Exemplarily, the multimodal model has the ability to perform model prediction on text information and image information of different modalities. In this embodiment, the input parameters of the multimodal model are the attribute text and appearance image of the scene object; the multimodal model predicts the visual label of the scene object from the two modalities of text modality and image modality, and the visual label is used to describe the visual features of the scene object in at least one dimension.
[0365] Optionally, the multimodal model includes a visual question answering model; the question statement carries attribute text of the scene objects; on the one hand, the question statement is used to guide the visual question answering model to convert the appearance image into the visual label of the scene object; on the other hand, while guiding the conversion of the visual label of the scene object, the question statement provides supplementary information of the scene object in text form.
[0366] Get the expected information of scene objects;
[0367] Exemplarily, the expected information is used to indicate the description dimension of the scene object expected in the visual tag, and / or the expected format of the visual tag; in one example, the expected information is used to indicate that the description dimension of the scene object expected in the visual tag includes but is not limited to at least one of the type description, material, transparency, color, surface features, and shape of the scene object. In another example, the expected information is used to indicate that the expected format of the visual tag is at least one of the following: Comma Separated Values (CSV), JavaScript Object Notation (JSON), and eXtensible Markup Language (XML).
[0368] Construct a question statement of the appearance image based on the expected information and attribute text;
[0369] Exemplarily, the first subpart of the question sentence is supplementary introduction information of the scene object, carrying attribute text of the scene object; the second subpart of the question sentence is an answer guidance sentence for the visual question answering model, carrying expected information.
[0370] Optionally, the spatial data set includes matching labels of scene objects in the virtual scene; correspondingly: performing pseudo-spoken rewriting on the visual labels of the scene objects to obtain matching labels that conform to spoken expressions of natural language.
[0371] Exemplarily, as described above, visual labels are used to describe the visual features of scene objects in at least one dimension, and the appearance image of the scene objects presents rich visual features of the scene objects. In the spoken expression of natural language, however, the description of scene objects cannot cover the visual features of scene objects in all dimensions. The purpose of performing a pseudo-colloquial rewrite on the visual labels of scene objects is to obtain a matching label that is closer to the spoken expression; it can be understood that performing a pseudo-colloquial rewrite can be to delete part of the content in the visual label, or to change the visual label to a label with the same semantics but different textual expression.
[0372] In an optional implementation, the pseudo-colloquial rewriting is performed by calling a natural language model; the visual labels of the scene objects are input into the natural language model, and matching labels that conform to the spoken expressions of the natural language are predicted. The pseudo-colloquial rewriting of the visual labels is implemented based on calling the natural language model. Exemplarily, the natural language model carries prior knowledge of the spoken expressions of the natural language. For example, the natural language model is implemented as a large language model (Large Language Model, LLM).
[0373] Optionally, the spatial dataset also includes spatial information of scene objects, and accordingly, also includes:
[0374] The spatial position of the scene object in the virtual scene is obtained, and the spatial position of the scene object is determined as auxiliary information of the visual label of the scene object.
[0375] Exemplarily, the spatial position of the scene object in the virtual scene is used to indicate the deployment of the scene object in the virtual scene, and the spatial information is used to indicate the position, size and other information of the scene object in the virtual scene after the scene object is deployed in the virtual scene.
[0376] Further, obtaining at least one of the coordinate position, orientation information, bounding box information, and cover point information of the scene object in the virtual scene;
[0377] Among them, the coordinate position (Location) is used to indicate the position of the scene object in the virtual scene, such as the coordinate information of the center point or preset point of the scene object in the virtual scene; the orientation (Rotation) is used to indicate the direction facing the scene object in the virtual scene, such as the direction facing the front of the scene object in the virtual scene; the bounding box (BoundingBox) is used to indicate the size of the scene object in the virtual scene; the cover points (Cover points) are used to indicate the recommended virtual character position points when the virtual character approaches the scene object, so that the scene object can mask the virtual character.
[0378] The intention recognition phase of step 205 can be implemented as follows:
[0379] Sub-step 4: calling at least one hierarchical prediction network to perform intent recognition on the natural language command, and obtaining a first classification label of the natural language command intent to command the NPC;
[0380] Exemplarily, the hierarchical prediction network has the ability to predict the classification label corresponding to the command text. Exemplarily, the hierarchical prediction network includes at least two layers of sub-networks, the upper network and the lower network are cascaded, and the lower network further performs the prediction of the classification label according to the prediction result output by the upper network. At least two layers of sub-networks are constructed based on the tree structure of multiple classification labels. The hierarchical prediction network constructs at least two layers of sub-networks corresponding to the hierarchical structure for the tree structure of the classification labels, and splits the prediction task of a wide variety of classification labels into prediction sub-tasks performed by at least two layers of sub-networks, so as to reduce the complexity of classification prediction of each layer of sub-network.
[0381] In an optional implementation, each hierarchical prediction network in at least one hierarchical prediction network is used to predict the command intention of the command text for a non-player character on an intention dimension; the intention dimension includes: at least one of the subject dimension, the semantic dimension, and the behavior dimension. Exemplarily, in at least one hierarchical prediction network, the i-th layer subnetwork in each hierarchical prediction network is used to predict the first-level behavior label of the command text on an intention dimension, and the i+1-th layer subnetwork in the hierarchical prediction network is used to predict the second-level behavior label corresponding to the command text in the first-level behavior label, i is a positive integer; the high-level behavior label (such as the first-level behavior label) predicted by the high-level subnetwork (such as the i-th layer subnetwork) in the hierarchical prediction network includes multiple sublabels, or subordinate lower-level labels; the corresponding low-level subnetwork (such as the i+1-th layer subnetwork) needs to be called to further perform classification prediction (such as predicting the second-level behavior label). The prediction task of a wide variety of classification labels is split into prediction subtasks performed by at least two layers of subnetworks to reduce the complexity of classification prediction of each layer of subnetwork.
[0382] Furthermore, the intent dimension includes a subject dimension, the hierarchical prediction network includes a hierarchical subject prediction network, and the subject prediction network has the ability to predict the subject type in a natural language command; the subject type is used to indicate the identity of the NPC commanded by the natural language command; exemplarily, the subject prediction network is used to predict which of a plurality of non-player characters the non-player character commanded by the command text is, and the number of non-player characters commanded by the command text can be one or more.
[0383] And / or, the intent dimension includes a semantic dimension, the hierarchical prediction network includes a hierarchical semantic prediction network, the semantic prediction network has the ability to predict the semantic type in a natural language command; the semantic type is used to indicate the NPC's control method for initiating a virtual attack; exemplarily, the subject prediction network is used to predict whether the virtual activity performed by a non-player character commanded by the command text is related to initiating a virtual attack.
[0384] And / or, the intention dimension includes a behavior dimension, the hierarchical prediction network includes a hierarchical behavior prediction network, the behavior prediction network has the ability to predict the behavior intention type in the natural language command; the behavior intention type is used to indicate the behavior mode of the NPC for performing the virtual activity. Exemplarily, the behavior prediction network is used to predict what virtual activity the non-player character performs.
[0385] Accordingly, in step 207, in response to the natural language command, the NPC is controlled to perform a virtual activity according to the first intention corresponding to the first classification label;
[0386] Exemplarily, the first intention corresponding to the first classification tag indicates a command intention for a non-player character in an intention dimension, such as at least one of the following: indicating which non-player character is commanded by the command text among a plurality of non-player characters, indicating whether the virtual activity performed by the non-player character is related to launching a virtual attack, and indicating what virtual activity the non-player character performs. According to the instruction of the first classification tag, the NPC is controlled to perform the virtual activity.
[0387] The target entity identification process of step 206 can be implemented as follows:
[0388] Sub-step 5: querying and obtaining the target entity from the entity set of the virtual environment according to the target entity information of the target entity indicated by the natural language command and the environment perception information;
[0389] The target entity is determined from the virtual environment in combination with environmental perception information, and the environmental perception information includes information perceived by the main virtual character and / or the non-player character from the virtual environment.
[0390] Since the target entity information in natural language commands is usually vague, for example, a natural language command may be "move to the red truck", where the target entity information is "red truck", and there may be many red trucks in the virtual environment. It is impossible to accurately determine the target entity in the virtual environment based solely on the target entity information in the natural language command.
[0391] Therefore, the embodiment of the present application provides a method for determining the target entity by combining the target entity information and the environmental perception information. For the previous example, the "red truck" expressed by the player in the natural language command should be a red truck that the player can see. Therefore, combined with the field of view of the main control virtual character, the red truck within the field of view of the main control system character can be screened out from the multiple red trucks in the virtual environment. The red truck is the target entity indicated by the player in the natural language command.
[0392] Since natural language commands are issued by players based on their perception of the virtual environment, in order to accurately identify the target entity indicated in the natural language command, the game application will combine the environmental perception information when the player issues the natural language command to identify the target entity in the natural language command. Based on the player's perception of the virtual environment, the entity that the player can perceive in the virtual environment and is closest to the target entity information is inferred as the target entity.
[0393] Exemplarily, the virtual environment includes multiple candidate entities that match the natural language command, and the target entity is an entity selected from the multiple candidate entities based on the environmental perception information of the main virtual character or the non-player character. For example, the game application first selects multiple candidate entities that match the target entity information in the natural language command from the entity set, and then selects the entity that can be perceived by the main virtual character or the non-player character from the multiple candidate entities as the target entity based on the environmental perception information.
[0394] For example, the environmental perception information of the main virtual character may include: the pictures or entities that the main virtual character can see when observing the virtual environment, the environmental sound effects that the main virtual character can hear, the source direction of the environmental sound effects, the type and volume of the environmental sound effects, the perception information obtained by the main virtual character by using perception skills (for example, visual information, auditory information, sound wave information, light reflection information, etc.), and the perception information obtained by the main virtual character by using sensing props (for example, sensor signals from sensors, positioning signals from positioning props, etc.).
[0395] The environmental perception information of the non-player character may include: the images or entities that the non-player character can see when observing the virtual environment, the environmental sounds that the non-player character can hear, the source direction of the environmental sounds, the type and volume of the environmental sounds, the perception information obtained by the non-player character by using perception skills (for example, visual information, auditory information, sound wave information, light reflection information, etc.), and the perception information obtained by the non-player character by using sensory props (for example, sensor signals of sensors, positioning signals of positioning props, etc.).
[0396] It should be noted that the environmental perception information may include the information perceived by the controlling virtual character and the non-player character in real time when receiving the natural language command, and may also include the information perceived by the controlling virtual character and the non-player character in history before receiving the natural language command. That is, the target entity may be the entity currently seen by the player, or it may be the entity that the player has seen in the past. Therefore, the game application needs to combine the real-time environmental perception information and the historical environmental perception information of the controlling virtual character and / or the non-player character to identify the target entity.
[0397] For example, when the natural language command is "Let's go back to the hotel we just passed by", the game application needs to query the hotels that the main virtual character has passed by based on the historical environmental perception information of the main virtual character.
[0398] In an optional embodiment, the client queries and obtains the target entity from the entity set of the virtual environment according to the target entity information and the environment perception information indicated by the natural language command. In another optional embodiment, the client reports the natural language command to the server, and the server queries and obtains the target entity from the entity set of the virtual environment according to the target entity information and the environment perception information indicated by the natural language command.
[0399] Optionally, the game application infers the target entity based on the target entity information, the environment perception information and the pre-processed virtual environment data, wherein the pre-processed virtual environment data includes a set of entities in the virtual environment.
[0400] The entity set includes entity information of each entity in the virtual environment. The entity information includes at least one of the following: name, type, location, feature, text label, embedding vector of text label, image, embedding vector of image.
[0401] The text label may be at least one word obtained after segmenting a feature (for example, a descriptive text of an entity appearance), and the embedding model is called to obtain an embedding vector corresponding to each text label.
[0402] The image may include an image obtained by observing a three-dimensional model of the entity from at least one direction, for example, the image may include three views of the entity. The embedding vector of the image is the embedding vector of the image feature label. The image feature label is obtained by calling the multimodal model to perform feature recognition based on the image and text label of the entity.
[0403] Exemplarily, the entity set includes a first type of entity and a second type of entity, the first type of entity includes at least one of an area and a building, and the second type of entity includes a physical object. The text labels of the first type of entity are obtained by manual labeling. For example, the text label of a room of a building is manually labeled as: an area, a building, a floor, and a room. The text labels of the second type of entity are automatically generated by calling a large language model.
[0404] The method for generating text labels for the second type of entity may include: obtaining at least one image of the entity, inputting the at least one image into a large language model, and obtaining a description text of the entity; segmenting the description text to obtain at least one text label of the entity, each text label including a word obtained after the segmentation process; performing a vectorization operation on the text label to obtain an embedding vector corresponding to the text label.
[0405] The embedding vector is the high-dimensional vector data of the text label. By pre-generating the embedding vector of the text label, there is no need to repeatedly generate vectors for the text label of each entity when matching the target entity from the entity set based on the target entity information, which can improve the matching efficiency of the target entity information and the entity information.
[0406] It should be noted that this method does not use the description text directly as the text label, but uses the word segmentation result of the description text as the text label. This is because the description text is usually of different lengths. For longer description texts, their embedding vectors are less effective in actual search and similarity comparison. For example, when searching for "a small blue truck with rusty body" using "truck", "a small blue truck with rusty body" is likely to be ranked after "a car" in the recall results. In fact, for the searched "truck", no matter how complex its additional description is, "truck" should be searched first. Therefore, when performing similarity search, the comparison should be one feature word at a time, not the description text.
[0407] In addition, in order to further extract the image features of the entity, the method provided in the embodiment of the present application can also further extract hidden visual features in the image of the entity based on the text label and image of the entity. Taking the first entity as an example, the method includes: obtaining at least one perspective image of the first entity; obtaining at least one text label of the first entity; calling the multimodal model to extract the image features of the first entity based on at least one perspective image and at least one text label of the first entity, and obtain the image embedding vector of the first entity.
[0408] Since text labels are manually annotated, or generated by a large language model based on human language characteristics; and text labels extracted based on human language habits may ignore some features of the entity. For example, when manually annotating a text label for an oil drum, only more eye-catching text labels such as "metal" and "rust" may be annotated, while detailed features such as "rust", "blue", "yellow", and "paint peeling in the lower right corner" are ignored. Therefore, the method provided in the embodiment of the present application also uses a multimodal model based on the text label and entity image of the entity, so that the multimodal model extracts more image features from it; performs image similarity matching with the target entity based on the image features to improve the recognition accuracy of the target entity.
[0409] Among them, the training method of the multimodal model can be: inputting sample entity images and sample labels into the pre-trained multimodal model, fine-tuning the pre-trained multimodal model according to the loss of the predicted labels and sample labels output by the pre-trained multimodal model, and obtaining a multimodal model that can output image feature labels based on the input text labels and images, and the image feature labels include more detailed description texts proposed from the image. For example, the text description of "a metal oil barrel" can only be associated with the two text labels "metal" and "oil barrel", while the Clip (multimodal) model can also identify the hidden visual information in the image from the image of the oil barrel, such as "rusty", "blue", and "yellow" image feature labels, which are features that do not appear in the text labels. Therefore, combining the Clip model for image feature search can further improve the accuracy of entity search.
[0410] In an optional embodiment, the game application may query the target entity using the following method.
[0411] (1) Parse the natural language command to obtain target entity information; the target entity information includes at least one of the following: entity type, entity name, entity location, and entity feature.
[0412] Optionally, the game application calls the large language model to parse the natural language command to obtain target entity information of the target entity, and calls the embedding model to vectorize the target entity information to obtain a target embedding vector of the target entity information.
[0413] For example, if the natural language command is "Come to the blue truck in front", the target entity information that can be parsed by the large language model includes: the direction information "front" and the entity name "blue truck".
[0414] For example, named entity recognition technology in the field of natural language processing can also be used to extract target entity information from natural language commands. Named entity recognition technology is used to identify entities with specific meanings in texts, such as names of people, places, locative words, adjectives, etc.
[0415] For example, if the natural language command is "Go to the first floor of the motel and find a paper box behind the red sofa", the named entity recognition technology can identify: the architectural noun "the first floor of the motel"; the object nouns "sofa" and "paper box"; the locative word "behind"; the adjective "red". After logical construction, a hierarchical scene query call form with search type, content, locative word, and constraint information can be formed. Among them, the search type is used to narrow the data retrieval scope based on similarity matching, the search content is a specific entity description, and the adjective will be merged into the description text for query together, and the locative word is used to form a constraint on the search scope. The floor constraint is determined by the player's location. In indoor scenes, the upper and lower ranges need to be narrowed to avoid finding invisible entities across floors.
[0416] (2) Calculate the similarity between the target entity information and each entity information in the entity set.
[0417] Exemplarily, the entity set includes entity information of at least one entity, and the entity information of each entity may include at least one of a text embedding vector of a text label and an embedding vector of an image feature. Then the target entity information may calculate similarity with the text embedding vector and the image embedding vector respectively, and the entity with higher similarity is determined as the target entity.
[0418] The following are methods for similarity matching with text embedding vectors and similarity matching with image embedding vectors.
[0419] 1) Similarity includes the text similarity between the target entity information and the text embedding vector.
[0420] Taking the first entity in the entity set as an example, the game application (client or server) segments the target entity information to obtain at least one target entity tag; converts the at least one target entity tag into at least one target embedding vector; obtains the entity information of the first entity, the entity information includes a text embedding vector, and the text embedding vector is an embedding vector obtained based on the text tag conversion of the first entity; calculates the text parent similarity between at least one target embedding vector and the text embedding vector respectively, and obtains at least one text parent similarity corresponding to at least one target embedding vector; and determines the sum of the at least one text parent similarity as the text similarity between the target entity information and the entity information of the first entity.
[0421] For example, the number of target entity tags is two, target entity tag 1 and target entity tag 2, and the number of entities in the entity set is also two, entity 1 and entity 2. Entity 1 corresponds to text embedding vector 1, and entity 2 corresponds to text embedding vector 2. Then similarity 1 between target entity tag 1 and text embedding vector 1 is calculated, and similarity 2 between target entity tag 2 and text embedding vector 1 is calculated, and the sum of similarity 1 and similarity 2 is determined as the text similarity between the target entity information and entity 1. Similarity 3 between target entity tag 1 and text embedding vector 2 is calculated, and similarity 4 between target entity tag 2 and text embedding vector 2 is calculated, and the sum of similarity 3 and similarity 4 is determined as the text similarity between the target entity information and entity 2.
[0422] Exemplarily, the entity information of the first entity includes at least one text embedding vector; the at least one target embedding vector includes a first target embedding vector; the game application calculates the text sub-similarity between the first target embedding vector and the at least one text embedding vector respectively to obtain at least one text sub-similarity; the highest value of the at least one text sub-similarity is determined as the text parent similarity corresponding to the first target embedding vector.
[0423] For example, the number of target entity tags is 1: target entity tag 1. The number of entities in the entity set is also 1: entity 1. Entity 1 corresponds to text embedding vector 1 and text embedding vector 3. Then the similarity 1 between target entity tag 1 and text embedding vector 1 is calculated, and the similarity 5 between target entity tag 1 and text embedding vector 3 is calculated, and the larger value of similarity 1 and similarity 5 is determined as the similarity between the target entity information (target entity tag 1) and entity 1.
[0424] For example, for the input target entity information "blue car", the target entity information is first segmented into target entity labels "blue" and "car", which means that the queried target entity has two features. Then each feature is calculated with each entity in the entity set for similarity, and each feature takes the maximum similarity. Finally, the sum of the similarity scores corresponding to all query features is taken, which represents the text similarity between the target entity information and the queried entity.
[0425] For example, the target entity information includes two target entity tags "blue" and "car", and the two target entity tags are converted into two target embedding vectors. Then the entity information in the entity set is obtained. For example, the entity set includes entity 1 and entity 2. The text tags of entity 1 include "metal", "old", "car", "truck", "blue", and "damaged", and the text tags of entity 2 include "metal", "scratches", "car", "damaged", "money transporter", and "black".
[0426] Calculate the text similarity between the target entity information and entity 1: first calculate the similarity between the target entity label "blue" and each text label of entity 1, and take the maximum value. For example, the similarity between the target entity label "blue" and the text label "blue" of entity 1 is 1 (1 is the maximum value); then calculate the similarity between the target entity label "car" and each text label of entity 1, and take the maximum value. For example, the similarity between the target entity label "car" and the text label "car" of entity 1 is 1. Then sum the two similarities of the target entity labels "car" and "blue" to obtain the final similarity between the target entity information and entity 1, which is 2.
[0427] Similarly, calculate the text similarity between the target entity information and entity 2: first calculate the similarity between the target entity label "blue" and each text label of entity 2, and take the maximum value. For example, the similarity between the target entity label "blue" and the text label "black" of entity 1 is 0.91; then calculate the similarity between the target entity label "car" and each text label of entity 1, and take the maximum value. For example, the similarity between the target entity label "car" and the text label "car" of entity 2 is 1 (1 is the maximum value). Then sum the two similarities of the target entity labels "car" and "blue" to obtain the final similarity between the target entity information and entity 2, which is 1.91.
[0428] It can be seen that the similarity between the target entity information and entity 1 is 2, which is higher than the similarity between the target entity information and entity 2, which is 1.91.
[0429] 2) Similarity includes the image similarity between the target entity information and the image embedding vector.
[0430] Taking the first entity in the entity set as an example, the game application (client or server) segments the target entity information to obtain at least one target entity tag; converts the at least one target entity tag into at least one target embedding vector; obtains the entity information of the first entity, the entity information includes an image embedding vector, and the image embedding vector is an embedding vector obtained based on the image extraction of the first entity; calculates the image parent similarity of at least one target embedding vector and the text embedding vector respectively, and obtains at least one image parent similarity corresponding to the at least one target embedding vector; and determines the sum of the at least one image parent similarity as the image similarity between the target entity information and the entity information of the first entity.
[0431] For example, the number of target entity tags is two, target entity tag 1 and target entity tag 2, and the number of entities in the entity set is also two, entity 1 and entity 2. Entity 1 corresponds to image embedding vector 1, and entity 2 corresponds to image embedding vector 2. Then similarity 1 between target entity tag 1 and image embedding vector 1 is calculated, and similarity 2 between target entity tag 2 and image embedding vector 1 is calculated, and the sum of similarity 1 and similarity 2 is determined as the image similarity between the target entity information and entity 1. Similarity 3 between target entity tag 1 and image embedding vector 2 is calculated, and similarity 4 between target entity tag 2 and image embedding vector 2 is calculated, and the sum of similarity 3 and similarity 4 is determined as the image similarity between the target entity information and entity 2.
[0432] Exemplarily, the entity information of the first entity includes at least one image embedding vector; at least one target embedding vector includes a first target embedding vector; the game application calculates the image sub-similarity between the first target embedding vector and the at least one image embedding vector respectively to obtain at least one image sub-similarity; and the highest value of the at least one image sub-similarity is determined as the image parent similarity corresponding to the first target embedding vector.
[0433] For example, the number of target entity tags is 1: target entity tag 1. The number of entities in the entity set is also 1: entity 1. Entity 1 corresponds to image embedding vector 1 and image embedding vector 3. Then the similarity 1 between target entity tag 1 and image embedding vector 1 is calculated, and the similarity 5 between target entity tag 1 and image embedding vector 3 is calculated, and the larger value of similarity 1 and similarity 5 is determined as the similarity between the target entity information (target entity tag 1) and entity 1.
[0434] In an optional embodiment, the target image embedding vector may be used for calculating the image similarity, that is, the target image embedding vector is used instead of the target embedding vector in the above method. The target image embedding vector may be obtained by: segmenting the target entity information to obtain at least one target entity tag; inputting at least one target entity tag into a multimodal model to obtain a target image embedding vector.
[0435] 3) Similarity includes text similarity and image similarity.
[0436] When the first entity and the target entity have corresponding text similarity and image similarity, the game application determines an average value of the text similarity and the image similarity as the similarity between the first entity and the target entity.
[0437] Alternatively, when the first entity and the target entity have corresponding text similarity and image similarity, the larger value of the text similarity and the image similarity is determined as the similarity between the first entity and the target entity.
[0438] Alternatively, when the first entity and the target entity have corresponding text similarity and image similarity, the sum of the text similarity and the image similarity is determined as the similarity between the first entity and the target entity.
[0439] (3) Determine the target entity from the entity set based on similarity and environmental perception information.
[0440] In an optional embodiment, the game application first performs a similarity search based on the target entity information to obtain at least one candidate entity with a high similarity, and sorts them according to the similarity; then, based on the position, location, orientation and other information of the main virtual character and / or the non-player character, the game application performs perceptual filtering and sorting, and finally screens out the target entity.
[0441] Exemplarily, the game application determines a target perception range based on target entity information and environmental perception information; and obtains the target entity by filtering entities perceived within the target perception range based on similarity.
[0442] Alternatively, the game application determines x entities with the highest similarity from the entity set according to the similarity to form a candidate entity list; determines the target perception range according to the target entity information and the environmental perception information, and determines the entity in the target perception range among the x entities as the target entity. x is a positive integer.
[0443] Exemplarily, the game application determines the entity with the highest similarity in the perception range as the target entity.
[0444] It should be noted that when there are multiple entities with equal similarity within the target perception range, the multiple entities can be sorted according to the distance between the entity and the controlling virtual character. For example, when there are at least two entities with the highest similarity in the perception range, the entity with the highest similarity in the perception range and the closest distance to the controlling virtual character is determined as the target entity.
[0445] In an optional embodiment, the game application determines the entity with the highest similarity within the perception range and above the threshold as the target entity. Exemplarily, the number of the perception range is at least one. For example, the perception range includes at least one of the following: the visual range of the main virtual character, the hearing range of the main virtual character, the perception range of the main virtual character's perception of virtual props, the visual range of the non-player character, the hearing range of the non-player character, and the perception range of the non-player character's perception of virtual props.
[0446] Exemplarily, the game application may sequentially traverse at least one of the above-mentioned perception ranges, or the game application may sequentially traverse at least one perception range determined according to the natural language command. For example, if the natural language command is "Can you see the truck in front? Move to the truck", the game application may first traverse the visual range of the main virtual character, and then traverse the visual range of the non-player character, and match the entity with the highest similarity and above the threshold.
[0447] Exemplarily, when there are at least two perception ranges, the traversal order of the at least two perception ranges may be preset, or the traversal order of the at least two perception ranges may be determined according to the intention indicated in the natural language command. For example, when the intention is to search for an item, the visual range is traversed first. When the intention is to find a combat scene, the auditory range is traversed first.
[0448] If there are multiple levels of nested instructions in the natural language command, the first target entity will be searched first, and then the next target entity will be searched based on the position of the previous target entity. In the case where the natural language command includes a second target entity determined based on the position of the first target entity, the first target entity is queried from the entity set of the virtual environment based on the first target entity information and environmental perception information of the first target entity indicated by the natural language command; then the second target entity is queried from the entity set of the virtual environment based on the second target entity information, the first target entity and environmental perception information of the second target entity.
[0449] In response to natural language commands, the NPC is controlled to perform a virtual activity associated with a target entity.
[0450] Exemplarily, a large language model is called to identify the behavioral intent of natural language commands, and a control instruction or a control instruction sequence is generated according to the behavioral intent. According to the control instruction or the control instruction sequence, a non-player character is controlled to complete an activity based on a target entity.
[0451] The broadcasting of the NPC feedback information in step 208 may be implemented as follows:
[0452] Sub-step 6: reporting feedback information of the non-player character, wherein the feedback text corresponding to the feedback information is a non-fixed text generated based on the environmental perception information of the non-player character;
[0453] Exemplarily, the game application can generate corresponding feedback information in real time according to the environmental perception information of the non-player character and make a broadcast. For example, when the environmental perception information of the non-player character triggers the broadcast condition, the game application can generate corresponding feedback information in real time according to the environmental perception information that triggers the broadcast condition; or, when the non-player character or the main control virtual character triggers the broadcast condition, the game application can generate corresponding feedback information in real time according to the environmental perception information of the non-player character.
[0454] For example, the feedback text is obtained by inferring the large language model based on the static entity data of the three-dimensional virtual environment and the dynamic environment perception information of the non-player character. The large language model will generate different feedback texts according to the different perception situations of the non-player character.
[0455] For example, the feedback text can also be obtained by inferring the static entity data of the three-dimensional virtual environment and the dynamic environment perception information of the non-player character through the language model, and the feedback text can be in line with the personality characteristics of the non-player character. For example, when the non-player character is a strong uncle, the feedback text can adopt a heroic tone; when the non-player character is a reporter, the feedback text can adopt a news report tone.
[0456] It should be noted that due to the randomness of the results generated by the large language model, in the same scene, when the environmental perception information of the non-player character is the same, the generated feedback text may also be different.
[0457] The environmental perception information may include information perceived by the non-player character in real time, or may include information perceived by the non-player character historically.
[0458] Exemplarily, the feedback information is inferred by the game application based on the environmental perception information of the non-player character and the static entity data of the three-dimensional virtual environment. The feedback information can be a voice broadcast or a text broadcast. The static entity data includes data of relatively unchanged entities in the three-dimensional virtual environment, for example, model information of various buildings, terrains, and vehicles in the three-dimensional virtual environment.
[0459] Exemplarily, the feedback information may include at least one of the following: instant feedback, execution feedback, and dynamic feedback. Instant feedback and execution feedback are both feedback information generated for natural language commands, and dynamic feedback is feedback information spontaneously generated by non-player characters.
[0460] 1. Instant feedback is feedback information generated immediately when a natural language command is received. Instant feedback can include reply broadcast and instant broadcast. Reply broadcast is used to resume the inquiry in the natural language command; instant broadcast is used to feedback the reception of the natural language command.
[0461] For example, the client can command the non-player character to move in the three-dimensional virtual environment according to the intention of the natural language command. Then, when the client receives the natural language command, it can generate instant feedback corresponding to the natural language command, and the instant feedback is used to indicate that the natural language command has been received, or the instant feedback is used to instantly reply to the natural language command.
[0462] In an optional embodiment, the feedback information includes a reply report. The reply report includes a reply to the query natural language command generated in response to the query natural language command raised by the player. For example, when the query natural language command includes querying the location of the target entity, the corresponding reply report should include the query result of the location of the target entity.
[0463] When the behavioral intention of the received natural language command is an inquiry, the terminal broadcasts a reply message of the non-player character; the reply message includes reply content for the natural language command generated according to the environmental perception information of the non-player character on the three-dimensional virtual environment.
[0464] The natural language command is used to inquire about information from the non-player character. The natural language command may be referred to as an inquiry natural language command. The inquiry natural language command is a natural language command intended to be an inquiry. The inquiry natural language command contains at least one question.
[0465] Natural language commands are command instructions conveyed using human natural language. The terminal receives the natural language commands issued by the player and commands the non-player characters according to the intention corresponding to the natural language commands. For example, the terminal receives the voice audio of the player, converts the voice audio into text, and obtains the natural language command. Alternatively, the terminal receives the text of the natural language command input by the player.
[0466] Players can use spoken or written language to issue natural language commands. The game application will use the large language model to understand the natural language commands, extract the intentions expressed in the natural language commands, generate control instructions based on the intentions, and direct the activities of non-player characters.
[0467] For example, a natural language command may be "Come to me", and the game application may parse out that the intention of the natural language command is "control the non-player character to move to the location of the controlling virtual character". The game application then obtains the location of the controlling virtual character, generates a navigation route for the non-player character to move to the location of the controlling virtual character, and controls the non-player character to move to the location of the controlling virtual character along the navigation route.
[0468] For another example, a natural language command may be "go pick up a treasure chest", then the game application may parse out that the intention of the natural language command is "control the non-player character to move to the location of the treasure chest and pick up the treasure chest", then the game application may obtain the location of the treasure chest, control the non-player character to move to the location of the treasure chest, and perform the operation of picking up the treasure chest after arriving at the location of the treasure chest.
[0469] For example, when the natural language command includes an intelligence inquiry about the target entity, a first reply report is broadcast based on the non-player character's perception of the target entity; the first reply report includes the intelligence perception result of the non-player character about the target entity.
[0470] Alternatively, when the natural language command includes an inquiry about the location of the target entity, a second reply broadcast is broadcast based on the non-player character's perception of the target entity, and the second reply broadcast includes a description of the location of the target entity.
[0471] Exemplarily, a large language model is called to parse the received natural language command to obtain the intention of the natural language command. When the intention is of an inquiry type, the natural language command can be determined to be an inquiry natural language command. When the natural language command is an inquiry natural language command, the large language model can infer according to the intention of the natural language command, based on static entity data and environmental perception information, to obtain a reply text. That is, the large language model is called to parse the received natural language command, and the intention of the natural language command is output as an inquiry, as well as the reply text of the natural language command. The game application calls the text-to-speech service according to the processing logic of the inquiry intention, and converts the reply text into a reply broadcast, which is an audio broadcast, and sends the reply audio to the client for broadcast.
[0472] For example, when the large language model recognizes that the intention of the natural language command is to ask a question, since the user may ask hundreds of questions and it is impossible to store the answer to each question locally on the client, the game application will call the text-to-speech service to generate a reply broadcast in real time based on the reply text returned by the large language model, so that the game application can instantly generate a corresponding reply broadcast to respond to the player's question.
[0473] Exemplarily, a game application (client or server) calls a large language model to parse natural language commands, and infers a reply text based on static environmental data and environmental perception information of the three-dimensional virtual environment; and generates human voice audio based on the reply text to obtain a reply broadcast.
[0474] For example, the client reports the received natural language query command to the server, the server calls the large language model to parse the natural language query command, and infers the reply text based on the static environment data and environmental perception information of the three-dimensional virtual environment; generates human voice audio based on the reply text to obtain a reply broadcast; the server sends the reply broadcast to the client; and the client broadcasts the reply broadcast.
[0475] 2. Execution feedback is the feedback generated when a task is executed according to the intent indicated by the natural language command after receiving the natural language command. Execution feedback can also be called execution broadcast.
[0476] For example, when a natural language command is used to instruct a non-player character to perform a target task, the client can generate execution feedback during the non-player character's execution of the target task, and the execution feedback is used to indicate the execution status of the target task; or, the client can generate execution feedback after the non-player character completes the target task, and the execution feedback is used to indicate the execution result of the target task.
[0477] In an optional embodiment, the feedback information includes a feedback report (also referred to as execution feedback). The feedback report includes a report on the task execution status and task execution result generated in response to the task natural language command proposed by the player. For example, when the task natural language command includes moving to the target entity, the corresponding feedback report may include: moving to the target entity, or having reached the target entity.
[0478] When the behavioral intention of the received natural language command is to execute a task, the terminal broadcasts a feedback report; the feedback report includes an execution status after the natural language command is executed according to the environmental perception information of the non-player character on the three-dimensional virtual environment.
[0479] The natural language command is used to instruct the non-player character to perform a task. The natural language command may be referred to as a task natural language command. The task natural language command includes a description text of the task, for example, the description text of the task may include at least one of the following: the task name, the action that the non-player character needs to perform, the method used to perform the task, the task target, and the location of the task target.
[0480] For example, when the intention of the task natural language command includes searching for a target entity, a first feedback announcement is broadcast, and the first feedback announcement includes the search result of the non-player character for the target entity.
[0481] Alternatively, when the intention of the task natural language command includes using a virtual prop, a second feedback announcement is announced, and the second feedback announcement is used to indicate that the virtual prop is ready.
[0482] Alternatively, when the intention of the task natural language command includes the use of virtual props, a third feedback announcement is broadcast, and the third feedback announcement is used to indicate the result of the use of the virtual props.
[0483] Alternatively, when the intention of the task natural language command includes controlling the movement of the non-player character, a fourth feedback announcement is announced, and the fourth feedback announcement is used to indicate the movement result of the movement.
[0484] Alternatively, when the intention of the task natural language command includes performing an interaction with a target entity, a fifth feedback announcement is broadcast, and the fifth feedback announcement is used to indicate at least one of a search result of the non-player character for the target entity and an interaction result between the non-player character and the target entity.
[0485] Alternatively, when the intention of the task natural language command includes item interaction, a sixth feedback broadcast is broadcast, and the sixth feedback broadcast is used to indicate the item interaction result of the non-player character performing the item interaction.
[0486] Exemplarily, a large language model is called to parse the received natural language command to obtain the intention of the natural language command. When the intention is a task, the natural language command can be determined to be a task natural language command. When the natural language command is a task natural language command, the large language model can be inferred according to the intention of the natural language command, based on static entity data and environmental perception information, to obtain a task instruction sequence, and the task instruction sequence is used to control the non-player character to perform the task. When the game application receives the task instruction sequence, it controls the non-player character activity to perform the task according to the task instructions in the task instruction sequence. During the control of the non-player character according to the task instruction, the corresponding execution status can be obtained for feedback broadcast according to the feedback broadcast logic corresponding to different task instructions.
[0487] For example, since the instructions that can be executed by non-player characters in a three-dimensional virtual environment are finite and traversable, the client can locally store feedback broadcasts corresponding to each character's instructions. When the non-player character executes the corresponding instruction, the client can read the local feedback broadcast for voice broadcast.
[0488] Alternatively, when there is variable content in the feedback broadcast corresponding to a task instruction, for example, the target entity in the feedback broadcast is variable, or the position information in the feedback broadcast is variable; the client can also generate a broadcast voice with variable content based on the target entity or position information returned by the large language model, and splice it with the broadcast voice with immutable content stored locally to obtain the final feedback broadcast.
[0489] For example, when the task natural language command is "find a nearby treasure chest", calling the large language model to parse the task natural language command can get the intention of the task, the task goal is to find the target entity, and the target entity is a treasure chest; based on the static entity data and environmental perception information, reasoning can be obtained that there is a treasure chest in the left front of the main control virtual character. In the case that the target entity can be found, the feedback broadcast corresponding to the task goal is "found aaa at xxx", where xxx is the location of the target entity and aaa is the name of the target entity. The game application can call the online text-to-speech technology to generate the location voice according to the location information "left front" in the reasoning result; according to the name of the target entity "treasure chest", call the online text-to-speech technology to generate the name voice, and then splice the location voice and name voice into the feedback broadcast to get the final feedback broadcast.
[0490] Exemplarily, a game application (client or server) calls a large language model to parse natural language commands for a task, and infers task execution instructions based on static environmental data and environmental perception information of a three-dimensional virtual environment; controls a non-player character to perform the task according to the task execution instructions; generates feedback text according to the execution status of the non-player character performing the task; and generates human voice audio based on the feedback text to obtain a feedback broadcast.
[0491] For example, the client reports a task natural language command to the server; the server parses the task natural language command, and infers the task execution instructions based on the static environment data and environment perception information of the three-dimensional virtual environment; the non-player character is controlled to perform the task according to the task execution instructions; feedback text is generated according to the execution status of the non-player character performing the task; human voice audio is generated based on the feedback text to obtain a feedback broadcast; the server sends the feedback broadcast to the client; the client receives and broadcasts the feedback broadcast.
[0492] 3. Dynamic feedback is the feedback information generated spontaneously based on the environmental perception information of non-player characters. Dynamic feedback can also be called dynamic broadcast.
[0493] For example, the client can spontaneously generate dynamic feedback based on the perception of the three-dimensional virtual environment without receiving natural language commands, and the dynamic feedback is used to indicate abnormal situations found by the non-player character in the three-dimensional virtual environment. For example, abnormal situations may include: finding hostile virtual characters, finding changes in the status of friendly virtual characters, finding dangerous situations, finding traces of battle or looting, etc.
[0494] In an optional embodiment, the feedback information includes dynamic reporting (also referred to as "dynamic feedback"). The dynamic reporting includes reporting of abnormal situations perceived by non-player characters. For example, when a non-player character perceives being attacked, a report is made that the character is being attacked; when a non-player character perceives a dangerous situation ahead, a report is made that there is danger ahead.
[0495] The terminal broadcasts a dynamic report when the environmental perception information of the non-player character on the three-dimensional virtual environment meets the dynamic report conditions.
[0496] Dynamic reporting is a report generated by the game application based on the environmental perception information of non-player characters when it determines that there is an abnormal situation that needs to be reported. The dynamic report includes reminder information of the abnormal situation. For example, the abnormal situation may include at least one of the following: discovering a hostile virtual character, discovering a change in the status of a friendly virtual character, and discovering a new trace.
[0497] For example, in the case where the non-player character perceives a hostile virtual character, a first dynamic broadcast is broadcast; the first dynamic broadcast includes the position of the hostile virtual character perceived by the non-player character.
[0498] Alternatively, when the non-player character senses a dangerous situation, a second dynamic broadcast is broadcast; the second dynamic broadcast is used to prompt the dangerous situation.
[0499] Alternatively, when the non-player character senses a change in the state of the friendly virtual character, a third dynamic broadcast is broadcast; the third dynamic broadcast is used to prompt that the state of the friendly virtual character has changed.
[0500] Alternatively, when the non-player character finds new traces in the three-dimensional virtual environment, a fourth dynamic broadcast is broadcast; the fourth dynamic broadcast is used to prompt the new traces. The new traces may be combat traces and / or looting traces.
[0501] For example, since the number of dynamic announcements that can be triggered by non-player characters in a three-dimensional virtual environment is limited and traversable, the client can store dynamic announcement voices locally, and the client can read the dynamic announcement voices locally for announcement when the corresponding dynamic announcement voices are triggered. Similarly, some dynamic announcement voices can contain variable content, and the client can generate variable content in real time through text-to-speech technology, and splice it with the dynamic announcement template to obtain the final dynamic announcement.
[0502] In an optional embodiment, when generating feedback information, it may be necessary to query the location of the target entity in the three-dimensional virtual environment, or determine the target entity indicated in the natural language command from the three-dimensional virtual environment. In this case, an entity query method is required to query the target entity.
[0503] Before executing the target entity query, it is necessary to pre-build the static entity data of the 3D virtual environment. The static entity data construction can serve both the reasoning of the large language model and the real-time feedback text generation on the game application side after the reasoning results are returned.
[0504] In an optional embodiment, entities in the three-dimensional virtual environment are traversed, and entity information of each entity is exported from a game engine to obtain static entity data.
[0505] For example, for in-game scenes, editor tools have been developed to perform StaticMesh traversal of the entire scene, special Actor traversal (such as interactive doors, which do not belong to the StaticMesh category), vegetation traversal, and export the entity's position, orientation, and bounding box size as static entity data for subsequent labeling and reasoning by the large language model.
[0506] Among them, StaticMesh is a static geometry resource type in the Unreal Engine 4 (UE4) game engine, which is used to represent immutable 3D models, such as buildings, props, etc. Actor is a basic object class in the Unreal Engine 4 (UE4) game engine, representing an entity in the game world, such as a character, object, light source, etc. Actor can contain multiple components to achieve different functions.
[0507] Exemplarily, static entity data can also include spatial data, which is obtained by manual labeling. Spatial data is more complex than static entities because there are multiple floors in the space and multiple layers of nesting within the floors (such as the motel area includes the second floor, and the second floor area includes room 201). For this type of data, manual calibration is used to construct it. Add Volume to the scene in the editor, divide the area required for the entire map and label it accordingly. Volume is a special Actor class in the UnrealEngine 4 (UE4) game engine, which represents a three-dimensional area with specific functions, such as a trigger area, an audio area, etc.
[0508] After obtaining the static entity data, you can query entities or spaces based on the static entity data during the game.
[0509] For example, when a player issues a natural language command, the natural language command will be accompanied by the constructed static entity data and the real-time captured runtime data (including the environmental perception information of non-player characters and / or the main virtual character) to make an inference request to the large language model. In addition, when the NPC needs to provide dynamic feedback based on the runtime data, an entity query is also performed to generate feedback text based on the current state.
[0510] When a natural language command includes a target entity, the game application will query the target entity based on the position and orientation of the current controlling virtual character, the position and orientation of teammates or enemies, and based on the target entity information of the target entity described in the natural language command and the environmental perception information of the controlling virtual character and / or the non-player character, filter out a target entity that matches the target entity information from at least one candidate entity within the perception range of the controlling virtual character and / or the non-player character.
[0511] Optionally, the natural language command is used to instruct the non-player character to perform an activity related to the target entity. For example, the target entity may be a destination for the non-player character to move to, an object that the non-player character needs to observe, a target that the non-player character needs to attack, or an object that the non-player character needs to interact with.
[0512] The target entity is a virtual object that exists in a three-dimensional virtual environment. The target entity is the entity described in a natural language command. An entity may refer to a virtual object that is fixed in a three-dimensional virtual environment. For example, a target entity may be a virtual building, a virtual terrain, a virtual vehicle, a virtual plant, a virtual prop, a virtual item, etc. An entity may also refer to a virtual object that can interact with a virtual character in a three-dimensional virtual environment. For example, a target entity may be an interaction point in a three-dimensional virtual environment (e.g., a door, a window, a cabinet, a cellar, etc.), a virtual prop, a virtual character, a virtual light source, etc.
[0513] For example, a natural language command may be "Please help me open the door", then the target entity may be "door", and the non-player character needs to perform a door-related activity "open the door". Alternatively, a natural language command may be "Is the kitchen safe", then the target entity may be "kitchen", and the non-player character needs to perform a kitchen-related activity "check if there are enemy avatars or other dangerous situations in the kitchen".
[0514] Optionally, the natural language command includes target entity information of the target entity. The target entity information may be a description text of the target entity. For example, the target entity information may include at least one of the following contents: the name, type, location, and features of the target entity. The game application may find the target entity from among the many entities in the three-dimensional virtual environment based on the target entity information in the natural language.
[0515] The game application parses the natural language command, extracts the target entity information therein, determines the target entity from the entity set of the three-dimensional virtual environment based on the target entity information, and then controls the non-player character to perform activities related to the target entity according to the intention of the natural language command.
[0516] The target entity is determined from the three-dimensional virtual environment in combination with environmental perception information, and the environmental perception information includes information perceived by at least one of the main virtual character and the non-player character from the three-dimensional virtual environment.
[0517] Since the target entity information in natural language commands is usually vague, for example, a natural language command may be "move to the red truck", where the target entity information is "red truck", and there may be many red trucks in the three-dimensional virtual environment. It is impossible to accurately determine the target entity in the three-dimensional virtual environment based solely on the target entity information in the natural language command.
[0518] Therefore, the embodiment of the present application provides a method for determining the target entity by combining the target entity information and the environmental perception information. For the previous example, the "red truck" expressed by the player in the natural language command should be a red truck that the player can see. Therefore, combined with the field of view of the main control virtual character, the red truck within the field of view of the main control system character can be screened out from multiple red trucks in the three-dimensional virtual environment. The red truck is the target entity indicated by the player in the natural language command.
[0519] Since natural language commands are issued by players based on their perception of the 3D virtual environment, in order to accurately identify the target entity indicated in the natural language command, the game application will combine the environmental perception information when the player issues the natural language command to identify the target entity in the natural language command. Based on the player's perception of the 3D virtual environment, the entity that the player can perceive in the 3D virtual environment and that is closest to the target entity information is inferred as the target entity.
[0520] Exemplarily, the three-dimensional virtual environment includes multiple candidate entities that match the natural language command, and the target entity is an entity selected from the multiple candidate entities based on the environmental perception information of the main virtual character or the non-player character. For example, the game application first selects multiple candidate entities that match the target entity information in the natural language command from the entity set, and then selects the entity that can be perceived by the main virtual character or the non-player character from the multiple candidate entities as the target entity based on the environmental perception information.
[0521] For example, the perception range of the main virtual character is determined according to the position and orientation of the main virtual character. For example, the perception range is a sector area of a certain visual field size in front of the main virtual character; entities that are not within the sector range are filtered out. Then, the target entity information and the entity information of the candidate entities are sorted according to the similarity, and entities with higher similarity are selected as target entities. When there are two entities with the highest and equal similarity scores within the perception range, for example, the similarity scores of entity 2 and entity 3 are both 2 points, then entity 2, which is closer to the main virtual character, is selected as the target entity.
[0522] When it is necessary to generate feedback information based on the position description of the target entity, the game application can perform a spatial query to generate a position description based on the position relationship between the master virtual character and the target entity.
[0523] The main application scenario of spatial query is to obtain the location of the main virtual character, non-player characters, hostile virtual characters, gunshots, etc. For example, a report containing spatial information such as "enemies found on the second floor of the motel" can be made.
[0524] The spatial query logic defines the concepts of parent area and child area. The parent area refers to a large area in a 3D virtual environment that covers multiple buildings or multiple isolated spaces, such as a motel with front and back yards and multiple rooms and basements. The child area refers to an independent space in the parent area, which can be a closed space or a special function space, such as a motel guest room or kitchen.
[0525] In order to make the location description returned by the spatial query closer to human expression, when the main virtual character and the queried location are in different parent areas, the query result returns complete text information (for example, the main virtual character is outside the motel and the queried location is on the second floor of the motel, then "the enemy is on the second floor of the motel" is returned). When the main virtual character and the queried location are in the same parent area but different child areas, the query result only returns the child area information (for example, the main virtual character is on the first floor of the motel and the queried location is on the second floor, then "the enemy is on the second floor" is returned). When the main virtual character and the queried location are in the same parent area and the same child area, the query result only returns the direction relative to the main perspective player (for example, the main virtual character and the queried location are both on the second floor of the motel, then "the enemy is in the right front position" is returned).
[0526] Exemplarily, when the controlling virtual character and the target entity are located in different parent spaces, the position description includes the parent space and the child space where the target entity is located. When the controlling virtual character and the target entity are located in different child spaces of the same parent space, the position description includes the child space where the target entity is located. When the controlling virtual character and the target entity are located in the same child space of the same parent space, the position description includes the relative position of the target entity and the controlling virtual character; wherein a parent space includes at least one child space.
[0527] For the broadcast of the NPC feedback information in step 208, the feedback information is implemented as spatial human voice audio processed by spatial sound effects, wherein the spatial sound effect processing process can be implemented as follows:
[0528] Sub-step 7: Obtaining human voice audio corresponding to the feedback text;
[0529] In the embodiment of the present application, the process of generating the feedback text is as shown in the above-mentioned sub-step 6, which will not be repeated here.
[0530] In some embodiments, the process of obtaining corresponding human voice audio based on feedback text can be implemented as follows: obtaining feedback text and character feature information corresponding to a non-player character; and generating human voice audio matching the character feature information according to the feedback text.
[0531] Illustratively, the character feature information is used to describe the attributes of the non-player character, that is, the character feature information is information used to describe the current state and characteristics of the non-player character. In some embodiments, the attributes of the non-player character include at least one of the basic attributes of the non-player character and the situational performance attributes. Among them, the basic attributes are attributes pre-configured for the non-player character, that is, the attributes of the non-player character that do not change due to the three-dimensional virtual environment or the current situation, such as the age information of the non-player character, the male / female information of the non-player character, the martial arts information of the non-player character, etc. The situational performance attributes are attributes determined in real time by the non-player character in the situation of the three-dimensional virtual environment, that is, attributes associated with the current situation, such as the emotional information and behavioral information of the non-player character in the current situation.
[0532] Optionally, the character feature information includes at least one of basic character information, character emotion information, and character behavior information. The basic character information is used to indicate the basic situation of the non-player character, and the basic character information is information about the basic attributes of the non-player character, such as the age information of the non-player character, the male / female information of the non-player character, and the martial arts information of the non-player character; the character emotion information is used to indicate the emotional state of the non-player character in the dialogue scenario corresponding to the feedback text, and the character emotion information is the situational performance attribute of the non-player character, such as the character emotion information indicates that the non-player character is in an excited state, an angry state, a sad state, etc.; the character behavior information is used to indicate the actions performed by the non-player character in the dialogue scenario, and the character behavior information is the situational performance attribute of the non-player character, such as being in a running state, an attacking state, an injured treatment state, etc.
[0533] In some embodiments, the generation of human voice audio is achieved through a pre-trained speech generation model, and the speech generation model is used to generate speech that matches the character feature information of the non-player character. In an illustrative example, the feedback text and the character feature information are input into the pre-trained speech generation model to obtain human voice audio as the human voice audio.
[0534] Optionally, the above-mentioned speech generation model can be implemented by a neural network model such as a convolutional neural network, a feedforward neural network, a residual network, a Transformer, a multimodal large language model (Multimodal Large Language Model, MLLM), etc., which is not specifically limited here.
[0535] In some embodiments, the speech generation model includes a text encoder, a role encoder and a decoder. The text encoder is used to perform text encoding on the input feedback text, that is, the feedback text is input into the text encoder to obtain a text encoding representation. The role encoder is used to perform feature encoding on the input role feature information, that is, the role feature information is input into the role encoder to obtain a role encoding representation.
[0536] Illustratively, after obtaining the text coding representation and the role coding representation, the text coding representation and the role coding representation are fused to obtain the coding representation input to the decoder, that is, the text coding representation and the role coding representation are fused to obtain a joint coding representation, and the joint coding representation is input into the decoder to generate human voice audio.
[0537] In some embodiments, the character encoder includes at least one of a first sub-encoder, a second sub-encoder, and a third sub-encoder. The first sub-encoder is used to perform feature encoding based on the basic attributes of the non-player character, that is, when the character feature information includes the character basic information, the character basic information is input into the first sub-encoder to obtain a first character encoding representation; the second sub-encoder is used to perform feature encoding based on the emotional state of the non-player character, that is, when the character feature information includes the character emotional information, the character emotional information is input into the second sub-encoder to obtain a second character encoding representation; the third sub-encoder is used to perform feature encoding based on the behavior state of the non-player character, that is, when the character feature information includes the character behavioral information, the character behavioral information is input into the third sub-encoder to obtain a third character encoding representation.
[0538] Sub-step 8: based on the relative position relationship between the non-player character and the main control virtual character in the three-dimensional virtual environment, obtaining sound effect parameters corresponding to the non-player character;
[0539] Illustratively, the relative position relationship between the non-player character and the controlling virtual character in the three-dimensional virtual environment is used to indicate the relative relationship between a first position corresponding to the non-player character and a second position corresponding to the controlling virtual character in the three-dimensional virtual environment.
[0540] Optionally, the above-mentioned relative orientation relationship includes at least one of position distance, position direction, and spatial surrounding situation between the non-player character and the main virtual character, wherein the position distance is used to indicate the distance relationship between the non-player character and the main virtual character, the position direction is used to indicate the angular relationship between the first position of the non-player character and the orientation direction of the main virtual character, and the spatial surrounding situation is used to indicate the surround situation of the main virtual character by the spatial elements forming the virtual space in the three-dimensional virtual environment, and the propagation effect of the space on the audio when the non-player character emits audio in the virtual space.
[0541] In some embodiments, the determination of the relative position relationship between the non-player character and the main virtual character can be implemented as follows: obtaining first position information of the non-player character in the three-dimensional virtual environment, obtaining second position information of the main virtual character in the three-dimensional virtual environment, and determining the relative position relationship between the non-player character and the main virtual character based on the first position information and the second position information.
[0542] In some embodiments, the first position information of the non-player character and the second position information of the controlling virtual character are position information determined based on the same preset coordinate system. Optionally, the preset coordinate system can be implemented as a world coordinate system corresponding to the three-dimensional virtual environment, or the preset coordinate system can be implemented as a coordinate system established with the controlling virtual character as the origin.
[0543] In some embodiments, when the sound effect parameters corresponding to the non-player characters are pre-generated and stored in a database, the sound effect parameters corresponding to the non-player characters are obtained from the database. In other embodiments, the sound effect parameters corresponding to the non-player characters may also be generated in real time, that is, the sound effect parameters corresponding to the non-player characters are generated based on the relative position relationship.
[0544] Optionally, the sound effect parameters corresponding to the non-player character may include at least one of the following types:
[0545] The first type is distance type
[0546] Illustratively, the distance-type sound effect parameter is used to indicate that the sound effect of the human voice audio is adjusted based on the distance between the non-player character and the main virtual character. In some embodiments, the distance-type sound effect parameter can adjust the audio volume of the human voice audio to simulate the effect of distance on the sound volume; and / or, the distance-type sound effect parameter can adjust the audio delay of the human voice audio to simulate the effect of distance on the sound propagation time.
[0547] Second, direction type
[0548] Illustratively, the direction-type sound effect parameter is used to indicate the adjustment of the sound effect of the human voice audio based on the direction of the non-player character relative to the main virtual character. In some embodiments, the direction-type sound effect parameter can adjust the audio volume of the human voice audio to simulate whether the main virtual character is facing the scene audio element; and / or, the direction-type sound effect parameter can adjust the volume parameters of the human voice audio in different channels to simulate the direction of the audio emitted by the scene sound source element.
[0549] The third type is space effects
[0550] Illustratively, the sound effect parameters of the spatial special effect type are used to indicate that the virtual space formed based on the spatial elements adjusts the sound effects in the virtual space, that is, the sound effect parameters of the spatial special effect type are used to indicate the effect of the virtual space on the sound performance of the audio emitted by the non-player characters. In some embodiments, the sound effect parameters of the spatial special effect type can add echo sound effects and reverberation sound effects to simulate the effect of sound in the space.
[0551] Optionally, the sound effect parameters of the spatial special effect type include at least one of a reverberation time parameter, a pre-delay parameter, a wetness (Wet / DryMix) parameter, a space width parameter, and a distance effect parameter. Among them, the reverberation time parameter is used to indicate the speed at which the audio decays in the virtual space; the pre-delay parameter is used to indicate the time difference between the audio directly reaching the main virtual character and the audio reaching the main virtual character after the first reflection; the wetness parameter is used to indicate the ratio between the audio directly transmitted and the audio transmitted through reflection; the space width parameter is used to indicate the degree of diffusion of the audio on the horizontal plane in the virtual space; and the distance effect parameter is used to indicate the attenuation of the audio with the propagation distance during the propagation process.
[0552] The fourth type is custom type
[0553] Schematically, the custom type of sound effect parameters are user-defined parameters for sound effect adjustment. Optionally, the user can customize the overall volume of the scene audio, whether to add background music, customize the volume of different types of audio, etc.
[0554] In some embodiments, the client provides a customization interface for sound effect parameters to the user, and the user configures the customized sound effect parameters through the customization interface.
[0555] In some embodiments, a parameter prediction model for personalized learning of the custom sound effect parameters is configured in the custom sound effect parameter server for the user. Schematically, the custom sound effect parameters of multiple candidate accounts are obtained, the multiple custom sound effect parameters are input into the parameter prediction model to be trained, the parameter prediction model to be trained is iteratively trained to obtain the parameter prediction model, and the sound effect parameters generated by the system (for example, the sound effect parameters of the above-mentioned distance type, direction type, and spatial special effect type) are optimized through the parameter prediction model.
[0556] Sub-step 9: adjusting the vocal audio based on the sound effect parameters, generating and broadcasting the spatial vocal audio corresponding to the non-player character;
[0557] Among them, the spatial human voice audio is used to express the perceptual effect of the audio produced by the main virtual character on the non-player character under the relative position relationship.
[0558] In an embodiment of the present application, the human voice audio is adjusted according to the sound effect parameters corresponding to the non-player character, thereby generating the spatial human voice audio corresponding to the non-player character. That is, the spatial human voice audio is the audio data corresponding to the non-player character obtained after the human voice audio is adjusted by the sound effect parameters. In some embodiments, the spatial human voice audio includes the audio after the sound effect parameters are adjusted, as well as at least one of the audio duration information, the audio playback start timestamp, the audio playback end timestamp, the audio playback condition information, and the element identification information corresponding to the audio.
[0559] Optionally, when the sound effect parameters indicate that the volume of the non-player character's vocal audio is to be adjusted, the volume of the non-player character's vocal audio on at least one channel is adjusted based on the sound effect parameters. Optionally, when the sound effect parameters indicate that the playback delay of the non-player character's vocal audio is to be adjusted, the audio playback start time corresponding to the non-player character's vocal audio is adjusted based on the sound effect parameters. Optionally, when the sound effect parameters indicate that the speed of the non-player character's vocal audio is to be adjusted, the playback speed of the non-player character's vocal audio is adjusted based on the sound effect parameters. Optionally, when the sound effect parameters indicate the pitch of the non-player character's vocal audio, the frequency in the spectrum of the non-player character's vocal audio is adjusted based on the sound effect parameters. When the sound effect parameters indicate the timbre of the non-player character's vocal audio, a filter corresponding to the non-player character is determined based on the sound effect parameters, and the timbre corresponding to the vocal audio is adjusted through the filter.
[0560] Illustratively, the client plays the spatial human voice audio to realize the broadcasting of non-player character feedback information.
[0561] The speech-to-text conversion stage of step 204 can be implemented as follows:
[0562] Sub-step 10: obtaining a plurality of first scene hot words corresponding to the first virtual scene where the target virtual character is located;
[0563] The target virtual character includes at least one of an NPC and a master virtual character.
[0564] In a illustrative manner, the main virtual character is the virtual character commanded by the player, and the NPC is the virtual character that assists the main virtual character in a virtual game. Usually, a virtual game includes a main virtual character and at least one NPC. There are certain differences between the main virtual character and the NPC.
[0565] Optionally, the main virtual character is the virtual character mainly controlled by the player, and the NPC is the virtual character chosen by the player to command, such as the main virtual character is the virtual character manually controlled by the player during the game, and the player's manual operations on the terminal interface are used to control the main virtual character; the NPC is the virtual character commanded by the player in voice form, and the player occasionally issues natural language commands in voice form to command the NPC.
[0566] In some embodiments, the first virtual scene is determined based on the target virtual character, and the target virtual character is at least one of an NPC and a master virtual character, which means that the process of determining the first virtual scene is implemented as at least one of the following.
[0567] (1) If the main virtual character is selected as the target virtual character, the virtual scene where the main virtual character is located is used as the first virtual scene;
[0568] (2) If an NPC is selected as the target virtual character, the virtual scene where the NPC is located is used as the first virtual scene; if there are multiple NPCs, the virtual scene including the most NPCs can be used as the first virtual scene. Alternatively, the NPC closest to the main virtual character can be selected as the target virtual character, and the virtual scene where the NPC is located can be used as the first virtual scene. Alternatively, the NPC with the largest character attribute value (such as at least one of the attribute values such as virtual health, virtual mana, and virtual defense) can be selected as the target virtual character, and the virtual scene where the NPC is located can be used as the first virtual scene.
[0569] (3) If the main virtual character and the NPC are selected as the target virtual characters, the virtual scene in which the main virtual character and the NPC are located can be used as the first virtual scene, etc.
[0570] In some embodiments, the target virtual character is determined based on the player's selection; or, the target virtual character is set by system default.
[0571] In some embodiments, a plurality of first scene hot words are determined based on the first virtual scene.
[0572] Among them, the plurality of first scene hot words are scene-related words of the first virtual scene, that is, there is an association relationship between the first scene hot words and the first virtual scene, and the first scene hot words are words that describe the first virtual scene.
[0573] Optionally, the first scene hot words include the scene status of the first virtual scene, such as: the first virtual scene is a virtual restaurant, and the first scene hot words include business status, rest status, closed status, etc.
[0574] Optionally, the first scene hot words include element names of virtual elements in the first virtual scene, such as: the first virtual scene is a virtual restaurant, and the first scene hot words include virtual tables, virtual chairs, virtual kitchen utensils, virtual plates, etc.
[0575] Optionally, the first scene hot words include interactive vocabulary for interacting with virtual elements in the first virtual scene, such as: the first virtual scene is a virtual battlefield, and the first scene hot words include attack, attack virtual character, defense, building barriers, etc.
[0576] In some embodiments, after receiving a natural language command, multiple first scene hot words are collected based on the first virtual scene; or, after receiving a natural language command, multiple first scene hot words corresponding to the first virtual scene are filtered from multiple scene hot words pre-acquired based on the first virtual scene, etc.
[0577] In an optional embodiment, the object perception range of the target virtual character in the first virtual scene is obtained.
[0578] Among them, the object perception range is the three-dimensional space range in which the target virtual character perceives the existence of other scene elements.
[0579] Optionally, when the target virtual character is the master virtual character, the object perception range of the master virtual character in the first virtual scene is obtained; when the target virtual character is an NPC, the object perception range of the NPC in the first virtual scene is obtained; or, when the target virtual character is the master virtual character and the NPC, the object perception range of the master virtual character in the first virtual scene is obtained and the object perception range of the NPC in the first virtual scene is obtained.
[0580] In some embodiments, the object perception range includes at least one of the following.
[0581] (1) The visual perception range of the target virtual character.
[0582] In schematic form, the visual perception range refers to the spatial range that an observer can visually perceive or understand, and is usually used to describe the size of the area that an organism or technical device can visually cover or perceive. The visual perception range of the target virtual character is the three-dimensional spatial range perceived by the target virtual character as an observer through observation.
[0583] Optionally, based on the position and visual observation ability of the target virtual character in the first virtual scene, the visual perception range of the target virtual character is acquired.
[0584] (2) The auditory perception range of the target virtual character.
[0585] In schematic form, the auditory perception range refers to the spatial range that a listener can perceive or understand, and is usually used to describe the range of sounds that an organism or technical device can cover or perceive. The auditory perception range of the target virtual character is the three-dimensional spatial range that the target virtual character can perceive through its auditory perception ability, with the target virtual character as the listener.
[0586] Optionally, based on the position and auditory perception ability of the target virtual character in the first virtual scene, the auditory perception range of the target virtual character is acquired.
[0587] (3) The olfactory perception range of the target virtual character.
[0588] In schematic form, the olfactory perception range refers to the spatial range of the odor perceived or recognized by the sense of smell. The olfactory perception range of the target virtual character is the three-dimensional spatial range that the target virtual character can perceive by the sense of smell.
[0589] Optionally, based on the position and olfactory perception ability of the target virtual character in the first virtual scene, the olfactory perception range of the target virtual character is acquired.
[0590] (4) The range of perception of the target virtual character’s perception skills or perception tools.
[0591] Illustratively, the perception skill is the ability of the target virtual character to perceive the first virtual scene, and the perception skill includes at least one of a perception acquisition form and a perception enhancement form.
[0592] Optionally, the perception acquisition form is used to indicate the process of acquiring a perception skill that is not possessed. After the perception skill is possessed through the perception acquisition form, the target virtual character can perform targeted scene perception of the first virtual scene through the perception skill. Optionally, the perception enhancement form is used to indicate the process of enhancing a certain perception ability by possessing the perception skill when the target virtual character possesses the perception ability.
[0593] Illustratively, the perception prop is a virtual prop used to perceive the first virtual scene, and the perception prop includes at least one of a perception acquisition form and a perception enhancement form.
[0594] Optionally, different perception skills or perception tools each correspond to a preset effective range, which represents a range that can be perceived when the perception skill or perception tool is applied, and the preset effective range represents the object perception range.
[0595] In some embodiments, the object perception range is a spherical range, an annular range, an irregular three-dimensional space range, etc. The shape of the object perception range is not limited here.
[0596] In an optional embodiment, a plurality of first scene hot words are acquired based on environmental perception information within a perception range of the object.
[0597] Schematically, the environmental perception information is used to represent the environmental information perceived and acquired by the target virtual character within the object perception range. Optionally, the environmental perception information includes virtual elements determined by emitting rays, and may also include regional structure information determined by analyzing the geometric structure and layout information of the virtual environment.
[0598] Illustratively, after determining the object perception range corresponding to the target virtual character, based on the range of the object perception range in the first virtual scene and the environmental perception information determined based on perception of the target virtual character within the object perception range, multiple first scene hot words representing the state of the target virtual character are obtained.
[0599] In an optional embodiment, the environmental perception information includes virtual elements; and the virtual elements in the first virtual scene that are within the perception range of the object are determined.
[0600] Schematically, the object perception range is a part of the three-dimensional space range in the first virtual scene; the first virtual scene includes a large number of virtual elements, and the virtual elements are elements that constitute the virtual scene, such as virtual elements including virtual ground, virtual buildings, virtual trees, virtual characters, virtual stones, etc.
[0601] In some embodiments, when determining the object perception range, the virtual elements within the object perception range are determined from the multiple virtual elements corresponding to the first virtual scene.
[0602] In some embodiments, the element name of the virtual element is used as the first scene hot word; or, the action name of the interactive action corresponding to the virtual element is used as the first scene hot word.
[0603] Sub-step 11: converting the natural language command in voice form into text form based on multiple first scenario hot words;
[0604] Indicatively, the first scene hot words are words that are highly associated with the first virtual scene. Therefore, if you want to command the NPC through natural language commands to better cooperate with the activities of the main virtual character, you can use the first scene hot words as constraints on the basis of the first virtual scene. In this way, in the process of converting the natural language commands into text form, the text content of the command analysis results is more consistent with the first virtual scene, avoiding command analysis results that are incompatible with the first virtual scene.
[0605] In an optional embodiment, when a natural language command is analyzed by a natural language analysis model, a plurality of speech units corresponding to the natural language command are acquired through an acoustic network.
[0606] Among them, phonetic units are the basic building blocks of vocabulary pronunciation.
[0607] In some embodiments, a command feature representation corresponding to a natural language command is extracted; and the command feature representation is analyzed through an acoustic network.
[0608] Schematically, taking the command feature representation as an example, the goal of the acoustic network is to map a continuous sequence of acoustic features to a sequence of speech units, such as phonemes or segments. It learns to predict possible sequences of speech units (phonemes or segments) given acoustic features.
[0609] Optionally, the acoustic network outputs one or more possible speech unit sequences, wherein the speech unit sequence includes multiple speech units. Different speech unit sequences may contain different speech units, or may just have different orders of speech units. The multiple speech unit sequences represent the arrangement of speech units that the language network considers to be most likely when understanding the input natural language command.
[0610] The natural language analysis model includes an acoustic network, a preset dictionary, and language sub-networks corresponding to at least two virtual scenes.
[0611] Schematically, the virtual environment includes at least two virtual scenes. For example, the virtual environment is a large virtual world, which includes a virtual kitchen 1, a virtual kitchen 2, a virtual office, etc. The virtual kitchen 1, the virtual kitchen 2, the virtual office, etc. can each be regarded as a virtual scene.
[0612] In an optional embodiment, based on a first virtual scene in which the target virtual character is located, a first language sub-network corresponding to the first virtual scene is determined from at least two language sub-networks.
[0613] Schematically, multiple virtual scenes correspond to a language subnetwork respectively, and different language subnetworks are used to analyze the corresponding virtual scenes in a targeted manner. For example, virtual scene A corresponds to language subnetwork 1, and virtual scene B corresponds to language subnetwork 2; when analysis is required based on virtual scene A, language subnetwork 1 is used for language analysis; when analysis is required based on virtual scene B, language subnetwork 2 is used for language analysis, and so on.
[0614] Illustratively, the first virtual scene is a virtual scene among at least two virtual scenes. In addition to determining the first scene hot words based on the first virtual scene in which the target virtual character is located, a first language subnetwork corresponding to the first virtual scene is determined from at least two language subnetworks based on the first virtual scene. The first language subnetwork is a subnetwork layer that performs semantic analysis on natural language commands based on the first virtual scene.
[0615] In an optional embodiment, the first language sub-network analyzes the sequence matching relationship between multiple speech units and selected words in a preset dictionary to convert the natural language command in speech form into text form.
[0616] Optionally, different language sub-networks are language sub-networks pre-trained based on corresponding virtual scenes, wherein the first language sub-network is a language sub-network trained based on the first virtual scene.
[0617] In some embodiments, matching relationships between multiple speech units and selected words in a preset dictionary are analyzed to obtain multiple candidate word sequences.
[0618] The selected words include at least a plurality of first-scenario hot words and common words.
[0619] Schematically, the process of analyzing the matching relationship represents the process of analyzing the matching between the selected vocabulary and the speech unit. Schematically, each selected vocabulary corresponds to at least one speech unit, and the conversion probability of the speech unit to the selected vocabulary is determined by analyzing the multiple speech units and the selected vocabulary. The conversion probability represents the probability of matching between the selected vocabulary and the speech unit. The larger the conversion probability, the closer the speech unit is to the selected vocabulary, that is, the greater the possibility that the speech unit may express the selected vocabulary, and the stronger the matching relationship between the selected vocabulary and the speech unit.
[0620] Optionally, a plurality of speech units form at least one speech unit sequence, and based on a matching analysis process between the speech units and the selected vocabulary, at least one candidate vocabulary sequence corresponding to the at least one speech unit sequence is determined, and a plurality of candidate vocabulary sequences are obtained.
[0621] In some embodiments, the sequence semantics of multiple candidate vocabulary sequences are analyzed by the first language sub-network, and at least one candidate vocabulary sequence is obtained from the multiple candidate vocabulary sequences as a text form for natural language command conversion.
[0622] Schematically, sequence semantics is used to represent the semantic information expressed by the candidate vocabulary sequence, which can not only reflect the semantic changes of at least one word in the candidate vocabulary sequence, but also reflect the sentence semantics of the entire candidate vocabulary sequence.
[0623] Schematically, the natural language command in text form is called the command analysis result; multiple candidate vocabulary sequences are evaluated separately by the first language sub-network, so as to take at least one candidate vocabulary sequence that is more in line with the current semantic situation as the command analysis result, that is, the natural language command in speech form is converted into text form.
[0624] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.
[0625] It should be noted that before collecting relevant data of users and during the process of collecting relevant data of users, this application can display a prompt interface, pop-up window or output voice prompt information, and the prompt interface, pop-up window or voice prompt information is used to prompt the user that its relevant data is currently being collected, so that this application only starts to execute the relevant steps of obtaining relevant data of users after obtaining the confirmation operation issued by the user to the prompt interface or pop-up window, otherwise (that is, when the confirmation operation issued by the user to the prompt interface or pop-up window is not obtained), the relevant steps of obtaining relevant data of users are terminated, that is, the relevant data of users are not obtained. In other words, all user data collected by this application are collected with the consent and authorization of the user, and the collection, use and processing of relevant user data need to comply with the relevant laws, regulations and standards of relevant countries and regions.
[0626] Please refer to Fig.11 , which shows a structural block diagram of an audio processing device in a virtual environment provided by an exemplary embodiment of the present application, the device includes the following modules:
[0627] A first acquisition module 1110 is used to acquire element audio data of an environmental sound source element in a virtual environment, wherein the virtual environment includes a master virtual character, and the environmental sound source element is a sound source that generates audio in the virtual environment;
[0628] A second acquisition module 1120 is used to acquire the sound effect parameters corresponding to the environmental sound source element based on the relative position relationship between the environmental sound source element and the master virtual character in the virtual environment;
[0629] A generating module 1130, configured to adjust the element audio data based on the sound effect parameter to generate spatial audio data corresponding to the environmental sound source element, wherein the spatial audio data is used to express the perceived effect of the audio generated by the environmental sound source element by the master virtual character in the relative position relationship;
[0630] The generating module 1130 is further configured to generate scene audio data based on the spatial audio data, wherein the scene audio data is a perception effect of the controlling virtual character on at least one audio generated in the virtual environment.
[0631] In some optional embodiments, such as Fig.12 As shown, the second acquisition module 1120 further includes:
[0632] The first acquisition unit 1121 is used to acquire the first position information of the environmental sound source element in the virtual environment; and acquire the second position information of the master virtual character in the virtual environment;
[0633] A first determining unit 1122 is used to determine the relative position relationship between the environmental sound source element and the master virtual character based on the first position information and the second position information;
[0634] The first generating unit 1123 is used to generate the sound effect parameter corresponding to the environmental sound source element based on the relative orientation relationship.
[0635] In some optional embodiments, the first determining unit 1122 is further configured to determine, based on the relative position relationship, a sound propagation path of the audio generated by the environmental sound source element between the environmental sound source element and the master virtual character;
[0636] The first generating unit 1123 is further used to generate sound effect parameters corresponding to the environmental sound source elements based on the sound propagation path.
[0637] In some optional embodiments, the first determining unit 1122 is further configured to determine, based on the relative orientation relationship, a first propagation path of the audio generated by the environmental sound source element that is directly transmitted from the environmental sound source element to the master virtual character; based on the relative orientation relationship, determine a second propagation path of the audio generated by the environmental sound source element that is transmitted to the master virtual character after being reflected in the virtual environment;
[0638] The first generating unit 1123 is further used to determine the sound effect parameter corresponding to the environmental sound source element based on the first propagation path and the second propagation path.
[0639] In some optional embodiments, the first determining unit 1122 is further configured to determine a field of view corresponding to the master virtual character based on the orientation of the master virtual character in the virtual environment;
[0640] The first generating unit 1123 is further used to determine the sound effect parameter based on the first parameter when the ambient sound source element is within the field of view; and to determine the sound effect parameter based on the second parameter when the ambient sound source element is outside the field of view; wherein the audio volume corresponding to the first parameter is greater than the audio volume corresponding to the second parameter.
[0641] In some optional embodiments, the environmental sound source elements include space elements forming a virtual space in the virtual environment, and the master virtual character is in the virtual space;
[0642] The first determining unit 1122 is further configured to determine, based on the relative orientation relationship, the surrounding state information of the spatial element to the master virtual character;
[0643] The first generating unit 1123 is further used to determine the space type of the virtual space where the master virtual character is located based on the surrounding state information; and obtain sound effect parameters matching the space type.
[0644] In some optional embodiments, the first determining unit 1122 is further configured to determine distance information between the master virtual character and the environmental sound source element based on the relative position relationship;
[0645] The first generating unit 1123 is further used to determine, based on the distance information, an attenuation parameter and a delay parameter corresponding to the audio generated by the ambient sound source element; and determine the sound effect parameter based on the attenuation parameter and the delay parameter.
[0646] In some optional embodiments, the first acquisition module 1110 is also used to acquire scene data of the virtual environment, wherein the scene data includes element data of multiple candidate environmental elements; the scene data is input into a pre-trained scene recognition model, and the environmental sound source element is obtained by screening from the multiple candidate environmental sound source elements, and the scene recognition model is used to identify the sound source that generates audio in the virtual environment as the environmental sound source element in combination with the overall situation of the virtual environment.
[0647] In some optional embodiments, the environmental sound source element includes a character element, and the character element is used to indicate a scene virtual character other than the master virtual character in the virtual environment;
[0648] The first acquisition module 1110 further includes:
[0649] A second acquisition unit 1111 is used to acquire the dialogue data and character feature information of the character element, wherein the character feature information is used to describe the attributes of the scene virtual character, wherein the attributes of the scene virtual character include at least one of basic attributes and situational performance attributes of the scene virtual character, wherein the basic attributes are attributes pre-configured for the scene virtual character, and the situational performance attributes are attributes determined in real time by the scene virtual character in the situation of the virtual environment;
[0650] The second generating unit 1112 is used to generate a character voice matching the character feature information according to the dialogue data as element audio data corresponding to the character element.
[0651] In some optional embodiments, the character characteristic information includes at least one of character basic information, character emotion information, and character behavior information;
[0652] The basic character information is used to indicate the basic character situation of the scene virtual character;
[0653] The character emotion information is used to indicate the emotional state of the scene virtual character in the dialogue scenario corresponding to the line data;
[0654] The character behavior information is used to indicate the actions performed by the scene virtual character in the dialogue scenario;
[0655] Among them, different character feature information corresponds to different character voice performances.
[0656] In some optional embodiments, the second generation unit 1112 is further used to input the dialogue data and the role feature information into a pre-trained speech generation model to obtain the role voice as the element audio data, and the speech generation model is used to generate a voice that matches the role feature information of the virtual character in the scene.
[0657] In some optional embodiments, the speech generation model includes a text encoder, a role encoder and a decoder;
[0658] The second generation unit 1112 is further used to input the dialogue data into the text encoder to obtain a text encoding representation; input the role feature information into the role encoder to obtain a role encoding representation; fuse the text encoding representation and the role encoding representation to obtain a joint encoding representation; input the joint encoding representation into the decoder to generate the role voice.
[0659] In some optional embodiments, the second generation unit 1112 is further used to, when the role characteristic information includes basic role information, input the basic role information into the first sub-encoder to obtain a first role coding representation; when the role characteristic information includes emotional role information, input the emotional role information into the second sub-encoder to obtain a second role coding representation; when the role characteristic information includes behavioral role information, input the behavioral role information into the third sub-encoder to obtain a third role coding representation.
[0660] In some optional embodiments, the second acquisition unit 1111 is further used to acquire speech rate setting information corresponding to the character element, where the speech rate setting information is used to indicate the speech rate setting of the scene virtual character;
[0661] The first acquisition module 1110 further includes:
[0662] A second determining unit 1113 is used to determine the estimated playing time corresponding to the dialogue data based on the speech rate setting information;
[0663] The second acquisition unit 1111 is further used to acquire the voice duration corresponding to the character's voice;
[0664] The adjusting unit 1114 is configured to adjust the playback speed of the character's voice based on the difference between the voice duration and the estimated duration.
[0665] In some optional embodiments, the first acquisition unit 1121 is further used to acquire first position information of the character element in the virtual environment; and acquire second position information of the master virtual character in the virtual environment;
[0666] The first generating unit 1123 is further configured to generate a voice adjustment parameter when the position distance between the first position information and the second position information reaches a first threshold, wherein the voice adjustment parameter is used to adjust the voice of the character; and determine the sound effect parameter based on the voice adjustment parameter.
[0667] In some optional embodiments, the device further comprises:
[0668] The receiving module 1140 is used to receive a natural language command from a first account for the character element, where the first account is an account for controlling the master virtual character;
[0669] The second generating unit 1112 is further used to continuously generate a plurality of speech segments of the character element based on the natural language command to form the speech data, and record a first start timestamp and a first end timestamp when each speech segment is generated; when the i-th speech segment is generated, generate an i-th character segment voice matching the character feature information according to the i-th speech segment as the element audio data, and record a second start timestamp and a second end timestamp when the i-th character segment voice is generated, where i is a positive integer;
[0670] The second determining unit 1113 is further configured to determine a first difference between the first start timestamp and the second start timestamp; determine a second difference between the first end timestamp and the second end timestamp;
[0671] The adjusting unit 1114 is further configured to adjust a transmission speed of sending the scene audio data corresponding to the i-th dialogue segment to the terminal based on a difference between the first difference and the second difference.
[0672] In some optional embodiments, the first acquisition unit 1121 is further used to acquire the ambient sound information corresponding to the natural language command, where the ambient sound information is used to indicate information related to the background ambient sound in the voice when the voice including the natural language command is collected;
[0673] The first generating unit 1123 is further configured to generate a tone adjustment parameter of the character's voice based on the ambient sound information; and determine the sound effect parameter based on the tone adjustment parameter.
[0674] In some optional embodiments, the ambient sound information includes the ambient volume, and the tone height corresponding to the tone adjustment parameter is positively correlated with the size of the ambient volume; or, the ambient sound information includes the environment identification type corresponding to the background ambient sound, when the environment identification type is an Internet cafe type, the tone adjustment parameter corresponds to a first tone, when the environment identification type is a day bedroom, the tone adjustment parameter corresponds to a second tone, and when the environment identification type is a night bedroom, the tone adjustment parameter corresponds to a third tone, wherein the first tone is higher than the second tone, and the second tone is higher than the third tone.
[0675] In some optional embodiments, the sound source generating the audio in the virtual environment includes a plurality of environmental sound source elements;
[0676] The first acquisition unit 1121 is further used to acquire a grid structure of the virtual environment, where the grid structure is used to indicate a scene division result of dividing the virtual environment by grids, and the grid structure includes a plurality of grid points;
[0677] The first determining unit 1122 is further configured to determine first grid points corresponding to the plurality of ambient sound source elements respectively based on positions of the plurality of ambient sound source elements in the virtual environment, wherein the plurality of ambient sound source elements correspond to at least one first grid point;
[0678] The first generating unit 1123 is further configured to generate sound cache data corresponding to the first grid point based on the element audio data;
[0679] The first determining unit 1122 is further configured to determine a second grid point corresponding to a position of the master virtual character in response to the master virtual character entering the virtual environment;
[0680] The first generating unit 1123 is further configured to generate a sound effect parameter corresponding to the first grid point based on a relative position relationship between the first grid point and the second grid point;
[0681] The generation module 1130 is further used to generate the element audio data corresponding to the first grid point based on the sound cache data and the sound effect parameters corresponding to the first grid point; and integrate the element audio data of at least one first grid point to obtain the scene audio data.
[0682] It should be noted that the audio processing device in the virtual environment provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the audio processing device in the virtual environment provided in the above embodiment and the audio processing method embodiment in the virtual environment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0683] Fig.13 The schematic diagram of the structure of a server provided by an exemplary embodiment of the present application is shown, which specifically includes the following structure.
[0684] The server 1300 includes a central processing unit (CPU) 1301, a system memory 1304 including a random access memory (RAM) 1302 and a read only memory (ROM) 1303, and a system bus 1305 connecting the system memory 1304 and the central processing unit 1301. The server 1300 also includes a mass storage device 1306 for storing an operating system 1313, application programs 1314, and other program modules 1315.
[0685] The mass storage device 1306 is connected to the central processing unit 1301 through a mass storage controller (not shown) connected to the system bus 1305. The mass storage device 1306 and its associated computer readable media provide non-volatile storage for the server 1300. That is, the mass storage device 1306 may include a computer readable medium (not shown) such as a hard disk or a compact disc read only memory (CD-ROM) drive.
[0686] Without loss of generality, computer-readable media may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer-readable instructions, data structures, program modules or other data. Computer storage media include RAM, ROM, Erasable Programmable Read Only Memory (EPROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other solid-state memory technology, CD-ROM, Digital Versatile Disc (DVD) or other optical storage, cassettes, tapes, disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that computer storage media are not limited to the above. The above-mentioned system memory 1304 and mass storage device 1306 can be collectively referred to as memory.
[0687] According to various embodiments of the present application, the server 1300 can also be connected to a remote computer on the network through a network such as the Internet. That is, the server 1300 can be connected to the network 1312 through the network interface unit 1311 connected to the system bus 1305, or the network interface unit 1311 can be used to connect to other types of networks or remote computer systems (not shown).
[0688] The above-mentioned memory also includes one or more programs, and the one or more programs are stored in the memory and configured to be executed by the CPU.
[0689] The embodiment of the present application also provides a computer device, which includes a processor and a memory, wherein at least one instruction, at least one program, code set or instruction set is stored in the memory, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor to implement the audio processing method in the virtual environment provided by the above-mentioned method embodiments. Optionally, the computer device can be a terminal or a server.
[0690] An embodiment of the present application also provides a computer-readable storage medium, on which is stored at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement the audio processing method in a virtual environment provided by the above-mentioned method embodiments.
[0691] The embodiment of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the audio processing method in the virtual environment described in any of the above embodiments.
[0692] Optionally, the computer readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a solid state drive (SSD), or an optical disk. Among them, the random access memory may include a resistance random access memory (ReRAM) and a dynamic random access memory (DRAM). The serial numbers of the above embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.
[0693] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0694] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. An audio processing method in a virtual environment, characterized in that: The method comprises: Acquire element audio data of an ambient sound source element in a virtual environment, wherein the virtual environment includes a master virtual character; Based on the relative position relationship between the environmental sound source element and the master virtual character in the virtual environment, obtaining the sound effect parameters corresponding to the environmental sound source element; Adjusting the element audio data based on the sound effect parameter to generate spatial audio data corresponding to the environmental sound source element, wherein the spatial audio data is used to express the perceived effect of the master virtual character on the audio generated by the environmental sound source element in the relative position relationship; Scene audio data is generated based on the spatial audio data, where the scene audio data is the perceived effect of the master virtual character on at least one audio generated in the virtual environment.
2. The method according to claim 1, characterized in that The acquiring the sound effect parameters corresponding to the environmental sound source elements based on the relative position relationship between the environmental sound source elements and the master virtual character in the virtual environment includes: Acquire first position information of the environmental sound source element in the virtual environment; and acquire second position information of the master control virtual character in the virtual environment; Determining the relative position relationship between the environmental sound source element and the master virtual character based on the first position information and the second position information; Based on the relative orientation relationship, the sound effect parameters corresponding to the environmental sound source elements are generated.
3. The method according to claim 2, characterized in that The generating the sound effect parameter corresponding to the environmental sound source element based on the relative orientation relationship includes: Based on the relative position relationship, determining a sound propagation path of the audio generated by the environmental sound source element between the environmental sound source element and the master virtual character; The sound effect parameters corresponding to the environmental sound source elements are generated based on the sound propagation path.
4. The method according to claim 3, characterized in that The determining, based on the relative position relationship, a propagation path of the audio generated by the environmental sound source element between the environmental sound source element and the master virtual character includes: Based on the relative position relationship, determine a first propagation path for the audio generated by the environmental sound source element to be directly propagated from the environmental sound source element to the master virtual character; Based on the relative orientation relationship, determine a second propagation path for the audio generated by the environmental sound source element to propagate to the master virtual character after being reflected in the virtual environment; The generating the sound effect parameter corresponding to the environmental sound source element based on the sound propagation path includes: Based on the first propagation path and the second propagation path, the sound effect parameter corresponding to the environmental sound source element is determined.
5. The method according to claim 2, characterized in that: The generating the sound effect parameter corresponding to the environmental sound source element based on the relative orientation relationship includes: Determining a field of view corresponding to the master virtual character based on the orientation of the master virtual character in the virtual environment; When the environmental sound source element is within the field of view, determining the sound effect parameter based on the first parameter; When the environmental sound source element is outside the field of view, the sound effect parameter is determined based on a second parameter; wherein the audio volume corresponding to the first parameter is greater than the audio volume corresponding to the second parameter.
6. The method according to claim 2, characterized in that The environmental sound source elements include space elements that form a virtual space in the virtual environment, and the master virtual character is in the virtual space; The generating the sound effect parameter corresponding to the environmental sound source element based on the relative orientation relationship includes: Based on the relative orientation relationship, determining the surrounding state information of the spatial element to the master virtual character; Determine the space type of the virtual space where the master virtual character is located based on the surrounding state information; Get the sound effect parameters that match the space type.
7. The method according to claim 2, characterized in that: The generating the sound effect parameter corresponding to the environmental sound source element based on the relative orientation relationship includes: Based on the relative position relationship, determining the distance information between the main control virtual character and the environmental sound source element; Determine, based on the distance information, an attenuation parameter and a delay parameter corresponding to the audio generated by the ambient sound source element; The sound effect parameter is determined based on the decay parameter and the delay parameter.
8. The method according to any one of claims 1 to 7, characterized in that: Before obtaining the element audio data of the ambient sound source element in the virtual environment, the method further includes: Acquire scene data of the virtual environment, wherein the scene data includes element data of a plurality of candidate environment elements; The scene data is input into a pre-trained scene recognition model, and the environmental sound source element is obtained by screening from the multiple candidate environmental sound source elements. The scene recognition model is used to identify the sound source that generates audio in the virtual environment as the environmental sound source element in combination with the overall situation of the virtual environment.
9. The method according to any one of claims 1 to 7, characterized in that: The environmental sound source element includes a character element, and the character element is used to indicate a scene virtual character other than the master virtual character in the virtual environment; The step of obtaining the element audio data of the ambient sound source element in the virtual environment includes: Acquire the dialogue data and character feature information of the character element, wherein the character feature information is used to describe the attributes of the scene virtual character, wherein the attributes of the scene virtual character include at least one of basic attributes and situational performance attributes of the scene virtual character, wherein the basic attributes are attributes pre-configured for the scene virtual character, and the situational performance attributes are attributes determined in real time by the scene virtual character in the situation of the virtual environment; A character voice matching the character feature information is generated according to the dialogue data as element audio data corresponding to the character element.
10. The method according to claim 9, characterized in that The character characteristic information includes at least one of character basic information, character emotion information, and character behavior information; The basic character information is used to indicate the basic character situation of the scene virtual character; The character emotion information is used to indicate the emotional state of the scene virtual character in the dialogue scenario corresponding to the line data; The character behavior information is used to indicate the actions performed by the scene virtual character in the dialogue scenario; Among them, different character feature information corresponds to different character voice performances.
11. The method according to claim 9, characterized in that The step of generating a character voice matching the character feature information according to the dialogue data as the element audio data includes: The dialogue data and the character feature information are input into a pre-trained speech generation model to obtain the character voice as the element audio data. The speech generation model is used to generate a voice that matches the character feature information of the scene virtual character.
12. The method according to claim 11, characterized in that The speech generation model includes a text encoder, a role encoder and a decoder; The step of inputting the dialogue data and the character feature information into a pre-trained speech generation model to obtain the character voice includes: Inputting the line data into the text encoder to obtain a text encoding representation; and inputting the character feature information into the character encoder to obtain a character encoding representation; Fusion of the text encoding representation and the role encoding representation to obtain a joint encoding representation; The joint coded representation is input into the decoder to generate the character voice.
13. The method according to claim 12, characterized in that The step of inputting the character feature information into the character encoder to obtain a character encoding representation includes: In the case where the character feature information includes basic character information, the basic character information is input into a first sub-encoder to obtain a first character encoding representation; In the case where the character feature information includes character emotion information, the character emotion information is input into a second sub-encoder to obtain a second character encoding representation; In the case where the role characteristic information includes role behavior information, the role behavior information is input into a third sub-encoder to obtain a third role encoding representation.
14. The method according to claim 9, characterized in that The method further comprises: Acquire speech rate setting information corresponding to the character element, wherein the speech rate setting information is used to indicate the speech rate setting of the scene virtual character; Determining an estimated playback duration corresponding to the dialogue data based on the speech rate setting information; After generating the character voice matching the character feature information according to the dialogue data as the element audio data, the method further includes: Obtain the voice duration corresponding to the character's voice; The playback speed of the character's voice is adjusted based on the difference between the voice duration and the estimated duration.
15. The method according to claim 9, characterized in that The acquiring the sound effect parameters corresponding to the environmental sound source elements based on the relative position relationship between the environmental sound source elements and the master virtual character in the virtual environment includes: Acquire first position information of the character element in the virtual environment; and acquire second position information of the master virtual character in the virtual environment; When the position distance between the first position information and the second position information reaches a first threshold, generating a voice adjustment parameter, wherein the voice adjustment parameter is used to adjust the voice of the character; The sound effect parameter is determined based on the intonation adjustment parameter.
16. The method according to claim 9, characterized in that The step of obtaining the dialogue data of the character element includes: Receiving a natural language command from a first account for the character element, where the first account is an account for controlling the master virtual character; Continuously generating a plurality of speech segments of the character element based on the natural language command to form the speech data, and recording a first start timestamp and a first end timestamp when each speech segment is generated; The step of generating a character voice matching the character feature information according to the dialogue data as the element audio data includes: When the i-th dialogue segment is generated, generate the i-th character segment voice matching the character feature information according to the i-th dialogue segment as the element audio data, and record the second start timestamp and the second end timestamp when the i-th character segment voice is generated, where i is a positive integer; The method further comprises: determining a first difference between the first start timestamp and the second start timestamp; determining a second difference between the first end timestamp and the second end timestamp; Based on the difference between the first difference and the second difference, the transmission speed of sending the scene audio data corresponding to the i-th dialogue segment to the terminal is adjusted.
17. The method according to claim 16, characterized in that The obtaining of the sound effect parameters corresponding to the environmental sound source elements includes: Acquiring ambient sound information corresponding to the natural language command, the ambient sound information being used to indicate information related to background ambient sound in the voice when collecting the voice including the natural language command; generating a tone adjustment parameter of the character's voice based on the environmental sound information; The sound effect parameter is determined based on the intonation adjustment parameter.
18. The method according to claim 17, characterized in that The environmental sound information includes the environmental volume, and the pitch height corresponding to the pitch adjustment parameter is positively correlated with the size of the environmental volume; Alternatively, the ambient sound information includes an environment identification type corresponding to the background ambient sound, when the environment identification type is an Internet cafe type, the tone adjustment parameter corresponds to a first tone, when the environment identification type is a day bedroom, the tone adjustment parameter corresponds to a second tone, and when the environment identification type is a night bedroom, the tone adjustment parameter corresponds to a third tone, wherein the first tone is higher than the second tone, and the second tone is higher than the third tone.
19. The method according to any one of claims 1 to 7, characterized in that: The sound source generating audio in the virtual environment includes a plurality of environmental sound source elements; The acquiring the sound effect parameters corresponding to the environmental sound source elements based on the relative position relationship between the environmental sound source elements and the master virtual character in the virtual environment includes: Acquire a grid structure of the virtual environment, where the grid structure is used to indicate a scene division result of dividing the virtual environment by grids, and the grid structure includes a plurality of grid points; Based on the positions of the multiple environmental sound source elements in the virtual environment, determining the first grid points corresponding to the multiple environmental sound source elements respectively, wherein the multiple environmental sound source elements correspond to at least one first grid point; Generate sound cache data corresponding to the first grid point based on the element audio data; In response to the main control virtual character entering the virtual environment, determining a second grid point corresponding to the position of the main control virtual character; Based on the relative position relationship between the first grid point and the second grid point, generating a sound effect parameter corresponding to the first grid point; The step of adjusting the element audio data based on the sound effect parameter to generate spatial audio data corresponding to the environmental sound source element includes: generating the element audio data corresponding to the first grid point based on the sound cache data and the sound effect parameter corresponding to the first grid point; The generating scene audio data based on the spatial audio data comprises: The element audio data of the at least one first grid point are integrated to obtain the scene audio data.
20. An audio processing device in a virtual environment, characterized in that: The device comprises: A first acquisition module is used to acquire element audio data of an environmental sound source element in a virtual environment, wherein the virtual environment includes a master virtual character, and the environmental sound source element is a sound source that generates audio in the virtual environment; A second acquisition module is used to acquire the sound effect parameters corresponding to the environmental sound source elements based on the relative position relationship between the environmental sound source elements and the master virtual character in the virtual environment; A generating module, configured to adjust the element audio data based on the sound effect parameter to generate spatial audio data corresponding to the environmental sound source element, wherein the spatial audio data is used to express the perceived effect of the audio generated by the environmental sound source element by the master virtual character in the relative position relationship; The generation module is further used to generate scene audio data based on the spatial audio data, and the scene audio data is the perception effect of the master virtual character on at least one audio generated in the virtual environment.
21. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one program, and the at least one program is loaded and executed by the processor to implement the audio processing method in a virtual environment as described in any one of claims 1 to 19.
22. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one program code, and the program code is loaded and executed by a processor to implement the audio processing method in a virtual environment as described in any one of claims 1 to 19.
23. A computer program product, characterized in that The method comprises a computer program or an instruction, which, when executed by a processor, implements the audio processing method in a virtual environment as claimed in any one of claims 1 to 19.
Citation Information
Cited By
Ambient sound playing control method and device, electronic equipment and storage medium
CN119733238A
AI intelligent sound equipment signal processing method and system, sound equipment device and storage medium
CN121789667A
