Audio processing method and device in game, audio playback method and device and electronic equipment
By recording the playback information of in-game audio events instead of recording audio directly, the problem of audio taking up a lot of space in the game is solved, and efficient storage and real playback of audio are achieved.
Patent Information
- Application Number
- CN202410598180.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-14
- Publication Date
- 2024-09-27
AI Technical Summary
In games, recording audio directly into video files takes up a lot of space, causing great pressure on cloud storage and synchronization, and there is a lack of an integrated system for audio management, transfer, and playback in the virtual world.
By recording the playback information of in-game audio events instead of recording the audio directly, audio trigger information is generated and saved to a file so that the audio can be played based on this information during playback.
It reduces the storage space occupied after audio recording, achieving true audio restoration and a more realistic playback experience.
Smart Images

Figure CN118698127A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of data processing design, and in particular to an audio processing method, an audio playback method, a device and an electronic device in a game. Background Art
[0002] In the game, in order to complete game tasks or make videos, players need to record and play back sounds. In related technologies, after triggering recording, the game screen and audio signal stream are saved at the same time, generating a fixed video file, and then playing it back to the client at a set time. For example, after a game battle, the highlight moment is played back on the settlement interface; the video file can also be saved locally or in the cloud space. However, directly recording all sounds as video files takes up a lot of space, and the pressure of cloud storage and synchronization is relatively high. Summary of the invention
[0003] The purpose of the present disclosure is to provide an audio processing method, an audio playback method, a device and an electronic device in a game to reduce the storage space occupied by the audio after recording.
[0004] In a first aspect, the present disclosure provides an audio processing method in a game, the method comprising: receiving a start recording instruction for audio in a target game, and recording playback information corresponding to at least one audio event played in the target game starting from the time the start recording instruction is received; receiving an end recording instruction, and ending recording of playback information corresponding to at least one audio event played in the target game; wherein the playback information of the audio event includes the sound object corresponding to the audio event, the playback time of the sound object, and the audio engine interface information called by the sound object; based on the recorded playback information corresponding to at least one audio event played in the target game, generating audio trigger information corresponding to the target audio; wherein the target audio includes: at least one audio event played in the target game during the time period from the receipt of the start recording instruction to the receipt of the end recording instruction; the audio trigger information includes the recording time of the target audio, and the playback information of at least one audio event; saving the audio trigger information to a designated file, so that when a playback instruction for the target audio is received, the target audio is played based on the audio trigger information.
[0005] In a second aspect, the present disclosure provides an audio playback method in a game, the method comprising: receiving an audio playback request, and determining audio trigger information of a target audio to be played based on the playback request; wherein the target audio comprises at least one pre-recorded audio event played in a target game, the audio trigger information comprises the recording time of the target audio, and the playback information of at least one audio event; the playback information of the audio event comprises the sound object corresponding to the audio event, the playback time of the sound object, and the audio engine interface information called by the sound object; based on the playback information of at least one audio event, establishing a new sound object corresponding to the audio event at a predetermined position in the target game; based on the recording time of the audio trigger information, the playback time of the sound object corresponding to the at least one audio event, and the audio engine interface information called by the sound object, controlling the new sound object corresponding to the at least one audio event to sound.
[0006] In a third aspect, the present disclosure provides an audio processing device in a game, the device comprising: an audio recording module, for receiving a start recording instruction for audio in a target game, and recording playback information corresponding to at least one audio event played in the target game starting from the time the start recording instruction is received; receiving an end recording instruction, and ending recording of playback information corresponding to at least one audio event played in the target game; wherein the playback information of the audio event includes the sound object corresponding to the audio event, the playback time of the sound object, and the audio engine interface information called by the sound object; an information generation module, for generating audio trigger information corresponding to the target audio based on the recorded playback information corresponding to at least one audio event played in the target game; wherein the target audio includes: at least one audio event played in the target game during the time period from the receipt of the start recording instruction to the receipt of the end recording instruction; the audio trigger information includes the recording time of the target audio, and the playback information of at least one audio event; an information saving module, for saving the audio trigger information to a specified file, so that when a playback instruction for the target audio is received, the target audio is played based on the audio trigger information.
[0007] In a fourth aspect, the present disclosure provides an audio playback device in a game, the device comprising: a playback request receiving module, used to receive an audio playback request, and determine the audio trigger information of the target audio to be played based on the playback request; wherein the target audio includes at least one pre-recorded audio event played in a target game, the audio trigger information includes the recording time of the target audio, and the playback information of at least one audio event; the playback information of the audio event includes the sound object corresponding to the audio event, the playback time of the sound object, and the audio engine interface information called by the sound object; an object creation module, used to create a new sound object corresponding to the audio event at a predetermined position in the target game based on the playback information of at least one audio event; an object sound module, used to control the sound of the new sound object corresponding to at least one audio event based on the recording time of the audio trigger information, the playback time of the sound object corresponding to the at least one audio event, and the audio engine interface information called by the sound object.
[0008] In a fifth aspect, the present disclosure provides an electronic device comprising a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the above-mentioned audio processing method in the game and the audio playback method in the game.
[0009] In a sixth aspect, the present disclosure provides a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the audio processing method in the game and the audio playback method in the game.
[0010] The embodiments of the present disclosure bring the following beneficial effects:
[0011] The present disclosure provides an audio processing method, an audio playback method, an apparatus and an electronic device in a game, which first receive a start recording instruction for audio in a target game, and record the playback information corresponding to at least one audio event played in the target game starting from the time when the start recording instruction is received; then receive an end recording instruction to end recording the playback information corresponding to at least one audio event played in the target game; wherein the playback information of the audio event includes the sound object corresponding to the audio event, the playback time of the sound object and the audio engine interface information called by the sound object; then based on the recorded playback information corresponding to the at least one audio event played in the target game, generate audio trigger information corresponding to the target audio; wherein the target audio includes: at least one audio event played in the target game during the time period from receiving the start recording instruction to receiving the end recording instruction; the audio trigger information includes the recording time of the target audio, and the playback information of at least one audio event; the audio trigger information is saved to a specified file so that when a playback instruction for the target audio is received, the target audio is played based on the audio trigger information. When recording audio, this method does not directly record the audio but records the playback information corresponding to the audio, and plays back the audio through the playback information. Since the storage space occupied by the playback information is much smaller than that of the video file, this method reduces the storage space occupied after the audio is recorded.
[0012] Other features and advantages of the present disclosure will be set forth in the following description, or some features and advantages may be inferred or unambiguously determined from the description, or may be learned by implementing the above-mentioned technology of the present disclosure.
[0013] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, the following specifically cites preferred implementation modes and describes them in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the specific embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0015] Figure 1 A flowchart of an audio processing method in a game provided by an embodiment of the present disclosure;
[0016] Figure 2 A flowchart of an audio playback method in a game provided by an embodiment of the present disclosure;
[0017] Figure 3A schematic diagram of the structure of an audio processing device in a game provided by an embodiment of the present disclosure;
[0018] Figure 4 A schematic diagram of the structure of an audio playback device in a game provided by an embodiment of the present disclosure;
[0019] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0020] In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. The components of the embodiments of the present disclosure described and shown in the drawings here can be arranged and designed in various different configurations.
[0021] Therefore, the following detailed description of the embodiments of the present disclosure provided in the accompanying drawings is not intended to limit the scope of the present disclosure claimed for protection, but merely represents selected embodiments of the present disclosure. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present disclosure.
[0022] In order to complete game tasks or make videos in the game, players need to record and play back the sound. In the related technology, the ways of recording audio in the game include the following:
[0023] 1. After triggering the recording, the game screen and audio signal stream are saved at the same time to generate a fixed video file, which is then played back to the client at the set time. For example, after a game battle, the highlight moment is played back on the settlement interface.
[0024] 2. After the player triggers the recording, the game screen and audio are saved at the same time to generate a fixed video file, which is saved locally or in the cloud space (server).
[0025] 3. Record and save the sound input by the player from the microphone in the game:
[0026] a) Record only the voice of the player, for example, custom calls, phonograph, voice messages, voice-controlled games, etc.
[0027] b) Recording multiplayer player voices, for example, chorus function, chat room recording, etc.
[0028] In the related art, an external audio and video recording plug-in is used to complete the recording and store it locally. The recorded content temporarily stored locally is played by an external player or game engine plug-in, or the player chooses to download and transfers the temporarily stored audio to the player's local folder or mobile phone album. However, the method in the related art directly records all sounds as audio files, which takes up a large space, puts a lot of pressure on cloud storage and synchronization, and there is no integrated system for managing recording, transfer, distribution, and playback in the virtual world. This recording looks like the real world, and is not much different from the experience of directly recording with mobile phones, game consoles, screen recording software and other devices. At the same time, the traditional in-game recording + playback solution only records the sound input by the player's microphone. There is no virtual recording storage and information matching solution for in-game sounds, and it is impossible to support the design of game tasks related to recording.
[0029] Based on the above problems, an embodiment of the present invention provides an audio processing method in a game, such as Figure 1 As shown, the method comprises the following specific steps:
[0030] Step S102, receiving a start recording instruction for the audio in the target game, and recording the playback information corresponding to at least one audio event played in the target game starting from the time the start recording instruction is received; receiving an end recording instruction, and ending the recording of the playback information corresponding to at least one audio event played in the target game; wherein the playback information of the audio event includes the sound object corresponding to the audio event, the playback time of the sound object, and the audio engine interface information called by the sound object.
[0031] In a specific implementation, the target game may be any game. By running the game program corresponding to the target game, the game screen may be displayed in a graphical user interface provided by a terminal device, which may be a mobile phone, a tablet computer, or a computer, etc. The audio events played in the target game may include environmental noise, object sounds, and music sounds in the game scene, and may also include the hawking and conversation sounds of virtual characters in the game scene, and may also include background music, etc.
[0032] The above-mentioned start recording instruction can be an operation of a button corresponding to the target game triggered by the player, or a scene in which a virtual character in the target game scene enters a specified area, etc. Specifically, the player can send a start recording instruction to start the recording function in any scene and any state where the recording function is allowed. After sending the start recording instruction, all audio events played in the target game or some selected audio events can be recorded. Since the audio events in the target game are stored in the game package and triggered to play by the audio engine, when recording the audio events played in the target game, it is necessary to record the trigger recording time and the audio event playback situation, that is, after the player sends the start recording instruction, the playback information of the audio events played in the target game is recorded from the time when the start recording instruction is received. Among them, the playback information includes the sound object corresponding to the audio event played in the target game, the playback time of the sound object, and the audio engine interface information called by the sound object; wherein, the audio engine interface information is used to indicate the interface called when the audio engine plays the audio event, and the sound object is the game object that emits the sound corresponding to the audio event in the target game, and the game object can be a game character, a non-player character, a virtual vehicle or a virtual object, etc.
[0033] In actual applications, after the player triggers the recording of audio, each triggered audio engine interface call will be recorded, as well as the sound object that plays the audio event in the target game after the interface call is triggered and the playback time of the sound object. Based on this, multiple audio engine interface calls may be made when recording game audio, and the audio played in the game by each interface call can be called an audio event. Therefore, when recording game audio, multiple audio events corresponding to the playback information can be recorded, and the sound objects recorded in each playback information can be the same or different.
[0034] The above-mentioned end recording instruction can be triggered by the player triggering a button displayed in the graphical user interface, or it can be triggered when the player controls the virtual character to move to a scene area in the target game. When the player sends the end recording instruction through the terminal device, it is necessary to record the end time of recording and stop recording the audio event in the target game, that is, stop recording the playback information corresponding to the audio event played in the target game.
[0035] Step S104, based on the playback information corresponding to at least one audio event played in the recorded target game, generate audio trigger information corresponding to the target audio; wherein the target audio includes: at least one audio event played in the target game during the time period from receiving the start recording instruction to receiving the end recording instruction; the audio trigger information includes the recording time of the target audio, and the playback information of at least one audio event.
[0036] After receiving the end recording instruction, the playback information of at least one audio event played in the target game will be combined to obtain the audio trigger information corresponding to the target audio. The audio includes one or more audio events played in the target game during the period from receiving the start recording instruction to receiving the end recording instruction; the audio trigger information corresponding to the target audio includes the recording time of the target audio and the playback information of each recorded audio event; the recording time of the target audio includes the recording start time and the recording end time.
[0037] Step S106, saving the audio trigger information to a designated file, so that when a playback instruction for the target audio is received, the target audio is played based on the audio trigger information.
[0038] In specific implementation, the above-mentioned designated file can be determined according to R&D requirements, and the designated file can be a txt document or a table, etc. After the audio trigger information is saved to the designated file, when the player wants to play the target audio, the audio trigger information saved in the designated file can be obtained to call the audio event contained in the target audio from the audio engine for playback. The designated file stores the audio trigger information, not the video file corresponding to the target audio, so this method can save recording storage space.
[0039] In addition, when a playback instruction for the target audio is received, a method of playing the target audio based on the audio trigger information, that is, the audio playback method, will be described in detail in subsequent embodiments.
[0040] An embodiment of the present invention provides an audio processing method for a game. When recording audio, this method does not directly record the audio but records the playback information corresponding to the audio, and plays back the audio through the playback information. Since the storage space occupied by the playback information is much smaller than that of the video file, this method reduces the storage space occupied after the audio is recorded.
[0041] The following preferred embodiments are used to describe the method of generating audio trigger information.
[0042] Specifically, the specific process of generating audio trigger information corresponding to the target audio based on the playback information corresponding to at least one audio event played in the target game may include: generating a time code according to the recording time of the target audio and the playback time of at least one audio event played in the target game; combining the time code with the sound object corresponding to at least one audio event played in the target game corresponding to the time code and the audio engine interface information called by the sound object into a target character string, and determining the target character string as the audio trigger information.
[0043] The above-mentioned rules for generating time codes can be determined according to research and development needs. For example, if the recording start time (also referred to as the start recording time) is 14:13:15 on November 3, 2023, the time code corresponding to the recording start time can be set to 20231103141315, or the time code corresponding to the recording start time can be set to 231103140315, or the time code can be set to other preset forms. Specifically, according to the recording time of the target audio and the playback time of at least one audio event played in the recorded target game, the start recording time corresponding to each audio event in the at least one audio event can be obtained, and then for each audio event, the time code corresponding to the current audio event is generated based on the start recording time corresponding to the current audio event, and then the time code corresponding to the current audio event is combined with the sound object corresponding to the current audio event and the audio engine interface information called by the sound object into a substring, which is also the playback information corresponding to an audio event; then the substrings corresponding to each audio event are spliced in the order before and after the start recording time to obtain a target string, which is also the audio trigger information, and the audio trigger information contains at least one playback information corresponding to an audio event.
[0044] In an optional embodiment, the playback information of the audio event played in the recorded target game also includes at least one of the following information: volume setting information, the orientation information of the sound object corresponding to the audio event, and the reverberation effect setting information; wherein the volume setting information is used to indicate the volume of the current playback of the audio event; the orientation information of the sound object is used to indicate the relative position relationship between the player (that is, the virtual character recording the audio in the game) and the sound object; the reverberation effect setting information includes auxiliary bus configuration information and effector switch setting information for simulating effects such as reverberation. This information is usually set for a single sound object, and different sound objects can be set to different values. The purpose of recording these setting information in the playback information is to truly restore the playback audio event when playing back the recorded audio, that is, the setting information corresponding to the recording audio is the same as the setting information corresponding to the playback audio. For example, if the reverb effect is turned on when recording audio, then the reverb effect needs to be turned on when playing back the audio; the recorded audio is the voice of non-player character A, and when recording the audio, non-player character A is 30 meters to the right of the player character (equivalent to the direction information of the sound object mentioned above), then when playing back the audio, the sound object needs to be set to a position 30 meters to the right of the player character.
[0045] In an optional embodiment, when recording the playback information corresponding to the audio event corresponding to the audio event played in the target game, it is necessary to record the straight-line distance between the sound-emitting object corresponding to the audio event and the audio listening object (equivalent to the above-mentioned player character), as well as the positional relationship between the sound-emitting object and the audio listening object; wherein the size of the straight-line distance is inversely proportional to the volume size corresponding to the volume setting information; the positional relationship is used to indicate the orientation information of the sound-emitting object relative to the audio listening object. Specifically, the above-mentioned positional relationship includes: in a rectangular coordinate system established with the audio listening object as the origin, the coordinate value of the sound-emitting object on a preset axis, and the preset axis can be determined according to research and development requirements, for example, the preset axis can be the X-axis, Y-axis or Z-axis, etc. This method can restore the playback state of the audio event at the time of audio recording based on the information such as the straight-line distance and positional relationship recorded during audio recording when playing back the audio.
[0046] The following embodiments are used to describe the method of recording and playing back the audio input by the microphone.
[0047] Specifically, a recording instruction for external input audio from the target game is received, the external input audio is obtained based on a preset plug-in, and the external input audio is converted into a specified format and stored in a preset audio file. The preset plug-in can be customized according to the audio engine, and the audio signal is the sound input by the player through an external device, which can be a microphone or headphones, etc.; the specified format is also defined according to the audio engine used, and the preset audio file can also be set according to research and development needs.
[0048] Furthermore, when converting the external input audio into a specified format and then storing it in a preset audio file, it is necessary to perform format conversion processing on the external input audio to obtain an audio signal in a specified format; then create a new audio file to obtain a preset audio file, and store the audio signal in the specified format in the preset audio file; wherein the preset audio file is named based on the start recording time and / or end recording time of the external input audio. In order to prevent the current recording from overwriting the last recorded audio, this method creates a new audio file when storing audio, and stores the recorded audio in the newly created audio file. At the same time, since the naming of the newly created audio file is related to the recording time and is unique, it can also prevent the newly created audio file from overwriting the previously created audio file, so that multiple audio files can be retained.
[0049] In a specific embodiment, Wwise is used as an audio engine to implement the function. Similar functions can be found in other audio engines or customized plug-ins can be used to achieve similar effects. First, record the microphone mic input signal (equivalent to the above-mentioned external input audio) to an audio file: add a Mic bus (that is, a custom bus) under the Master bus to transmit the audio signal input by the player's microphone (equivalent to the above-mentioned microphone). Here, you can use the voice input plug-in that comes with the voice middleware and add it to the bus effect page (you can use any preset plug-in to input microphone audio to Wwise, and the choice does not affect this solution). On this basis, add a Wwise Recorder plug-in to record the mic bus audio signal and output it as a wem file (equivalent to the above-mentioned preset audio file). Specify a relative path in the game project folder to store the recorded audio signal. Since each recording using the Wwise recorder will overwrite the previously recorded audio, it is necessary to rename the preset audio file according to the start time of recording after each recording is completed and upload it to the server as needed. Here, uploading it to the server is to synchronize it with other players' clients during playback.
[0050] Specifically, the interactive mode of on-demand uploading can be: the player clicks the "upload" button to upload the preset audio file to the server for synchronization, and the rest of the audio is saved locally by the player. However, this solution is not limited to the interactive mode of the player clicking to upload, and the game logic designed by the game planner can also drive the choice of whether to upload, for example: the countdown of the time-limited level ends, and it is automatically uploaded when it is determined that the player has successfully completed the task.
[0051] Players can also play back the audio in a preset audio file. Specifically, if an audio playback instruction for a preset audio file is received, the preset audio file is obtained or downloaded, and the audio in the preset audio file is played. In a specific implementation, when playing back the audio of a preset audio file, the preset audio file can be obtained from the client's specified location (that is, the storage location of the preset audio file) and the audio in the preset audio file can be played using a specified source plug-in. If this recording is synchronized to the game server (cloud disk), the preset audio file is pre-downloaded and then played back on the client. The preset audio file is also pre-downloaded in other players' clients, and is cleaned up uniformly when the cache is cleared after playback.
[0052] For example, when a player double-clicks the CD player in the game backpack, a pop-up window will pop up in the game interface to display the names of all the audio clips stored locally and in the cloud by the player. The player can click on any audio clip to assign it as the default playback clip of the CD player. After the assignment is completed, the player can place this CD player in the "Home Study" (the player clicks on the study desktop, a pop-up window will pop up to prompt that items can be placed, and the CD player can be placed). After placement, a model of this CD player is added to the desktop in the scene. When the player clicks on the CD player on the desktop of the Home Study, the preset audio file corresponding to the CD is obtained, and the audio in the preset audio file is played back on the client.
[0053] In the case where other players play back the audio recorded by a specified player, it is necessary to pre-download the preset audio file corresponding to the audio. For example, when other players enter the home where the above player has set up a CD player and click on the CD player, the audio corresponding to the CD player is synchronized from the server to the client of this player for playback. In this application scenario, when other player B enters the home of the above player, all the playback audio configured in the home can be pre-downloaded. The cache can be cleared when player B exits the home, or after the number of manors visited by player B reaches N, the earliest visited home recording can be cleared. Streaming playback can also be used to shorten the delay (no need to clean up).
[0054] In actual applications, audio trigger information and preset audio files can be mixed for playback. Specifically, the recording time of the audio trigger information corresponding to the target audio includes the recording start time, and the preset audio file stores the start recording time. Based on this, a mixed playback instruction is received, and a preset audio file corresponding to the start recording time that is the same as the recording start time of the audio trigger information is determined. While playing the target audio based on the audio trigger information, the audio in the preset audio file is played. Among them, the above-mentioned mixed playback instruction can be sent by the player through a terminal device (also called a client).
[0055] In addition, when the playback time corresponding to one of the at least one audio events contained in the target audio is consistent with the start recording time corresponding to the preset audio file, if a mixed playback instruction is received, the audio in the preset audio file can be played while playing the first audio event.
[0056] In a specific embodiment, the mixed use of audio trigger information and preset audio file playback requires synchronization of the initial time code recorded by the external input audio and the audio trigger information (equivalent to the initial recording time). When the player selects mixed recording, the same start time code is recorded for the preset video file and audio trigger information. Under this condition, during mixed playback, only the above two methods are needed to find the preset audio file and audio trigger information with the same start time code and play them back at the same time.
[0057] In an optional embodiment, the present invention can match the external audio input by the player. Specifically, the target task type corresponding to the target game task is obtained, and based on the target task type, the audio in the preset audio file is matched with the target game task to obtain a matching result. In a specific implementation, when it is necessary to match the external audio input by the player, voice matching can be performed using different matching methods corresponding to different task types according to different task types. The matching method corresponding to each task type is pre-set.
[0058] For example, when the task type of the game task is voice matching, the preset voice recognition technology can be used to identify the audio in the preset audio file to obtain the audio text, and the audio is matched with the script required by the game task (for example, if the similarity between the audio text and the script required by the game task is greater than 85%, it is determined to be a successful match), or the recognized voice text is used for other judgments (for example, judging whether the voice text contains specific words), etc. When the task type of the game task is sound effect matching, the sound effect recognition open source model can be used to retrieve similar sound effects in the project library, and determine the label for the audio in the preset audio file based on the similar sound effects, and then determine whether the label is within the range of the game task requirements. For example, the game task requires the player to record a sound of biting an apple with an external device, and the project material library should store a sound effect of biting an apple "apple_chewing_01". After obtaining the audio in the preset audio file, input the retrieval model to analyze the similarity. If apple_chewing_01 ranks in the top few similarities with it and the similarity is greater than 60%, it is determined to be a successful match. When the task type of the game task is music matching, the music information recognition model can be used to identify information such as the beat and pitch sequence of the audio in the preset audio file, and then determine whether it is within the range of the game task requirements to obtain a judgment result.
[0059] The above method can match and manage the recorded microphone input audio, thereby increasing the playability of the game and the richness of the game tasks, and helping to improve the player's gaming experience.
[0060] The following preferred embodiments are used to describe the methods of matching, splicing and trimming recorded audio in games.
[0061] The present invention can perform virtual recording, which means providing players with a sound recording method that simulates the real world or adds novelty to the real world in the game world. Players can record, manage, edit and play back audio information in the game world in this way.
[0062] Specifically, players can record all sounds or selected sounds in the game by turning on the recording function in any scene or state where the recording function is allowed. For example, the following sounds can be recorded: environmental noise, object sounds, active music; noisy sounds of people hawking and talking on the roadside; sounds of secret conversations; intercom voices sent by other players; game interface sounds and background music (since these two sounds do not essentially belong to the game world, they can be turned on or off in the recording as optional items). It should be noted that the sounds here are equivalent to the above-mentioned audio events.
[0063] Players can also manage recorded sound effects. For example, players can transfer their recorded sounds to other virtual devices (such as records, CDs, or mobile phones); players can also distribute the transferred recorded sound effects to other players or NPCs (through sales, gifts, etc.); each transfer device has a certain space limit, and players can delete unsatisfactory recordings to make room for new recordings.
[0064] Players can also play back their recorded audio, that is, they can select the sound recording in their own "recording device" to audition, or configure (transfer) it to other virtual devices that can play sound. Examples of virtual devices are as follows: car audio, mobile phone ringtones, union radio, record player, home background music and UI interface.
[0065] Players can match game tasks based on the recorded in-game audio. Specifically, submit the audio trigger information corresponding to the target audio, and search the audio trigger information for the first playback information corresponding to the first audio event required for the specified game task; if the first playback information is found in the audio trigger information, it is determined that the specified game task is completed. The audio events that need to be matched for each game task can be the same or different. For example, the NPC asks the player to record the call of the rare animal "Taotie" (equivalent to the first audio event required for the above-mentioned specified game task). After the player finishes recording, when the sound is matched, the audio trigger information selected and submitted by the player is searched for playback information of the audio event containing the call of "Taotie". If it is included, the game task can be considered completed.
[0066] In an optional embodiment, the designated game task also needs to determine the degree of completion of the audio event. Specifically, the recording time of the audio trigger information includes the recording start time of the target audio; after searching the audio trigger information for the first playback information corresponding to the first audio event required for the designated game task, based on the playback time contained in the first playback information and the recording start time of the target audio, determine the recording start time and recording end time of the first audio event in the audio trigger information; determine the time difference between the recording start time and the recording end time corresponding to the first audio event in the audio trigger information; determine whether the time difference is the same as the total duration of the first audio event required for the designated game task, and if so, determine that the designated game task is completed.
[0067] For example, if the NPC in the game task design requires eavesdropping on the complete conversation between player A and player B, the completeness needs to be matched at the same time. After the player completes the recording, when matching the sound, the audio trigger information selected and submitted by the player is searched to see whether it contains the playback information of the conversation between player A and player B. If it does, it is also necessary to compare the difference between the recording start time and the recording end time of the first audio event determined based on the playback information, and whether it is the same as the total duration of the audio required for the game task. If they are the same, it is determined to be a complete recording, confirming that the game task is completed.
[0068] In the specific implementation, the player sets the path of the camera and recorder and then starts the performance, or another player acts as the photographer and recorder. After the shooting is completed, the recorded audio trigger information is uploaded to the server cloud space, and the player can preview, trim, and publicly screen the recorded "movie". In addition, when the game mission requires the player to record key dialogues at A, B, and C, and when returning to hand in the mission, it is necessary to insert only one clip to play during the command process, so the three recordings need to be edited and spliced.
[0069] Based on the above description, when matching sounds, players can be restricted to submitting only one trigger information in the audio trigger information, or a "clipping" function can be designed to provide players with collage recording information (that is, combining the playback information of the two recordings together according to the time code). Specifically, according to the recording time of the target audio and the playback time of at least one audio event played in the recorded target game, the start recording time and the end recording time corresponding to at least one audio event are determined; based on the start recording time and the end recording time corresponding to the at least one audio event, the target audio is trimmed to obtain the audio trigger information corresponding to the trimmed target audio.
[0070] The start recording time and end recording time of the audio event in the audio trigger information corresponding to the target audio can also be combined with the audio trigger information corresponding to the specified audio to obtain the audio trigger information corresponding to the combined audio, so as to play the combined audio through the audio trigger information corresponding to the combined audio. The above-mentioned specified audio can be any audio selected by the player.
[0071] In an optional embodiment, the audio trigger information corresponding to the target audio includes: the recording time of the first part of the second audio event and the playback information of the second audio event; the audio trigger information corresponding to the designated audio includes: the recording time of the second part of the second audio and the playback information of the second audio event; wherein the first part and the second part of the second audio event constitute a complete second audio event; the specific process of splicing the start recording time and the end recording time corresponding to the audio event in the audio trigger information corresponding to the target audio with the audio trigger information corresponding to the designated audio to obtain the audio trigger information corresponding to the spliced audio may include: splicing the recording time of the first part of the second audio event in the audio trigger information corresponding to the target audio with the recording time of the second part of the second audio event in the audio trigger information corresponding to the designated audio to obtain the spliced recording time of the second audio event; determining the spliced recording time of the second audio event and the playback information of the second audio event as the audio trigger information corresponding to the spliced second audio event. Specifically, the recording time includes the start recording time and the end recording time.
[0072] In a specific implementation, the first part of the second audio event refers to the audio content corresponding to the time from the start of the first audio event to the preset duration of the first audio event; the second part of the second audio event refers to the audio content corresponding to the time from the preset duration of the second audio event to the end of the second audio event. Furthermore, the recording time of the second part of the second audio and the playback information of the second audio event are recorded in the following manner: when the second audio event in the target game has been played for a preset time, a start recording instruction for the second audio event is received, and the event identifier of the audio event being played on the sound object is obtained using a preset interface; the currently playing audio event is determined to be the second audio event through the event identifier, and the playback information of the second audio event is recorded; when the second audio event ends, the recording time of the second audio event is obtained through a preset callback function, and the recording time includes the time from the receipt of the start recording instruction to the end of the second audio event.
[0073] In actual applications, since the playback information will not be recorded after recording starts after the audio event is triggered, it is necessary to first obtain the currently playing audio event: use the preset interface to obtain the audio event ID being played on the target sound object (equivalent to the above-mentioned event identifier) to locate the event, and then obtain the "time from the start of recording to the completion of event playback" through the event end callback (equivalent to the recording time of the second part of the above-mentioned second audio event).
[0074] In the specific implementation, the audio trigger information corresponding to the spliced second audio event can also be submitted; if the duration corresponding to the spliced recording time of the second audio event in the audio trigger information corresponding to the spliced second audio event is greater than the playback duration corresponding to the second audio event required for the first game task, it is determined that the first game task is completed.
[0075] The above method provides a virtual recording method that mixes the recorded audio signal stream and trigger information, and also provides developers with the possibility of designing gameplay related to virtual recording and virtual sound recognition. In addition, this method optimizes performance and storage as much as possible while satisfying the above experience and design possibilities.
[0076] Corresponding to the above method embodiment, the embodiment of the present invention also provides an audio playback method in a game, such as Figure 2 As shown, the method comprises the following specific steps:
[0077] Step S202, receiving an audio playback request, and determining audio trigger information of a target audio to be played based on the playback request; wherein the target audio includes at least one pre-recorded audio event played in a target game, and the audio trigger information includes the recording time of the target audio, and the playback information of at least one audio event; the playback information of the audio event includes the sound object corresponding to the audio event, the playback time of the sound object, and the audio engine interface information called by the sound object.
[0078] In a specific implementation, the audio playback request may be triggered by a player triggering a button corresponding to the target game, or by a virtual character in the target game scene entering a specified area, etc. The audio playback request carries the audio identifier corresponding to the target audio to be played, so that the audio trigger information of the target audio can be obtained from the specified file based on the audio identifier.
[0079] Step S204: based on the playback information of at least one audio event, a new sound object corresponding to the audio event is created at a predetermined position in the target game.
[0080] In a specific implementation, a new sound object for each audio event can be established at a predetermined position in the target game according to the sound object recorded in the playback information of at least one audio event. The predetermined position can be any position in the game scene or a designated position determined according to the playback information, and the preset position matches the corresponding sound position when the audio event is recorded.
[0081] In an optional embodiment, the above-mentioned playback information also includes at least one of the following information: volume setting information, the position information of the sound object corresponding to the audio event, and reverberation effect setting information; wherein, the predetermined position of the newly created sound object established in the target game matches the position information of the sound object corresponding to the audio event; the volume of the sound emitted by the newly created sound object matches the volume setting information; the predetermined position of the newly created sound object in the target game matches the reverberation effect setting information. The purpose of recording these setting information in the playback information is to truly restore the playback audio event when playing back the recorded audio, that is, the corresponding setting information when recording the audio is the same as the corresponding setting information when playing back the audio. For example, if the audio event recorded is 30 meters to the right of the player character, then the position of the newly created sound object needs to be determined according to this position information when playing back; if the reverberation effector is turned on when recording the audio, then the reverberation effector also needs to be turned on when playing back the audio.
[0082] In a specific implementation, the playback information corresponding to the above audio event includes: volume setting information and the position information of the sound object corresponding to the audio event; wherein the volume setting information includes: the straight-line distance between the sound object corresponding to the audio event and the audio listening object (equivalent to the above player character); the position information of the sound object corresponding to the audio event includes: the positional relationship between the sound object and the audio listening object; wherein the size of the straight-line distance is inversely proportional to the volume size corresponding to the volume setting information; the positional relationship includes: the coordinate value of the sound object on a preset axis in a rectangular coordinate system established with the audio listening object as the origin. Based on this, the specific process of establishing a new sound object corresponding to the audio event at a predetermined position in the target game based on the playback information of at least one audio event may include:
[0083] Based on the volume setting information in the playback information corresponding to the audio event, determine the target volume of the newly created sound object corresponding to the audio event; based on the orientation information of the sound object in the playback information corresponding to the audio event, determine the predetermined position of the newly created sound object in the target game, establish the newly created sound object at the predetermined position in the target game, and configure the target volume for the newly created sound object. For example, if the coordinate value included in the position relationship is -0.5, it means that during recording, the coordinate value of the sound object in the rectangular coordinate system established with the audio listening object as the origin on the preset axis is -0.5, then during audio playback, the predetermined position of the newly created sound object in the target game is: the position in the target game where the coordinate value on the preset axis in the rectangular coordinate system established with the audio listening object as the origin is -0.5.
[0084] In another optional embodiment, in order to more realistically restore the audio recording scene during audio playback, the predetermined position of the newly created sound object in the target game can also be determined based on the position information and volume setting information of the sound object in the playback information corresponding to the audio event. That is, when playing back the audio, the position coordinates of the newly created sound object in the target game are determined based on the straight-line distance between the sound object corresponding to the audio event recorded in the playback information and the audio listening object, and the coordinate value of the sound object in the preset axial direction in the rectangular coordinate system established with the audio listening object as the origin, and the position coordinates are determined as the predetermined position of the newly created sound object in the target game.
[0085] In a specific implementation, the predetermined position of the newly created sound object established in the target game matches the position information of the sound object corresponding to the audio event. For example, assuming that the non-player character A in the game scene sings in front of the left of the player character, when the player character records the audio event of the non-player character A singing, the straight-line distance between the player character and the non-player character A, and the coordinate value of the non-player character in the X-axis direction (equivalent to the above-mentioned preset axis) in the rectangular coordinate system established with the player character as the origin will be recorded. The coordinate value can also be called the offset value on the X-axis. Among them, the size of the straight-line distance is inversely proportional to the size of the target volume, that is, the farther the straight-line distance between the player character and the non-player character A, the smaller the target volume corresponding to the audio event. Specifically, the straight-line distance has a certain relationship with the target volume corresponding to the volume event, and the relationship can be determined by a preset volume attenuation function. For example, in the volume attenuation function, the maximum volume is set to 200, and the volume is attenuated by 20 for every 10 meters increase in the straight-line distance. The offset value on the X-axis is used to indicate the position information of the sound object, that is, the position of the non-player character A relative to the player character. For example, if the offset value on the X-axis is -0.5 meters, then the non-player character A is 0.5 meters to the left of the player character.
[0086] When playing audio events, there are two situations: 2D playback and 3D playback. Among them, 2D playback includes playing with the background music player embedded in the game or playing video events in the game interface. At the same time, in 2D playback, the player character cannot be moved when playing audio events; 3D playback includes playing audio events with a virtual TV or CD player in the game scene. At the same time, in 3D playback, the player character can move freely in the game scene.
[0087] When playing back the audio trigger information corresponding to the recorded target audio, if it is played in 2D form, the straight-line distance and X-axis offset value of each sound object during recording are directly restored with the player character as the origin. For example, when calling the Wwise audio engine for sound playback, the toggle_attanuation value can be set to 0, that is, the volume attenuation provided by the audio engine is turned off (the attenuation function corresponding to the volume attenuation can be determined according to R&D requirements), and the straight-line distance of the stored sound object (that is, the straight-line distance in the target audio trigger information) is assigned to the newly created sound object, and the straight-line distance is used as the straight-line distance between the newly created sound object and the player character, thereby determining the target volume of the newly created sound object; using the ak.soundengine.setPosition interface, the offset value on the X-axis of the sound object stored in the audio trigger information is assigned to the newly created sound object to determine the predetermined position of the newly created sound object in the game scene. For example, the offset value on the X-axis is -0.5 meters, then the predetermined position of the newly created sound object in the game scene, the coordinates in the rectangular coordinate system corresponding to the player character are (-0.5, 0, 0). This method does not consider the position influence of the Y-axis and Z-axis. In some embodiments, the predetermined position of the newly created sound object can also be determined based on the straight-line distance and the offset on the X-axis to consider the position influence of the Y-axis and Z-axis.
[0088] If it is played in 3D, on the basis of the above 2D playback, the positional relationship between the player character and the playback object (which can be a virtual TV or CD player) is considered. Specifically, when using the playback object for audio 3D playback, it is necessary to determine the target volume of the newly created sound object corresponding to the audio event based on the volume setting information in the playback information corresponding to the audio event and the orientation information of the sound object; based on the orientation information of the sound object in the playback information corresponding to the audio event and the orientation information of the playback object, determine the predetermined position of the newly created sound object in the target game; wherein the orientation information of the playback object includes: in a rectangular coordinate system established with the position of the audio listening object in the target game during playback as the origin, the coordinate value of the playback object on the preset axis. In this method, the audio listening object can be moved in the game scene according to the player's operation, and the position of the playback object is fixed in the game scene, so that the orientation information of the playback object can change based on the movement of the audio listening object, so that the predetermined position of the newly created sound body can be changed based on the movement of the audio listening object during playback during audio playback, thereby increasing the 3D playback feeling of the audio.
[0089] In a specific implementation, when playing back audio in 3D, the straight-line distance between the sound-emitting object and the audio listening object corresponding to the audio event recorded in the playback information can be subtracted from the absolute value of the coordinate value of the sound-emitting object on the preset axis in the rectangular coordinate system established with the audio listening object as the origin recorded in the playback information to obtain a subtraction result, and the target volume of the newly created sound-emitting object is determined based on the subtraction result, wherein the larger the subtraction result, the larger the target volume. The orientation information of the sound-emitting object in the playback information corresponding to the audio event and the orientation information of the playback object can also be added to obtain an addition result, and the predetermined position of the newly created sound-emitting object in the target game is determined based on the addition result. Among them, the orientation information of the sound-emitting object corresponding to the audio event includes: the coordinate value of the sound-emitting object on the preset axis in the rectangular coordinate system established with the audio listening object corresponding to the recorded audio event as the origin; the orientation information of the playback object includes: the coordinate value of the playback object on the preset axis in the rectangular coordinate system established with the audio listening object during playback as the origin. This method does not take into account the influence of the axis outside the preset axis on the position of the newly created sound-emitting object. In some embodiments, the predetermined position of the newly created sound-emitting object can also be determined based on the straight-line distance and the coordinate value on the preset axis to take into account the influence of the axis outside the preset axis on the position of the newly created sound-emitting object.
[0090] For example, assuming that the preset axis is the X axis, if it is played in 3D, when calling the Wwise audio engine for sound playback, the toggle_attanuation value can be set to 1, that is, the volume attenuation provided by the audio engine is turned on, and the absolute value of the offset value on the X axis of the sound object stored during recording (for example, -0.5 meters) is subtracted from the stored straight-line distance of the sound object (for example, 1.2 meters) to obtain the subtraction result (1.2 meters - | -0.5 meters | = 0.7 meters), and this subtraction result is assigned to the newly created sound object, and the subtraction result is used as the straight-line distance between the newly created sound object and the player character, so as to determine the new sound object based on the straight-line distance and the volume attenuation provided by the audio engine. Build the volume of the sound object; obtain the coordinate value of the playback object on the X-axis in the rectangular coordinate system established with the player character at the time of playback as the origin (for example, -0.2 meters), add the offset of the sound object on the X-axis stored during recording to the above coordinate value, and obtain the addition result (-0.5-0.2=-0.7); use the ak.soundengine.setPosition interface to assign the addition result to the newly created sound object to determine the predetermined position of the newly created sound object in the game scene (-0.7,0,0). This method does not consider the position influence of the Y-axis and Z-axis. In some embodiments, the predetermined position of the newly created sound object can also be determined based on the straight-line distance and the offset on the X-axis. At this time, due to the audio attenuation of the audio engine itself, the azimuth effect of the superimposed X-axis offset, and the attenuation effect superimposed by the straight-line distance, the sense of orientation during recording can be restored, and the sense of orientation of the playback object can be generated again as the player character moves.
[0091] Step S206, based on the recording time of the audio trigger information, the playing time of the sound object corresponding to at least one audio event, and the audio engine interface information called by the sound object, control the newly created sound object corresponding to at least one audio event to make sound.
[0092] In the specific implementation, the recording start time corresponding to at least one audio event is determined according to the recording time of the audio trigger information and the playback time of the sound object corresponding to at least one audio event; according to the order of the recording start time corresponding to at least one audio event, the newly created sound object corresponding to at least one audio event is controlled in turn to call the audio engine interface information to make sound.
[0093] When playing back audio, a new sound object needs to be created to avoid affecting other sounds that are appearing in the game world during playback. For example, a player records a bird call, and then uses a virtual speaker to play the recording directly in situ. At this time, the bird call sound object setting in the virtual speaker should not affect the bird call outside. In the specific implementation, when receiving the playback instruction for the target audio, it is necessary to obtain the audio trigger information corresponding to the target audio from the specified file, and establish a set of dedicated sound objects for the playback device according to the sound objects recorded in the audio trigger information; for example, there are two sound objects, obj_char and obj_music, in the audio trigger information. When playing back with a TV, it is necessary to first create two new sound objects, TV_obj_char and TV_obj_music. Then, according to the time code interval timing and triggering the interface call information in the audio trigger information one by one, the interface call is performed. Note that the sound objects that trigger the interface call here are all changed to sound objects with the TV prefix, that is, all are changed to the corresponding new sound objects.
[0094] In an optional embodiment, since a large number of audios need to be played when multiple players are playing back audio, the present disclosure limits the number of audio playbacks for the same sound object, that is, the maximum number of sounds on the same newly created sound object is limited to a preset number threshold; specifically, when the third audio event needs to be sounded through a newly created sound object, it is determined whether the current number of sounds on the newly created sound object reaches the preset number threshold; if the preset number threshold is not reached, the third audio event is played through the newly created sound object; if the preset number threshold is reached, the audio event with the longest playback time on the newly created sound object is deleted, and the third audio event is played through the newly created sound object. The above-mentioned third audio event can be any audio event contained in the target audio.
[0095] For example, after recording, player A plays it back in place, and player B records the played back sound + the sound in the original environment, and then plays it back; player A then repeats player B's operation to play it back. If there is no limit, a very large number of audios will need to be played. In a specific embodiment, the number of voices in Wwise can be used to limit the maximum number of sounds on the same sound object. When this number is exceeded, the playback audio that was received before the playback instruction is stopped. This can avoid too many voices, and each playback of player A and player B can still restore the recording effect to the maximum extent.
[0096] An audio playback method in a game provided by an embodiment of the present invention does not directly record an audio signal, but records playback information corresponding to the audio, thereby reducing the storage space occupied after the audio is recorded. In addition, the audio playback environment when the audio was recorded can be truly restored by playing back the target audio through audio trigger information, thereby making the player's experience of audio playback more realistic.
[0097] Corresponding to the above method embodiment, the embodiment of the present invention further provides an audio processing device in a game, such as Figure 3 As shown, the device comprises:
[0098] The audio recording module 20 is used to receive a start recording instruction for the audio in the target game, and record the playback information corresponding to at least one audio event played in the target game starting from the time the start recording instruction is received; receive an end recording instruction, and end recording the playback information corresponding to at least one audio event played in the target game; wherein the playback information of the audio event includes the sound object corresponding to the audio event, the playback time of the sound object, and the audio engine interface information called by the sound object.
[0099] The information generation module 21 is used to generate audio trigger information corresponding to the target audio based on the playback information corresponding to at least one audio event played in the target game; wherein the target audio includes: at least one audio event played in the target game during the time period from receiving the start recording instruction to receiving the end recording instruction; the audio trigger information includes the recording time of the target audio, and the playback information of at least one audio event.
[0100] The information saving module 22 is used to save the audio trigger information to a designated file so as to play the target audio based on the audio trigger information when a playback instruction for the target audio is received.
[0101] The audio processing device in the above-mentioned game, when recording audio, does not directly record the audio but records the playback information corresponding to the audio, and plays back the audio through the playback information. Since the storage space occupied by the playback information is much smaller than that of the video file, this method reduces the storage space occupied after the audio is recorded.
[0102] Specifically, the above-mentioned information generation module 21 is used to: generate a time code according to the recording time of the target audio and the playback time of at least one audio event played in the target game; combine the time code with the sound object corresponding to at least one audio event played in the target game corresponding to the time code and the audio engine interface information called by the sound object into a target character string, and determine the target character string as audio trigger information.
[0103] Furthermore, the above-mentioned playback information also includes at least one of the following information: volume setting information, position information of the sound object corresponding to the audio event, and reverberation effect setting information.
[0104] Furthermore, the above-mentioned device also includes an external audio recording module, which is used to: receive a recording instruction for external input audio from the target game, obtain the external input audio based on a preset plug-in, and convert the external input audio into a specified format and store it in a preset audio file.
[0105] In a specific implementation, the above-mentioned external audio recording module is also used to: perform format conversion processing on the external input audio to obtain an audio signal in a specified format; create a new audio file to obtain a preset audio file, and store the audio signal in the specified format into the preset audio file; wherein the preset audio file is named based on the start recording time and / or end recording time of the external input audio.
[0106] Furthermore, the above-mentioned device also includes an external audio playback module, which is used to: receive an audio playback instruction for a preset audio file, obtain or download the preset audio file, and play the audio in the preset audio file.
[0107] In a specific implementation, the recording time of the audio trigger information corresponding to the target audio includes the recording start time, and the preset audio file stores the recording start time; the device also includes a mixed playback module, which is used to: receive a mixed playback instruction, determine the preset audio file corresponding to the recording start time that is the same as the recording start time of the audio trigger information, and play the audio in the preset audio file while playing the target audio based on the audio trigger information.
[0108] Furthermore, the above-mentioned device also includes a task matching module, which is used to: obtain a target task type corresponding to the target game task, and based on the target task type, match the audio in the preset audio file with the target game task to obtain a matching result.
[0109] In a specific implementation, the above-mentioned task matching module is also used to: submit audio trigger information corresponding to the target audio, and search for the first playback information corresponding to the first audio event required for the specified game task in the audio trigger information; if the first playback information is found in the audio trigger information, it is determined that the specified game task is completed.
[0110] Furthermore, the recording time of the above-mentioned audio trigger information includes the recording start time of the target audio; the above-mentioned task matching module is also used to: after searching the audio trigger information for the first playback information corresponding to the first audio event required for the specified game task, determine the recording start time and recording end time of the first audio event in the audio trigger information based on the playback time contained in the first playback information and the recording start time of the target audio; determine the time difference between the recording start time and the recording end time corresponding to the first audio event in the audio trigger information; determine whether the time difference is the same as the total duration of the first audio event required for the specified game task, and if they are the same, determine that the specified game task is completed.
[0111] Furthermore, the above-mentioned device also includes an audio cutting module, which is used to: determine the start recording time and end recording time corresponding to at least one audio event based on the recording time of the target audio and the playback time of at least one audio event played in the recorded target game; based on the start recording time and end recording time corresponding to at least one audio event, cut the target audio to obtain audio trigger information corresponding to the cut target audio.
[0112] Furthermore, the above-mentioned device also includes an audio splicing module, which is used to: based on the start recording time and end recording time corresponding to the audio event in the audio trigger information corresponding to the target audio, perform splicing processing with the audio trigger information corresponding to the specified audio to obtain the audio trigger information corresponding to the spliced audio, so as to play the spliced audio through the audio trigger information corresponding to the spliced audio.
[0113] Furthermore, the audio trigger information corresponding to the target audio includes: the recording time of the first part of the second audio event and the playback information of the second audio event; the audio trigger information corresponding to the specified audio includes: the recording time of the second part of the second audio and the playback information of the second audio event; wherein the first part and the second part of the second audio event constitute a complete second audio event; the audio splicing module is also used to: splice the recording time of the first part of the second audio event in the audio trigger information corresponding to the target audio with the recording time of the second part of the second audio event in the audio trigger information corresponding to the specified audio to obtain the spliced recording time of the second audio event; and determine the spliced recording time of the second audio event and the playback information of the second audio event as the audio trigger information corresponding to the spliced second audio event.
[0114] Furthermore, the above-mentioned device also includes a second recording module, which is used to: when the second audio event in the target game has been played for a preset time, receive a start recording instruction for the second audio event, and use a preset interface to obtain the event identifier of the audio event being played on the sound-emitting object; determine that the currently playing audio event is the second audio event through the event identifier, and record the playback information of the second audio event; when the second audio event ends, obtain the recording time of the second audio event through a preset callback function, and the recording time includes the time from receiving the start recording instruction to the end of the playback of the second audio event.
[0115] Furthermore, the above-mentioned task matching module is also used to: after determining the spliced recording time of the second audio event and the playback information of the second audio event as the audio trigger information corresponding to the spliced second audio event, submit the audio trigger information corresponding to the spliced second audio event; if the duration corresponding to the spliced recording time of the second audio event in the audio trigger information corresponding to the spliced second audio event is greater than the playback duration corresponding to the second audio event required for the first game task, it is determined that the first game task is completed.
[0116] The audio processing device in the game provided by the embodiment of the present disclosure has the same implementation principle and technical effects as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.
[0117] Corresponding to the above method embodiment, the embodiment of the present invention also provides an audio playback device in a game, such as Figure 4 As shown, the device comprises:
[0118] The playback request receiving module 40 is used to receive an audio playback request and determine the audio trigger information of the target audio to be played based on the playback request; wherein the target audio includes at least one audio event played in a pre-recorded target game, and the audio trigger information includes the recording time of the target audio and the playback information of at least one audio event; the playback information of the audio event includes the sound object corresponding to the audio event, the playback time of the sound object and the audio engine interface information called by the sound object.
[0119] The object creation module 41 is used to create a new sound object corresponding to the audio event at a predetermined position in the target game based on the playback information of at least one audio event.
[0120] The object sound module 42 is used to control the sound of a newly created sound object corresponding to at least one audio event based on the recording time of the audio trigger information, the playback time of the sound object corresponding to at least one audio event, and the audio engine interface information called by the sound object.
[0121] The audio playback device in the above-mentioned game does not directly record the audio signal, but records the playback information corresponding to the audio, thereby reducing the storage space occupied after the audio is recorded. Moreover, the audio playback environment when the audio was recorded can be truly restored by playing back the target audio through the audio trigger information, thereby making the player's experience of audio playback more realistic.
[0122] Furthermore, the above-mentioned playback information also includes at least one of the following information: volume setting information, position information of the sound object corresponding to the audio event, and reverberation effect setting information; wherein, the predetermined position of the newly created sound object established in the target game matches the position information of the sound object corresponding to the audio event; the volume of the sound emitted by the newly created sound object matches the volume setting information; and the predetermined position of the newly created sound object in the target game matches the reverberation effect setting information.
[0123] Furthermore, the above-mentioned object sound module 42 is used to: determine the recording start time corresponding to at least one audio event according to the recording time of the audio trigger information and the playback time of the sound object corresponding to at least one audio event; and control the newly created sound object corresponding to at least one audio event to call the audio engine interface information to make sound in sequence according to the order of the recording start time corresponding to at least one audio event.
[0124] In a specific implementation, the maximum number of sounds on the same newly created sound object is limited to a preset number threshold; the above-mentioned device also includes a number limitation module, which is used to: when the third audio event needs to be sounded through the newly created sound object, determine whether the current number of sounds on the newly created sound object has reached the preset number threshold; if the preset number threshold is not reached, play the third audio event through the newly created sound object; if the preset number threshold is reached, delete the audio event with the longest playing time on the newly created sound object, and play the third audio event through the newly created sound object.
[0125] The audio playback device in the game provided by the embodiment of the present disclosure has the same implementation principle and technical effects as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.
[0126] The present disclosure also provides an electronic device, such as Figure 5 As shown, the electronic device includes a processor and a memory, the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the above-mentioned audio processing method in the game and the audio playback method in the game.
[0127] Specifically, the audio processing method in the above-mentioned game includes: receiving a start recording instruction for the audio in the target game, and recording the playback information corresponding to at least one audio event played in the target game starting from the time when the start recording instruction is received; receiving an end recording instruction, and ending the recording of the playback information corresponding to at least one audio event played in the target game; wherein the playback information of the audio event includes the sound object corresponding to the audio event, the playback time of the sound object, and the audio engine interface information called by the sound object; based on the recorded playback information corresponding to the at least one audio event played in the target game, generating audio trigger information corresponding to the target audio; wherein the target audio includes: at least one audio event played in the target game during the time period from the receipt of the start recording instruction to the receipt of the end recording instruction; the audio trigger information includes the recording time of the target audio, and the playback information of at least one audio event; saving the audio trigger information to a specified file so that when a playback instruction for the target audio is received, the target audio is played based on the audio trigger information.
[0128] In an optional embodiment, the step of generating audio trigger information corresponding to the target audio based on the playback information corresponding to at least one audio event played in the target game includes: generating a time code according to the recording time of the target audio and the playback time of at least one audio event played in the target game; combining the time code with the sound object corresponding to at least one audio event played in the target game corresponding to the time code and the audio engine interface information called by the sound object into a target character string, and determining the target character string as the audio trigger information.
[0129] In an optional embodiment, the above-mentioned playback information also includes at least one of the following information: volume setting information, position information of the sound object corresponding to the audio event, and reverberation effect setting information.
[0130] In an optional embodiment, the above method also includes: receiving a recording instruction for external input audio from the target game, obtaining the external input audio based on a preset plug-in, and converting the external input audio into a specified format and storing it in a preset audio file.
[0131] In an optional embodiment, the above-mentioned step of converting the external input audio into a specified format and storing it in a preset audio file includes: performing format conversion processing on the external input audio to obtain an audio signal in a specified format; creating a new audio file to obtain a preset audio file, and storing the audio signal in the specified format into the preset audio file; wherein the preset audio file is named based on the start recording time and / or end recording time of the external input audio.
[0132] In an optional embodiment, the above method further includes: receiving an audio playback instruction for a preset audio file, acquiring or downloading the preset audio file, and playing the audio in the preset audio file.
[0133] In an optional embodiment, the recording time of the audio trigger information corresponding to the target audio includes the recording start time, and the preset audio file stores the recording start time. The above method also includes: receiving a mixed playback instruction, determining a preset audio file corresponding to the recording start time that is the same as the recording start time of the audio trigger information, and playing the audio in the preset audio file while playing the target audio based on the audio trigger information.
[0134] In an optional embodiment, the above method also includes: obtaining a target task type corresponding to the target game task, and based on the target task type, matching the audio in a preset audio file with the target game task to obtain a matching result.
[0135] In an optional embodiment, the above method also includes: submitting audio trigger information corresponding to the target audio, searching for first playback information corresponding to the first audio event required for the specified game task in the audio trigger information; if the first playback information is found in the audio trigger information, it is determined that the specified game task is completed.
[0136] In an optional embodiment, the recording time of the above-mentioned audio trigger information includes the recording start time of the target audio; after the step of searching the audio trigger information for the first playback information corresponding to the first audio event required for the specified game task, the above-mentioned method also includes: determining the recording start time and the recording end time of the first audio event in the audio trigger information based on the playback time contained in the first playback information and the recording start time of the target audio; determining the time difference between the recording start time and the recording end time corresponding to the first audio event in the audio trigger information; determining whether the time difference is the same as the total duration of the first audio event required for the specified game task, and if the same, determining that the specified game task is completed.
[0137] In an optional embodiment, the above method also includes: determining the start recording time and end recording time corresponding to at least one audio event based on the recording time of the target audio and the playback time of at least one audio event played in the recorded target game; based on the start recording time and end recording time corresponding to the at least one audio event, cropping the target audio to obtain audio trigger information corresponding to the cropped target audio.
[0138] In an optional embodiment, the above method also includes: based on the start recording time and end recording time corresponding to the audio event in the audio trigger information corresponding to the target audio, splicing the audio trigger information corresponding to the specified audio to obtain the audio trigger information corresponding to the spliced audio, so as to play the spliced audio through the audio trigger information corresponding to the spliced audio.
[0139] In an optional embodiment, the audio trigger information corresponding to the target audio includes: the recording time of the first part of the second audio event and the playback information of the second audio event; the audio trigger information corresponding to the specified audio includes: the recording time of the second part of the second audio and the playback information of the second audio event; wherein the first part and the second part of the second audio event constitute a complete second audio event; the above-mentioned step of splicing the start recording time and the end recording time corresponding to the audio event in the audio trigger information corresponding to the target audio with the audio trigger information corresponding to the specified audio to obtain the audio trigger information corresponding to the spliced audio includes: splicing the recording time of the first part of the second audio event in the audio trigger information corresponding to the target audio with the recording time of the second part of the second audio event in the audio trigger information corresponding to the specified audio to obtain the spliced recording time of the second audio event; determining the spliced recording time of the second audio event and the playback information of the second audio event as the audio trigger information corresponding to the spliced second audio event.
[0140] In an optional embodiment, the recording time of the second part of the second audio and the playback information of the second audio event are recorded in the following manner: when the second audio event in the target game has been played for a preset time, a start recording instruction for the second audio event is received, and an event identifier of the audio event being played on the sound-emitting object is obtained using a preset interface; the audio event currently being played is determined to be the second audio event through the event identifier, and the playback information of the second audio event is recorded; when the playback of the second audio event ends, the recording time of the second audio event is obtained through a preset callback function, and the recording time includes the time elapsed from the receipt of the start recording instruction to the end of the playback of the second audio event.
[0141] In an optional embodiment, after the step of determining the spliced recording time of the second audio event and the playback information of the second audio event as the audio trigger information corresponding to the spliced second audio event, the above method also includes: submitting the audio trigger information corresponding to the spliced second audio event; if the duration corresponding to the spliced recording time of the second audio event in the audio trigger information corresponding to the spliced second audio event is greater than the playback duration corresponding to the second audio event required for the first game task, it is determined that the first game task is completed.
[0142] The audio processing method in the above-mentioned game, when recording audio, does not directly record the audio but records the playback information corresponding to the audio, and plays back the audio through the playback information. Since the storage space occupied by the playback information is much smaller than that of the video file, this method reduces the storage space occupied after the audio is recorded.
[0143] In addition, the audio playback method in the above-mentioned game includes: receiving an audio playback request, and determining the audio trigger information of the target audio to be played based on the playback request; wherein the target audio includes at least one audio event played in a pre-recorded target game, and the audio trigger information includes the recording time of the target audio, and the playback information of at least one audio event; the playback information of the audio event includes the sound object corresponding to the audio event, the playback time of the sound object, and the audio engine interface information called by the sound object; based on the playback information of at least one audio event, establishing a new sound object corresponding to the audio event at a predetermined position in the target game; based on the recording time of the audio trigger information, the playback time of the sound object corresponding to the at least one audio event, and the audio engine interface information called by the sound object, controlling the new sound object corresponding to the at least one audio event to sound.
[0144] In an optional embodiment, the above-mentioned playback information also includes at least one of the following information: volume setting information, orientation information of the sound object corresponding to the audio event, and reverberation effect setting information; wherein, the predetermined position of the newly created sound object established in the target game matches the orientation information of the sound object corresponding to the audio event; the volume of the sound emitted by the newly created sound object matches the volume setting information; and the predetermined position of the newly created sound object in the target game matches the reverberation effect setting information.
[0145] In an optional embodiment, the step of controlling the sound of a newly created sound object corresponding to at least one audio event based on the recording time of the audio trigger information, the playback time of the sound object corresponding to at least one audio event, and the audio engine interface information called by the sound object includes: determining the recording start time corresponding to at least one audio event according to the recording time of the audio trigger information and the playback time of the sound object corresponding to at least one audio event; and controlling the newly created sound object corresponding to at least one audio event to call the audio engine interface information to make sound in the order of the recording start times corresponding to the at least one audio event.
[0146] In an optional embodiment, the maximum number of sounds on the same newly created sound object is limited to a preset number threshold; the above method also includes: when the third audio event needs to be sounded through the newly created sound object, determining whether the current number of sounds on the newly created sound object has reached the preset number threshold; if the preset number threshold is not reached, playing the third audio event through the newly created sound object; if the preset number threshold is reached, deleting the audio event with the longest playing time on the newly created sound object, and playing the third audio event through the newly created sound object.
[0147] The audio playback method in the above game does not directly record the audio signal, but records the playback information corresponding to the audio, thereby reducing the storage space occupied after the audio is recorded. In addition, the audio playback environment when the audio was recorded can be truly restored by playing back the target audio through the audio trigger information, thereby making the player's experience of audio playback more realistic.
[0148] Further, Figure 5 The electronic device shown further includes a bus 102 and a communication interface 103 , and the processor 101 , the communication interface 103 and the memory 100 are connected via the bus 102 .
[0149] The memory 100 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 103 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used. The bus 102 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0150] The processor 101 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 101. The above processor 101 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiments of the present disclosure can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present disclosure can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 100, and the processor 101 reads the information in the memory 100 and completes the steps of the method of the above embodiment in combination with its hardware.
[0151] The embodiment of the present disclosure also provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the above-mentioned audio processing method in the game and the audio playback method in the game.
[0152] Specifically, the audio processing method in the above-mentioned game includes: receiving a start recording instruction for the audio in the target game, and recording the playback information corresponding to at least one audio event played in the target game starting from the time when the start recording instruction is received; receiving an end recording instruction, and ending the recording of the playback information corresponding to at least one audio event played in the target game; wherein the playback information of the audio event includes the sound object corresponding to the audio event, the playback time of the sound object, and the audio engine interface information called by the sound object; based on the recorded playback information corresponding to the at least one audio event played in the target game, generating audio trigger information corresponding to the target audio; wherein the target audio includes: at least one audio event played in the target game during the time period from the receipt of the start recording instruction to the receipt of the end recording instruction; the audio trigger information includes the recording time of the target audio, and the playback information of at least one audio event; saving the audio trigger information to a specified file so that when a playback instruction for the target audio is received, the target audio is played based on the audio trigger information.
[0153] In an optional embodiment, the step of generating audio trigger information corresponding to the target audio based on the playback information corresponding to at least one audio event played in the target game includes: generating a time code according to the recording time of the target audio and the playback time of at least one audio event played in the target game; combining the time code with the sound object corresponding to at least one audio event played in the target game corresponding to the time code and the audio engine interface information called by the sound object into a target character string, and determining the target character string as the audio trigger information.
[0154] In an optional embodiment, the above-mentioned playback information also includes at least one of the following information: volume setting information, position information of the sound object corresponding to the audio event, and reverberation effect setting information.
[0155] In an optional embodiment, the above method also includes: receiving a recording instruction for external input audio from the target game, obtaining the external input audio based on a preset plug-in, and converting the external input audio into a specified format and storing it in a preset audio file.
[0156] In an optional embodiment, the above-mentioned step of converting the external input audio into a specified format and storing it in a preset audio file includes: performing format conversion processing on the external input audio to obtain an audio signal in a specified format; creating a new audio file to obtain a preset audio file, and storing the audio signal in the specified format into the preset audio file; wherein the preset audio file is named based on the start recording time and / or end recording time of the external input audio.
[0157] In an optional embodiment, the method further includes: receiving an audio playback instruction for a preset audio file, acquiring or downloading the preset audio file, and playing the audio in the preset audio file.
[0158] In an optional embodiment, the recording time of the audio trigger information corresponding to the target audio includes the recording start time, and the preset audio file stores the recording start time. The above method also includes: receiving a mixed playback instruction, determining a preset audio file corresponding to the recording start time that is the same as the recording start time of the audio trigger information, and playing the audio in the preset audio file while playing the target audio based on the audio trigger information.
[0159] In an optional embodiment, the above method also includes: obtaining a target task type corresponding to the target game task, and based on the target task type, matching the audio in a preset audio file with the target game task to obtain a matching result.
[0160] In an optional embodiment, the above method also includes: submitting audio trigger information corresponding to the target audio, searching for first playback information corresponding to the first audio event required for the specified game task in the audio trigger information; if the first playback information is found in the audio trigger information, it is determined that the specified game task is completed.
[0161] In an optional embodiment, the recording time of the above-mentioned audio trigger information includes the recording start time of the target audio; after the step of searching the audio trigger information for the first playback information corresponding to the first audio event required for the specified game task, the above-mentioned method also includes: determining the recording start time and the recording end time of the first audio event in the audio trigger information based on the playback time contained in the first playback information and the recording start time of the target audio; determining the time difference between the recording start time and the recording end time corresponding to the first audio event in the audio trigger information; determining whether the time difference is the same as the total duration of the first audio event required for the specified game task, and if the same, determining that the specified game task is completed.
[0162] In an optional embodiment, the above method also includes: determining the start recording time and end recording time corresponding to at least one audio event based on the recording time of the target audio and the playback time of at least one audio event played in the recorded target game; based on the start recording time and end recording time corresponding to the at least one audio event, cropping the target audio to obtain audio trigger information corresponding to the cropped target audio.
[0163] In an optional embodiment, the above method also includes: based on the start recording time and end recording time corresponding to the audio event in the audio trigger information corresponding to the target audio, splicing the audio trigger information corresponding to the specified audio to obtain the audio trigger information corresponding to the spliced audio, so as to play the spliced audio through the audio trigger information corresponding to the spliced audio.
[0164] In an optional embodiment, the audio trigger information corresponding to the target audio includes: the recording time of the first part of the second audio event and the playback information of the second audio event; the audio trigger information corresponding to the specified audio includes: the recording time of the second part of the second audio and the playback information of the second audio event; wherein the first part and the second part of the second audio event constitute a complete second audio event; the above-mentioned step of splicing the start recording time and the end recording time corresponding to the audio event in the audio trigger information corresponding to the target audio with the audio trigger information corresponding to the specified audio to obtain the audio trigger information corresponding to the spliced audio includes: splicing the recording time of the first part of the second audio event in the audio trigger information corresponding to the target audio with the recording time of the second part of the second audio event in the audio trigger information corresponding to the specified audio to obtain the spliced recording time of the second audio event; determining the spliced recording time of the second audio event and the playback information of the second audio event as the audio trigger information corresponding to the spliced second audio event.
[0165] In an optional embodiment, the recording time of the second part of the second audio and the playback information of the second audio event are recorded in the following manner: when the second audio event in the target game has been played for a preset time, a start recording instruction for the second audio event is received, and an event identifier of the audio event being played on the sound-emitting object is obtained using a preset interface; the audio event currently being played is determined to be the second audio event through the event identifier, and the playback information of the second audio event is recorded; when the playback of the second audio event ends, the recording time of the second audio event is obtained through a preset callback function, and the recording time includes the time elapsed from the receipt of the start recording instruction to the end of the playback of the second audio event.
[0166] In an optional embodiment, after the step of determining the spliced recording time of the second audio event and the playback information of the second audio event as the audio trigger information corresponding to the spliced second audio event, the above method also includes: submitting the audio trigger information corresponding to the spliced second audio event; if the duration corresponding to the spliced recording time of the second audio event in the audio trigger information corresponding to the spliced second audio event is greater than the playback duration corresponding to the second audio event required for the first game task, it is determined that the first game task is completed.
[0167] The audio processing method in the above-mentioned game, when recording audio, does not directly record the audio but records the playback information corresponding to the audio, and plays back the audio through the playback information. Since the storage space occupied by the playback information is much smaller than that of the video file, this method reduces the storage space occupied after the audio is recorded.
[0168] In addition, the audio playback method in the above-mentioned game includes: receiving an audio playback request, and determining the audio trigger information of the target audio to be played based on the playback request; wherein the target audio includes at least one audio event played in a pre-recorded target game, and the audio trigger information includes the recording time of the target audio, and the playback information of at least one audio event; the playback information of the audio event includes the sound object corresponding to the audio event, the playback time of the sound object, and the audio engine interface information called by the sound object; based on the playback information of at least one audio event, establishing a new sound object corresponding to the audio event at a predetermined position in the target game; based on the recording time of the audio trigger information, the playback time of the sound object corresponding to the at least one audio event, and the audio engine interface information called by the sound object, controlling the new sound object corresponding to the at least one audio event to sound.
[0169] In an optional embodiment, the above-mentioned playback information also includes at least one of the following information: volume setting information, orientation information of the sound object corresponding to the audio event, and reverberation effect setting information; wherein, the predetermined position of the newly created sound object established in the target game matches the orientation information of the sound object corresponding to the audio event; the volume of the sound emitted by the newly created sound object matches the volume setting information; and the predetermined position of the newly created sound object in the target game matches the reverberation effect setting information.
[0170] In an optional embodiment, the step of controlling the sound of a newly created sound object corresponding to at least one audio event based on the recording time of the audio trigger information, the playback time of the sound object corresponding to at least one audio event, and the audio engine interface information called by the sound object includes: determining the recording start time corresponding to at least one audio event according to the recording time of the audio trigger information and the playback time of the sound object corresponding to at least one audio event; and controlling the newly created sound object corresponding to at least one audio event to call the audio engine interface information to make sound in the order of the recording start times corresponding to the at least one audio event.
[0171] In an optional embodiment, the maximum number of sounds on the same newly created sound object is limited to a preset number threshold; the above method also includes: when the third audio event needs to be sounded through the newly created sound object, determining whether the current number of sounds on the newly created sound object has reached the preset number threshold; if the preset number threshold is not reached, playing the third audio event through the newly created sound object; if the preset number threshold is reached, deleting the audio event with the longest playing time on the newly created sound object, and playing the third audio event through the newly created sound object.
[0172] The audio playback method in the above game does not directly record the audio signal, but records the playback information corresponding to the audio, thereby reducing the storage space occupied after the audio is recorded. In addition, the audio playback environment when the audio was recorded can be truly restored by playing back the target audio through the audio trigger information, thereby making the player's experience of audio playback more realistic.
[0173] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a terminal device, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0174] In the description of the present disclosure, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present disclosure and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present disclosure. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0175] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A method for processing audio in a game, characterized in that: The method comprises: Receive a start recording instruction for the audio in the target game, and record the playback information corresponding to at least one audio event played in the target game starting from the time when the start recording instruction is received; receive an end recording instruction, and end recording the playback information corresponding to at least one audio event played in the target game; wherein the playback information of the audio event includes the sound object corresponding to the audio event, the playback time of the sound object, and the audio engine interface information called by the sound object; Based on the recorded playback information corresponding to at least one audio event played in the target game, generate audio trigger information corresponding to the target audio; wherein the target audio includes: the at least one audio event played in the target game during the time period from receiving the start recording instruction to receiving the end recording instruction; the audio trigger information includes the recording time of the target audio and the playback information of the at least one audio event; The audio trigger information is saved to a designated file so that when a playback instruction for the target audio is received, the target audio is played based on the audio trigger information.
2. The method according to claim 1, characterized in that The step of generating audio trigger information corresponding to the target audio based on the recorded playback information corresponding to at least one audio event played in the target game comprises: generating a time code according to a recording time of the target audio and a recorded playing time of at least one audio event played in the target game; The time code, the sound object corresponding to at least one audio event played in the target game corresponding to the time code, and the audio engine interface information called by the sound object are combined into a target character string, and the target character string is determined as audio trigger information.
3. The method according to claim 1, characterized in that The playback information further includes at least one of the following information: volume setting information, position information of the sound object corresponding to the audio event, and reverberation effect setting information.
4. The method according to claim 1, characterized in that: The method further comprises: A recording instruction for external input audio from the target game is received, the external input audio is acquired based on a preset plug-in, and the external input audio is converted into a specified format and stored in a preset audio file.
5. The method according to claim 4, characterized in that The step of converting the external input audio into a specified format and storing it in a preset audio file comprises: Performing format conversion processing on the external input audio to obtain an audio signal in a specified format; A new audio file is created to obtain a preset audio file, and the audio signal in the specified format is stored in the preset audio file; wherein the preset audio file is named based on the start recording time and / or end recording time of the external input audio.
6. The method according to claim 4, characterized in that The method further comprises: An audio playback instruction for the preset audio file is received, the preset audio file is acquired or downloaded, and the audio in the preset audio file is played.
7. The method according to claim 4, characterized in that The recording time of the audio trigger information corresponding to the target audio includes a recording start time, the preset audio file stores a recording start time, and the method further includes: Upon receiving a mixed playback instruction, a preset audio file corresponding to the start recording time that is the same as the recording start time of the audio trigger information is determined, and while playing the target audio based on the audio trigger information, the audio in the preset audio file is played.
8. The method according to claim 4, characterized in that The method further comprises: A target task type corresponding to a target game task is obtained, and based on the target task type, the audio in the preset audio file is matched with the target game task to obtain a matching result.
9. The method according to claim 1, characterized in that: The method further comprises: Submitting audio trigger information corresponding to the target audio, and searching the audio trigger information for first playback information corresponding to a first audio event required for a specified game task; If the first playing information is found in the audio triggering information, it is determined that the designated game task is completed.
10. The method according to claim 9, characterized in that The recording time of the audio trigger information includes the recording start time of the target audio; After the step of searching the audio trigger information for first playback information corresponding to the first audio event required for the specified game task, the method further includes: Determine the recording start time and the recording end time of the first audio event in the audio trigger information based on the playback time included in the first playback information and the recording start time of the target audio; Determine a time difference between a recording start time and a recording end time corresponding to the first audio event in the audio trigger information; Determine whether the time difference is the same as the total duration of the first audio event required for the designated game task, and if they are the same, determine that the designated game task is completed.
11. The method according to claim 1, characterized in that: The method further comprises: Determine the start recording time and the end recording time corresponding to the at least one audio event according to the recording time of the target audio and the recorded playing time of the at least one audio event played in the target game; Based on the recording start time and the recording end time corresponding to the at least one audio event, the target audio is cropped to obtain audio trigger information corresponding to the cropped target audio.
12. The method according to claim 11, characterized in that The method further comprises: Based on the start recording time and the end recording time corresponding to the audio event in the audio trigger information corresponding to the target audio, splicing is performed with the audio trigger information corresponding to the specified audio to obtain the audio trigger information corresponding to the spliced audio, so as to play the spliced audio through the audio trigger information corresponding to the spliced audio.
13. The method according to claim 12, characterized in that The audio trigger information corresponding to the target audio includes: the recording time of the first part of the second audio event and the playback information of the second audio event; the audio trigger information corresponding to the specified audio includes: the recording time of the second part of the second audio and the playback information of the second audio event; wherein the first part and the second part of the second audio event constitute a complete second audio event; The step of performing splicing processing on the start recording time and the end recording time corresponding to the audio event in the audio trigger information corresponding to the target audio and the audio trigger information corresponding to the specified audio to obtain the audio trigger information corresponding to the spliced audio includes: splicing the recording time of the first part of the second audio event in the audio trigger information corresponding to the target audio with the recording time of the second part of the second audio event in the audio trigger information corresponding to the specified audio to obtain the spliced recording time of the second audio event; The spliced recording time of the second audio event and the play information of the second audio event are determined as audio trigger information corresponding to the spliced second audio event.
14. The method according to claim 13, characterized in that The recording time of the second part of the second audio and the playing information of the second audio event are recorded in the following manner: When the second audio event in the target game has been played for a preset time, receiving a start recording instruction for the second audio event, and using a preset interface to obtain an event identifier of the audio event being played on the sound object; Determining that the currently played audio event is a second audio event through the event identifier, and recording the play information of the second audio event; When the playing of the second audio event ends, the recording time of the second audio event is obtained through a preset callback function, where the recording time includes the time from receiving the start recording instruction to the end of the playing of the second audio event.
15. The method according to claim 13, characterized in that After the step of determining the spliced recording time of the second audio event and the playback information of the second audio event as the audio trigger information corresponding to the spliced second audio event, the method further includes: Submitting audio trigger information corresponding to the spliced second audio event; If the duration corresponding to the spliced recording time of the second audio event in the audio trigger information corresponding to the spliced second audio event is greater than the playback duration corresponding to the second audio event required by the first game task, it is determined that the first game task is completed.
16. A method for audio playback in a game, characterized in that: The method comprises: Receive an audio playback request, and determine audio trigger information of a target audio to be played based on the playback request; wherein the target audio includes at least one pre-recorded audio event played in a target game, and the audio trigger information includes the recording time of the target audio and the playback information of the at least one audio event; the playback information of the audio event includes the sound object corresponding to the audio event, the playback time of the sound object, and the audio engine interface information called by the sound object; Based on the playback information of the at least one audio event, establishing a new sound object corresponding to the audio event at a predetermined position in the target game; Based on the recording time of the audio trigger information, the playing time of the sound object corresponding to the at least one audio event and the audio engine interface information called by the sound object, the newly created sound object corresponding to the at least one audio event is controlled to make sound.
17. The method according to claim 16, characterized in that The playback information also includes at least one of the following information: volume setting information, position information of the sound object corresponding to the audio event, and reverberation effect setting information; wherein the predetermined position of the newly created sound object established in the target game matches the position information of the sound object corresponding to the audio event; the volume of the sound emitted by the newly created sound object matches the volume setting information; and the predetermined position of the newly created sound object in the target game matches the reverberation effect setting information.
18. The method according to claim 16, characterized in that The step of controlling the newly created sound object corresponding to the at least one audio event to make a sound based on the recording time of the audio trigger information, the playing time of the sound object corresponding to the at least one audio event, and the audio engine interface information called by the sound object comprises: Determine a recording start time corresponding to the at least one audio event according to the recording time of the audio trigger information and the playing time of the sound object corresponding to the at least one audio event; According to the sequence of the recording start time corresponding to the at least one audio event, the newly created sound object corresponding to the at least one audio event is controlled in sequence to call the audio engine interface information to make sound.
19. The method according to claim 16, characterized in that Limiting the maximum number of sounds on the same newly created sound object to a preset number threshold; the method further includes: When the third audio event needs to be sounded through the newly created sound-emitting object, determining whether the current number of sounds on the newly created sound-emitting object reaches the preset number threshold; If the preset number threshold is not reached, playing the third audio event through the newly created sound object; If the preset number threshold is reached, the audio event with the longest playing time on the newly created sound object is deleted, and the third audio event is played through the newly created sound object.
20. An audio processing device in a game, characterized in that: The device comprises: An audio recording module, configured to receive a start recording instruction for audio in a target game, and record the playback information corresponding to at least one audio event played in the target game starting from the time when the start recording instruction is received; and receive an end recording instruction to end recording the playback information corresponding to at least one audio event played in the target game; wherein the playback information of the audio event includes the sound object corresponding to the audio event, the playback time of the sound object, and the audio engine interface information called by the sound object; An information generation module, configured to generate audio trigger information corresponding to a target audio based on the recorded playback information corresponding to at least one audio event played in the target game; wherein the target audio includes: the at least one audio event played in the target game during a period from when the start recording instruction is received to when the end recording instruction is received; the audio trigger information includes the recording time of the target audio and the playback information of the at least one audio event; The information saving module is used to save the audio trigger information to a specified file so that when a playback instruction for the target audio is received, the target audio is played based on the audio trigger information.
21. An audio playback device in a game, characterized in that: The device comprises: A playback request receiving module, used to receive an audio playback request, and determine audio trigger information of a target audio to be played based on the playback request; wherein the target audio includes at least one audio event played in a pre-recorded target game, and the audio trigger information includes the recording time of the target audio and the playback information of the at least one audio event; the playback information of the audio event includes the sound object corresponding to the audio event, the playback time of the sound object, and the audio engine interface information called by the sound object; An object creation module, configured to create a new sound object corresponding to the audio event at a predetermined position in the target game based on the playback information of the at least one audio event; The object sound module is used to control the sound of a newly created sound object corresponding to the at least one audio event based on the recording time of the audio trigger information, the playback time of the sound object corresponding to the at least one audio event, and the audio engine interface information called by the sound object.
22. An electronic device, characterized in that: The electronic device includes a processor and a memory, the memory storing machine executable instructions that can be executed by the processor, and the processor executing the machine executable instructions to implement the audio processing method in the game described in any one of claims 1 to 15 and the audio playback method in the game described in any one of claims 16-19.
23. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by the processor, the computer-executable instructions prompt the processor to implement the audio processing method in the game described in any one of claims 1 to 15 and the audio playback method in the game described in any one of claims 16-19.
