Method, device, storage medium and electronic device for playing music resources
By synchronously performing actions in response to multiple virtual characters in the game and adjusting music events to play multiple sound parts simultaneously, the problem of single sound effects in the existing technology is solved, and the richness of game sound effects and player experience is improved.
Patent Information
- Application Number
- CN202210364862.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-08
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2042-04-08
AI Technical Summary
The existing game sound effects playback logic is single and the sound effects are rich, resulting in poor player gaming experience and no effective solution.
By synchronously executing target game actions in response to multiple virtual characters in the graphical user interface, music events are determined to adjust the playback status of multiple voice parts, synchronous playback of multiple voice parts music resources, and music segments in the preset audio engine Segment function components and status groups manage the on and off of tracks.
The music playback logic in the game is optimized, the richness of the game sound effects and player experience are improved, the needs of multiple players' ensembles are met, and the fun of the game mechanism is increased.
Smart Images

Figure CN114653063B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, device, storage medium and electronic device for playing music resources. Background Art
[0002] In game development, sound effects are one of the important parts that directly affect the player's gaming experience. The design of sound effects usually includes: the production and editing of original music materials and the design of music combination playback effects. In this regard, technicians in this field continue to try various design methods for game sound effects.
[0003] In related solutions, the game sound effects are usually played according to the actions of the virtual characters in the game or the special effects played in the game scenes. For example, when the game player controls the virtual character to return to the city, the pre-made return sound effect is played. Another example is that when the game player's operation triggers the "Happy Holidays" special effect, the pre-made sound effect corresponding to the special effect is played. However, the defects of this method are: the playback logic is single, the sound effect performance is low in richness, and the player's gaming experience is poor.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present invention provide a method, device, storage medium and electronic device for playing music resources, so as to at least solve the technical problems in the related art of the processing method for playing sound effects according to the actions or special effects of a single character, which has low richness of sound effect performance and poor player gaming experience.
[0006] According to one aspect of an embodiment of the present invention, a method for playing music resources is provided, wherein a graphical user interface is provided through a first terminal device, the content displayed by the graphical user interface at least partially includes a game scene, the content displayed by the game scene at least partially includes a first virtual character controlled by the first terminal device and at least one second virtual character controlled by at least one second terminal device, the method comprising: in response to the first virtual character and at least one second virtual character synchronously executing a target game action, determining a first music event corresponding to the first virtual character, wherein the first music event is used to trigger adjusting the playback state of a first music resource of multiple parts associated with the first virtual character to an on state; based on the first music event, synchronously playing the first music resource of multiple parts.
[0007] Optionally, in the above method for playing music resources: the first music resources of multiple parts have the same music playing attribute.
[0008] Optionally, in the above method for playing music resources: the first music resources of multiple parts are encapsulated by a music segmentation function component set in a preset audio engine, and the first music resource of each part of the first music resources of multiple parts is encapsulated into an independent switching audio track.
[0009] Optionally, in the above-mentioned method for playing music resources: the first music resource of each part of the first music resources of multiple parts corresponds to an independent state group, wherein the state group is provided with a first state and a second state, the first state is used to control the switching audio track corresponding to the first music resource of each part to be in an on state, and the second state is used to control the switching audio track corresponding to the first music resource of each part to be in a off state.
[0010] Optionally, in the above-mentioned method for playing music resources: a first music resource of multiple parts and a second music resource of multiple parts associated with at least one second virtual character are respectively set on different music output buses, wherein the volume of the music output bus corresponding to the first virtual character suppresses the volume of the music output bus corresponding to at least one second virtual character.
[0011] Optionally, based on the first music event, synchronously playing the first music resource of multiple parts includes: based on the first music event, setting the playing state of the first music resource of multiple parts to a first state to synchronously play the first music resource of multiple parts.
[0012] Optionally, the above method for playing music resources also includes: in response to the first virtual character terminating the execution of the target game action, determining a second music event corresponding to the first virtual character, wherein the second music event is used to trigger adjusting the playback state of the first music resource of multiple parts associated with the first virtual character to an off state; based on the second music event, setting the playback state of the first music resource of multiple parts to a second state to stop playing the first music resource of multiple parts.
[0013] According to another aspect of an embodiment of the present invention, there is also provided an apparatus for playing music resources, wherein a graphical user interface is provided through a first terminal device, the content displayed by the graphical user interface at least partially includes a game scene, the content displayed by the game scene at least partially includes a first virtual character controlled by the first terminal device and at least one second virtual character controlled by at least one second terminal device, the apparatus comprising: a determination module for determining a first music event corresponding to the first virtual character in response to the first virtual character and at least one second virtual character synchronously executing a target game action, wherein the first music event is used to trigger adjusting the playback state of a first music resource of multiple parts associated with the first virtual character to an on state; and a playback module for synchronously playing the first music resource of multiple parts based on the first music event.
[0014] Optionally, in the above-mentioned device for playing music resources: the first music resources of multiple parts have the same music playing attribute.
[0015] Optionally, in the above-mentioned device for playing music resources: the first music resources of multiple parts are encapsulated by a music segmentation function component set in a preset audio engine, and the first music resource of each part of the first music resources of multiple parts is encapsulated into an independent switching audio track.
[0016] Optionally, in the above-mentioned device for playing music resources: the first music resource of each part of the first music resources of multiple parts corresponds to an independent state group, wherein the state group is provided with a first state and a second state, the first state is used to control the switching audio track corresponding to the first music resource of each part to be in an on state, and the second state is used to control the switching audio track corresponding to the first music resource of each part to be in a off state.
[0017] Optionally, in the above-mentioned device for playing music resources: a first music resource of multiple parts and a second music resource of multiple parts associated with at least one second virtual character are respectively set on different music output buses, wherein the volume of the music output bus corresponding to the first virtual character suppresses the volume of the music output bus corresponding to at least one second virtual character.
[0018] Optionally, the above-mentioned playing module is also used to: based on the first music event, set the playing state of the first music resource of multiple parts to the first state, so as to synchronously play the first music resource of multiple parts.
[0019] Optionally, the above-mentioned device for playing music resources also includes: a termination module, which is used to determine a second music event corresponding to the first virtual character in response to the first virtual character terminating the execution of the target game action, wherein the second music event is used to trigger the adjustment of the playback state of the first music resource of multiple parts associated with the first virtual character to an off state; based on the second music event, the playback state of the first music resource of multiple parts is set to a second state to stop playing the first music resource of multiple parts.
[0020] According to another aspect of an embodiment of the present invention, a non-volatile storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute any of the above methods for playing music resources when running.
[0021] According to another aspect of an embodiment of the present invention, an electronic device is provided, including: a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute any one of the above methods for playing music resources.
[0022] In at least some embodiments of the present invention, a method is adopted in which a first music event corresponding to the first virtual character is determined in response to a first virtual character and at least one second virtual character synchronously executing a target game action, wherein the first music event is used to trigger the adjustment of the playback state of a first music resource of multiple parts associated with the first virtual character to an on state, and by synchronously playing the first music resources of multiple parts based on the first music event, the purpose of combined playback of multiple music resources of multiple parts based on the game actions executed by multiple virtual characters is achieved, thereby achieving the technical effect of optimizing the music playback logic in the game and thereby improving the richness of game sound effects and the player's gaming experience, thereby solving the technical problem in the related art of the processing method of playing sound effects according to the actions or special effects of a single character, which has low richness of sound effect performance and poor player gaming experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0024] Figure 1 is a hardware structure block diagram of a mobile terminal for implementing a method for playing music resources according to an embodiment of the present invention;
[0025] Figure 2 is a flowchart of a method for playing music resources according to one embodiment of the present invention;
[0026] Figure 3 is a schematic diagram of a graphical user interface of an optional multi-player music ensemble game scene according to an embodiment of the present invention;
[0027] Figure 4 is a structural block diagram of a device for playing music resources according to one embodiment of the present invention;
[0028] Figure 5 is a structural block diagram of another device for playing music resources according to one embodiment of the present invention;
[0029] Figure 6 is a structural block diagram of an electronic device according to one embodiment of the present invention. DETAILED DESCRIPTION
[0030] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0032] According to one embodiment of the present invention, an embodiment of a method for playing music resources is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0033] In one embodiment of the present invention, the method for playing music resources can be run on a terminal device or a server. The terminal device can be a local terminal device. When the method for playing music resources is run on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device.
[0034] In an optional implementation, various cloud applications can be run under the cloud interaction system, such as cloud games. Taking cloud games as an example, cloud games refer to a game method based on cloud computing. In the operation mode of cloud games, the operating body of the game program and the main body of the game screen presentation are separated. The storage and operation of the method of playing music resources are completed on the cloud game server. The role of the client device is used for receiving and sending data and presenting the game screen. For example, the client device can be a display device with data transmission function close to the user side, such as a mobile terminal, a TV, a computer, a handheld computer, etc.; but the terminal device for information processing is a cloud game server in the cloud. When playing the game, the player operates the client device to send an operation instruction to the cloud game server. The cloud game server runs the game according to the operation instruction, encodes and compresses the game screen and other data, and returns it to the client device through the network. Finally, the client device decodes and outputs the game screen.
[0035] In an optional embodiment, the terminal device may be a local terminal device. Taking a game as an example, the local terminal device stores a game program and is used to present a game screen. The local terminal device is used to interact with the player through a graphical user interface, that is, the game program is downloaded and installed by an electronic device and run conventionally. The local terminal device may provide the graphical user interface to the player in a variety of ways, for example, it may be rendered and displayed on a display screen of the terminal, or provided to the player through a holographic projection. For example, the local terminal device may include a display screen and a processor, the display screen is used to present a graphical user interface, the graphical user interface includes a game screen, and the processor is used to run the game, generate a graphical user interface, and control the display of the graphical user interface on the display screen.
[0036] In a possible implementation, an embodiment of the present invention provides a method for playing music resources, providing a graphical user interface through a terminal device, wherein the terminal device can be the local terminal device mentioned above, or can be a client device in the cloud interaction system mentioned above.
[0037] Taking a mobile terminal running in a local terminal device as an example, the mobile terminal can be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, referred to as MID), a PAD, a game console, and other terminal devices. Figure 1 1 is a hardware structure block diagram of a mobile terminal for implementing a method for playing music resources according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1Only one is shown in the figure) processor 102 (processor 102 may include but is not limited to a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processing (DSP) chip, a microprocessor (MCU), a programmable logic device (FPGA), a neural network processor (NPU), a tensor processor (TPU), an artificial intelligence (AI) type processor, etc.) and a memory 104 for storing data. Optionally, the mobile terminal may also include a transmission device 106 for communication functions, an input and output device 108, and a display device 110. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0038] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for playing music resources in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the method for playing music resources is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0039] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0040] The inputs in the input / output device 108 may come from a plurality of human interface devices (HIDs), such as keyboards and mice, game controllers, and other dedicated game controllers (such as steering wheels, fishing rods, dance mats, remote controls, etc.). In addition to providing input functions, some human interface devices may also provide output functions, such as force feedback and vibration of game controllers, audio output of controllers, etc.
[0041] The display device 110 may be, for example, a head-up display (HUD), a touch-screen liquid crystal display (LCD), and a touch display (also referred to as a "touch screen" or "touch display screen"). The liquid crystal display may enable a user to interact with a user interface of the mobile terminal. In some embodiments, the mobile terminal has a graphical user interface (GUI), and a user may interact with the GUI by finger contacts and / or gestures on a touch-sensitive surface, wherein the human-computer interaction functions here may optionally include the following interactions: creating web pages, drawing, word processing, making electronic documents, games, video conferencing, instant messaging, sending and receiving emails, call interfaces, playing digital videos, playing digital music, and / or web browsing, etc. The executable instructions for executing the above-mentioned human-computer interaction functions are configured / stored in a computer program product or a readable storage medium executable by one or more processors.
[0042] In this embodiment, a method for playing music resources running on the above mobile terminal is provided. Figure 2 is a flowchart of a method for playing music resources according to one embodiment of the present invention. Figure 2 As shown, a graphical user interface is provided by a first terminal device, the content displayed by the graphical user interface at least partially includes a game scene, and the content displayed by the game scene at least partially includes a first virtual character controlled by the first terminal device and at least one second virtual character controlled by at least one second terminal device. The method includes the following steps:
[0043] Step S21, in response to the first virtual character and at least one second virtual character synchronously executing the target game action, determining a first music event corresponding to the first virtual character, wherein the first music event is used to trigger adjusting the playing state of a first music resource of multiple parts associated with the first virtual character to an on state;
[0044] Optionally, the graphical user interface (GUI) provided by the first terminal device refers to an operation user interface displayed in a graphical manner. The GUI display can be used at least to display a game scene. The game scene may include a virtual game background, virtual game props, virtual operation buttons, virtual game characters, game special effects, etc.
[0045] Optionally, the virtual character may be a virtual game character in a game scene. The first virtual character may be a virtual game character controlled by the first terminal device. Each of the at least one second virtual character may be a virtual game character controlled by the second terminal device.
[0046] For example: in a multi-player music ensemble game scene, five players (respectively denoted as A1 to A5) form a game team Team 1 through a local area network, and the virtual game characters controlled by the five players are R1 to R5. For player A1, the first terminal device may be a local device used by player A1, and the second terminal device may be a non-local device used by other members of the game team Team 1 (including A2, A3, A4, and A5). The first virtual character may be the virtual game character R1 controlled by player A1, and the second virtual character may be the virtual game character (including R2, R3, R4, and R5) controlled by other members of the game team Team 1 (including A2, A3, A4, and A5).
[0047] Optionally, the target game action may be a game action that can be performed by each of the first virtual character and the at least one second virtual character in the game scene. For example: Figure 3 is a schematic diagram of a graphical user interface of an optional multi-player music ensemble game scene according to an embodiment of the present invention, such as Figure 3 As shown, the player can perform music playing actions through the "Play" button, and the player's music playing actions are used to play the music of the corresponding part of the player.
[0048] Optionally, the first music event can be used to trigger the adjustment of the play state of the first music resource of the multiple parts associated with the first virtual character to the on state. When it is monitored that the first virtual character and the at least one second virtual character synchronously perform the target game action, the first music event corresponding to the first virtual character can be determined. The first music resource can be a pre-made music material for ensemble. The first music resource of multiple parts can include: the music material of the part corresponding to the first virtual character, and the music material of at least one part corresponding to the at least one second virtual character.
[0049] Still like Figure 3As shown, when the five players in the game team Team1 (including A1, A2, A3, A4, A5) control the corresponding virtual game characters (including R1, R2, R3, R4, R5) in the same frame state (the distance between any two virtual game characters is less than 500 and all five virtual game characters are in the same screen display range) and press the "Play" button at the same time, the "Ensemble" Easter egg (equivalent to the above-mentioned first music event) is triggered. The "Ensemble" Easter egg is used to determine the simultaneous playback of the five music materials corresponding to the above-mentioned five virtual game characters (equivalent to the first music resources of the above-mentioned multiple parts).
[0050] It should be noted that, when the first virtual character and at least one second virtual character synchronously execute the target game action, the judgment condition for synchronous execution is: a time threshold is preset; among multiple virtual characters (including the first virtual character and at least one second virtual character), starting from the time when the first virtual character executes the target game action, if at least one remaining virtual character executes the target game action within the time threshold, then the multiple virtual characters are deemed to execute the target game action synchronously.
[0051] Step S22: based on the first music event, synchronously play the first music resource of multiple parts.
[0052] Optionally, the first music event can be used to trigger the adjustment of the play state of the first music resource of the multiple parts associated with the first virtual character to the on state. The first music resource can be a pre-made music material for ensemble. The first music resource of the multiple parts can include: the music material of the part corresponding to the first virtual character, and the music material of at least one part corresponding to the at least one second virtual character. Based on the first music event, the first music resource of the multiple parts is controlled to play synchronously.
[0053] For example: in a multi-player music ensemble game scenario, for game player A1, when the five virtual game characters (including R1, R2, R3, R4, and R5) in the game team Team1 trigger the "ensemble" easter egg (equivalent to the first music event mentioned above), the terminal used by the game player A1 will control the speaker to synchronously play the five music materials corresponding to the above five virtual game characters (equivalent to the first music resources of the above multiple parts).
[0054] It is easy to notice that, compared with the method provided by the related scheme, the method provided by the embodiment of the present invention improves the logic of music playback in the game, and can play multiple parts of music simultaneously according to the actions performed by multiple players, which can improve the richness of the game sound effects and the fun of the game mechanism, thereby improving the experience of game players.
[0055] In at least some embodiments of the present invention, a method is adopted in which a first music event corresponding to the first virtual character is determined in response to a first virtual character and at least one second virtual character synchronously executing a target game action, wherein the first music event is used to trigger the adjustment of the playback state of a first music resource of multiple parts associated with the first virtual character to an on state, and by synchronously playing the first music resources of multiple parts based on the first music event, the purpose of combined playback of multiple music resources of multiple parts based on the game actions executed by multiple virtual characters is achieved, thereby achieving the technical effect of optimizing the music playback logic in the game and thereby improving the richness of game sound effects and the player's gaming experience, thereby solving the technical problem in the related art of the processing method of playing sound effects according to the actions or special effects of a single character, which has low richness of sound effect performance and poor player gaming experience.
[0056] Optionally, the method for playing music resources may further include: the first music resources of multiple parts have the same music playing attribute.
[0057] Optionally, the first music resource may be a pre-made music material for ensemble. The first music resource of multiple parts may include: the music material of the part corresponding to the first virtual character, and the music material of at least one part corresponding to the at least one second virtual character. The first music resources of multiple parts have the same music playback attributes. The music playback attributes may include: playback duration, playback speed, playback pitch, playback effect, etc.
[0058] For example, for a multi-player music ensemble game scene, you can use a digital audio workstation (DAW) to create music with multiple parts in advance. Specifically, according to the music that needs to be played, create materials for five parts with the same playback time and speed, and export the materials for the five parts as: voice, piano, guitar, and bass.
[0059] Optionally, the above method for playing music resources may also include: the first music resources of multiple parts are encapsulated by a music segmentation function component set in a preset audio engine, and the first music resource of each part of the first music resources of the multiple parts is encapsulated into an independent switching audio track.
[0060] Optionally, the first music resources of the plurality of parts may be pre-made music materials for ensemble. The first music resource of each part of the plurality of first music resources is encapsulated into an independent switching track using the music segmentation function component set in the preset audio engine. Each independent switching track may be used to control whether the first music resource of the part corresponding to the switching track is played.
[0061] For example, for a multi-player music ensemble game scene, you can use the music segment component in the Wwise audio engine to encapsulate the five pre-made music resources (voice, piano, guitar, drum, and bass) into five corresponding switch tracks, namely: voice track_voice, piano track_piano, guitar track_guitar, drum track_drum, and bass track_bass.
[0062] Optionally, the above method for playing music resources may further include: the first music resource of each part of the first music resources of multiple parts corresponds to an independent state group, wherein the state group is provided with a first state and a second state, the first state is used to control the switching audio track corresponding to the first music resource of each part to be in an on state, and the second state is used to control the switching audio track corresponding to the first music resource of each part to be in a off state.
[0063] Optionally, the first music resources of the plurality of parts may be pre-made music materials for ensemble. The first music resource of each part of the plurality of first music resources of the parts is packaged into an independent switching audio track.
[0064] The first music resource of each part of the first music resources of the multiple parts corresponds to an independent state group. The state group may include a first state and a second state, wherein the first state can be used to control the switching track corresponding to the first music resource of each part to be in an on state, and the second state is used to control the switching track corresponding to the first music resource of each part to be in an off state.
[0065] For example, for a multi-player music ensemble game scene, the Wwise audio engine can be used to create five corresponding state groups for the five pre-made music resources (voice, piano, guitar, drum, and bass), namely: voice state group state_group_voice, piano state group state_group_piano, guitar state group state_group_voice, drum state group state_group_drum, and bass state group state_group_bass. Each of the five state groups includes two states, on and off, to control the switch state of the corresponding switching track (e.g., if the state of the piano state group state_group_piano is on, the piano track track_piano is turned on; if the state of the bass state group state_group_bass is off, the bass track track_bass is turned off).
[0066] Optionally, the event component event of the Wwise audio engine can be used to control the states (on or off) of the five state groups corresponding to the five music resources.
[0067] Optionally, since different virtual game characters may hear different sound effects when playing the same music in a game scene, it is necessary to produce different levels of sound effects for different characters through mixing when designing the game audio performance. For example: in a multi-player music ensemble game scene, for game player A1, when a game sound effect is detected to be played, it is necessary to determine whether the game sound effect belongs to a local character (here, the virtual game character R1, denoted as 1p) or a non-local character (which can refer to virtual game characters R2, R3, R4, R5, or other characters in the game scene, denoted as 3p), and then determine whether to play the pre-made 1p sound effect or 3p sound effect.
[0068] Optionally, the above method for playing music resources may also include: a first music resource with multiple parts and a second music resource with multiple parts associated with at least one second virtual character are respectively set on different music output buses, wherein the volume of the music output bus corresponding to the first virtual character suppresses the volume of the music output bus corresponding to at least one second virtual character.
[0069] Optionally, the first music resource of the above-mentioned multiple parts can be a pre-made music material for ensemble, and the first music resource can be a local sound effect of the first virtual character. The second music resource of the multiple parts associated with the above-mentioned at least one second virtual character can be a non-local sound effect of at least one second virtual character. The first music resource of the multiple parts and the second music resource of the multiple parts associated with the at least one second virtual character are respectively set on different music output buses. The volume of the music output bus corresponding to the first virtual character suppresses the volume of the music output bus corresponding to the at least one second virtual character. When the local sound effect of the first virtual character is turned on, the volume of the non-local sound effect is set to 0.
[0070] For example, in a multi-player music ensemble game scene, the music materials of the five voice parts are respectively associated with the five virtual game characters in the game team Team1: virtual game character R1 is associated with the voice part voice performance, virtual game character R2 is associated with the piano part piano performance, virtual game character R3 is associated with the guitar part guitar performance, virtual game character R4 is associated with the drum part drum performance, and virtual game character R5 is associated with the bass part bass performance. Pre-produce local 1p sound effects (equivalent to the above-mentioned first music resource) and non-local 3p sound effects (second music resource).
[0071] Taking the production of local 1p sound effects and non-local 3p sound effects for the virtual game character R1 as an example, the local 1p sound effect is the ensemble sound effect Audio1 of the above five parts, and the non-local 3p sound effect is the four-part sound effects associated with the other four virtual game characters in the game team Team1 (including piano part piano, guitar part guitar, drum part drum, bass part bass).
[0072] In the multi-player music ensemble game scene, for the virtual game character R1, if the state of the music output bus corresponding to the local 1p sound effect is on, then on the terminal used by player A1, the local 1p sound effect corresponding to the virtual game character R1 plays normally, and the volume of the non-local 3p sound effect corresponding to the virtual game character R1 is 0. At this time, player A1 can hear the ensemble music Audio1 of the above 5 parts but cannot hear the 4 parts sound effects associated with the other 4 players.
[0073] Optionally, in step S22, based on the first music event, synchronously playing the first music resource of multiple parts may include the following execution steps:
[0074] Step S221, based on the first music event, setting the playing state of the first music resource of multiple parts to the first state, so as to synchronously play the first music resource of multiple parts.
[0075] Optionally, the first music event can be used to trigger the adjustment of the play state of the first music resource of the multiple voice parts associated with the first virtual character to an on state. The first music resource can be a pre-made music material for ensemble. When the first music event of the first virtual character is determined, based on the first music event, the play state of the first music resource of the multiple voice parts is set to a first state, and the first state is used to control the synchronous play of the first music resource of the multiple voice parts.
[0076] In the corresponding multi-player music ensemble game scene, the five voice-part materials are respectively associated with five virtual game characters (including R1, R2, R3, R4, and R5) in the game team Team 1.
[0077] For example: in a multi-player music ensemble game scene, when the five players in the game team Team1 (including A1, A2, A3, A4, A5) control the corresponding virtual game characters (including R1, R2, R3, R4, R5) in the same frame state (the distance between any two virtual game characters is less than 500 and all five virtual game characters are within the same screen display range) and press the "Play" button at the same time, the "Ensemble" easter egg (equivalent to the first music event mentioned above) is triggered. At this time, the state groups of the five parts corresponding to the game team Team1 are all set to on, and the switching tracks of the five parts are all in the on state. At this time, the terminals used by each of the five players in the game team play the ensemble music of the five parts.
[0078] It should be noted that the judgment condition for 5 players to press the "Play" button at the same time is: a preset time threshold; among the 5 players, starting from the first player pressing the "Play" button, if the other 4 players press the "Play" button within the time threshold, it is deemed that the 5 players press the "Play" button at the same time.
[0079] It should be noted that in the multi-player music ensemble game scene, when the five virtual game characters in the game team Team1 are not in the same frame or the five players do not press the "Play" button at the same time, the "Ensemble" Easter Egg (equivalent to the first music event mentioned above) cannot be triggered. For example: in the game team Team1, only three players (including A2, A3, and A4) control the corresponding virtual game characters to be in the same frame and press the "Play" button at the same time, then the terminal used by each of the three players only plays the sound effects associated with the player: the terminal used by player A2 plays the piano part piano, the terminal used by player A3 plays the guitar part guitar, and the terminal used by player A4 plays the drum part drum.
[0080] Optionally, the method for playing music resources may further include the following execution steps:
[0081] Step S23, in response to the first virtual character terminating the execution of the target game action, determining a second music event corresponding to the first virtual character, wherein the second music event is used to trigger adjusting the playing state of the first music resource of the multiple parts associated with the first virtual character to an off state;
[0082] Step S24: based on the second music event, the playing state of the first music resource of the multiple parts is set to the second state to stop playing the first music resource of the multiple parts.
[0083] Optionally, the first virtual character may be a virtual game character controlled by the first terminal device. The target game action may be a game action that can be performed by each of the first virtual character and the at least one second virtual character in the game scene. The second music event may be used to trigger the adjustment of the play state of the first music resource of the multiple voice parts associated with the first virtual character to an off state. When it is detected that the first virtual character terminates the execution of the target game action, the second music event corresponding to the first virtual character may be determined. Based on the second music event, the play state of the first music resource of the multiple voice parts is set to a second state, and the second state is used to control the first music resource of the multiple voice parts to stop playing.
[0084] For example, in a multi-player music ensemble game scene, the five players in the game team Team1 trigger the "Ensemble" easter egg (equivalent to the first music event mentioned above), and the corresponding terminals play the ensemble music of the five parts. At this time, if the local player A1 terminates the ensemble (it can be by releasing the "Ensemble" button or pressing the "Exit Ensemble" button), the state groups of the five parts corresponding to the game team Team1 are all set to off, the switching tracks of the five parts are all in the off state, and the terminals used by each of the five players in the game team stop playing the ensemble music of the five parts.
[0085] It is easy to notice that in the method provided in the related scheme, the audio is played through the action or special effects of a single character, the richness of the game sound effects is low, and it is difficult to achieve the aligned playback of music of different parts, which cannot meet the needs of multiple players' ensemble. Through the method provided in the embodiment of the present invention, the opening and closing states of the corresponding audio tracks in the audio engine can be controlled based on the behaviors of multiple players in the game or the actions of multiple virtual game characters, thereby realizing multi-track music combination performance. According to the method provided in the embodiment of the present invention, the difficulty of triggering game easter eggs and the fun of players exploring game mechanisms can be increased, which is conducive to application in actual scenarios.
[0086] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0087] In this embodiment, a device for playing music resources is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0088] Figure 4 is a structural block diagram of a device for playing music resources according to one embodiment of the present invention, such as Figure 4 As shown, a graphical user interface is provided through a first terminal device, the content displayed by the graphical user interface at least partially includes a game scene, and the content displayed by the game scene at least partially includes a first virtual character controlled by the first terminal device and at least one second virtual character controlled by at least one second terminal device. The apparatus includes: a determination module 401, for determining a first music event corresponding to the first virtual character in response to the first virtual character and at least one second virtual character synchronously executing a target game action, wherein the first music event is used to trigger adjusting the playback state of a first music resource of multiple parts associated with the first virtual character to an on state; a playback module 402, for synchronously playing the first music resource of multiple parts based on the first music event.
[0089] Optionally, in the above-mentioned device for playing music resources: the first music resources of multiple parts have the same music playing attribute.
[0090] Optionally, in the above-mentioned device for playing music resources: the first music resources of multiple parts are encapsulated by a music segmentation function component set in a preset audio engine, and the first music resource of each part of the first music resources of multiple parts is encapsulated into an independent switching audio track.
[0091] Optionally, in the above-mentioned device for playing music resources: the first music resource of each part of the first music resources of multiple parts corresponds to an independent state group, wherein the state group is provided with a first state and a second state, the first state is used to control the switching audio track corresponding to the first music resource of each part to be in an on state, and the second state is used to control the switching audio track corresponding to the first music resource of each part to be in a off state.
[0092] Optionally, in the above-mentioned device for playing music resources: a first music resource of multiple parts and a second music resource of multiple parts associated with at least one second virtual character are respectively set on different music output buses, wherein the volume of the music output bus corresponding to the first virtual character suppresses the volume of the music output bus corresponding to at least one second virtual character.
[0093] Optionally, the playing module 402 is further used to: based on the first music event, set the playing state of the first music resource of multiple parts to the first state, so as to synchronously play the first music resource of multiple parts.
[0094] Optionally, Figure 5 is a structural block diagram of another device for playing music resources according to one embodiment of the present invention, such as Figure 5 As shown, the device includes Figure 4 In addition to all the modules shown, it also includes: a termination module 403, which is used to determine a second music event corresponding to the first virtual character in response to the first virtual character terminating the execution of the target game action, wherein the second music event is used to trigger the adjustment of the playback state of the first music resource of multiple parts associated with the first virtual character to an off state; based on the second music event, the playback state of the first music resource of multiple parts is set to a second state to stop playing the first music resource of multiple parts.
[0095] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0096] An embodiment of the present invention further provides a non-volatile storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0097] The above-mentioned non-volatile storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0098] Optionally, in this embodiment, the non-volatile storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.
[0099] Optionally, in this embodiment, the non-volatile storage medium may be configured to store a computer program for performing the following steps:
[0100] In response to a first virtual character and at least one second virtual character synchronously executing a target game action, a first music event corresponding to the first virtual character is determined, wherein the first music event is used to trigger adjusting the playback state of a first music resource of multiple parts associated with the first virtual character to an on state; based on the first music event, the first music resource of multiple parts is synchronously played.
[0101] Optionally, in the above method for playing music resources: the first music resources of multiple parts have the same music playing attribute.
[0102] Optionally, in the above method for playing music resources: the first music resources of multiple parts are encapsulated by a music segmentation function component set in a preset audio engine, and the first music resource of each part of the first music resources of multiple parts is encapsulated into an independent switching audio track.
[0103] Optionally, in the above-mentioned method for playing music resources: the first music resource of each part of the first music resources of multiple parts corresponds to an independent state group, wherein the state group is provided with a first state and a second state, the first state is used to control the switching audio track corresponding to the first music resource of each part to be in an on state, and the second state is used to control the switching audio track corresponding to the first music resource of each part to be in a off state.
[0104] Optionally, in the above-mentioned method for playing music resources: a first music resource of multiple parts and a second music resource of multiple parts associated with at least one second virtual character are respectively set on different music output buses, wherein the volume of the music output bus corresponding to the first virtual character suppresses the volume of the music output bus corresponding to at least one second virtual character.
[0105] Optionally, based on the first music event, synchronously playing the first music resource of multiple parts includes: based on the first music event, setting the playing state of the first music resource of multiple parts to a first state to synchronously play the first music resource of multiple parts.
[0106] Optionally, the above method for playing music resources also includes: in response to the first virtual character terminating the execution of the target game action, determining a second music event corresponding to the first virtual character, wherein the second music event is used to trigger adjusting the playback state of the first music resource of multiple parts associated with the first virtual character to an off state; based on the second music event, setting the playback state of the first music resource of multiple parts to a second state to stop playing the first music resource of multiple parts.
[0107] By synchronously playing the first music resources of multiple parts based on the first music event, the purpose of combined playback of multiple music resources of multiple parts based on the game actions performed by multiple virtual characters is achieved, thereby realizing the technical effect of optimizing the music playback logic in the game and thus improving the richness of game sound effects and the player's gaming experience, thereby solving the technical problem of low richness of sound effect performance and poor player gaming experience in the related technology processing method of playing sound effects according to the actions or special effects of a single character.
[0108] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.
[0109] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0110] Figure 6 is a structural block diagram of an electronic device according to one embodiment of the present invention. Figure 6 As shown, the electronic device 60 may include: a processor 602 (the processor 602 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 604 for storing data, and a transmission device 606 for communication functions.
[0111] The electronic device 60 may also include: a display, a keyboard, a cursor control device (such as a mouse), an input / output interface (I / O interface), a network interface, a power supply and / or a camera. Those skilled in the art will appreciate that Figure 6 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 6 More or fewer components as shown, or with Figure 6The memory 604 can be used to store computer programs and corresponding data, such as the computer program and corresponding data corresponding to the method for playing music resources in the embodiment of the present invention. The processor 602 executes various functional applications and data processing by running the computer program stored in the memory 604, that is, implementing the above-mentioned method for playing music resources.
[0112] The memory 604 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 604 may further include a memory remotely arranged relative to the processor 602, and these remote memories may be connected to the electronic device 60 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0113] The transmission device 606 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the electronic device 60. In one example, the transmission device 606 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 606 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0114] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the electronic device 60 .
[0115] Optionally, in this embodiment, the processor 602 may be configured to perform the following steps through a computer program:
[0116] In response to a first virtual character and at least one second virtual character synchronously executing a target game action, a first music event corresponding to the first virtual character is determined, wherein the first music event is used to trigger adjusting the playback state of a first music resource of multiple parts associated with the first virtual character to an on state; based on the first music event, the first music resource of multiple parts is synchronously played.
[0117] Optionally, in the above method for playing music resources: the first music resources of multiple parts have the same music playing attribute.
[0118] Optionally, in the above method for playing music resources: the first music resources of multiple parts are encapsulated by a music segmentation function component set in a preset audio engine, and the first music resource of each part of the first music resources of multiple parts is encapsulated into an independent switching audio track.
[0119] Optionally, in the above-mentioned method for playing music resources: the first music resource of each part of the first music resources of multiple parts corresponds to an independent state group, wherein the state group is provided with a first state and a second state, the first state is used to control the switching audio track corresponding to the first music resource of each part to be in an on state, and the second state is used to control the switching audio track corresponding to the first music resource of each part to be in a off state.
[0120] Optionally, in the above-mentioned method for playing music resources: a first music resource of multiple parts and a second music resource of multiple parts associated with at least one second virtual character are respectively set on different music output buses, wherein the volume of the music output bus corresponding to the first virtual character suppresses the volume of the music output bus corresponding to at least one second virtual character.
[0121] Optionally, based on the first music event, synchronously playing the first music resource of multiple parts includes: based on the first music event, setting the playing state of the first music resource of multiple parts to a first state to synchronously play the first music resource of multiple parts.
[0122] Optionally, the above method for playing music resources also includes: in response to the first virtual character terminating the execution of the target game action, determining a second music event corresponding to the first virtual character, wherein the second music event is used to trigger adjusting the playback state of the first music resource of multiple parts associated with the first virtual character to an off state; based on the second music event, setting the playback state of the first music resource of multiple parts to a second state to stop playing the first music resource of multiple parts.
[0123] By synchronously playing the first music resources of multiple parts based on the first music event, the purpose of combined playback of multiple music resources of multiple parts based on the game actions performed by multiple virtual characters is achieved, thereby realizing the technical effect of optimizing the music playback logic in the game and thus improving the richness of game sound effects and the player's gaming experience, thereby solving the technical problem of low richness of sound effect performance and poor player gaming experience in the related technology processing method of playing sound effects according to the actions or special effects of a single character.
[0124] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0125] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0126] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0127] In the several embodiments provided by the present invention, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0128] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0129] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0130] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0131] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for playing music resources, It is characterized in that A graphical user interface is provided through a first terminal device, the content displayed by the graphical user interface at least partially includes a game scene, and the content displayed by the game scene at least partially includes a first virtual character controlled by the first terminal device and at least one second virtual character controlled by at least one second terminal device, and the method includes: In response to the first virtual character and the at least one second virtual character synchronously executing a target game action, determining a first music event corresponding to the first virtual character, wherein the first music event is used to trigger adjusting a play state of a first music resource of a plurality of voice parts associated with the first virtual character to an on state; Based on the first music event, the first music resources of the multiple parts are synchronously played, wherein the first music resources of the multiple parts have the same music playing attribute.
2. The method according to claim 1, It is characterized in that The first music resources of the multiple parts are encapsulated by a music segmentation function component set in a preset audio engine, and the first music resource of each part of the first music resources of the multiple parts is encapsulated into an independent switching audio track.
3. The method according to claim 1, It is characterized in that The first music resources of each part of the first music resources of the multiple parts correspond to independent state groups respectively, wherein the state group is provided with a first state and a second state, the first state is used to control the switching track corresponding to the first music resource of each part to be in an on state, and the second state is used to control the switching track corresponding to the first music resource of each part to be in a off state.
4. The method according to claim 3, It is characterized in that The first music resources of the multiple parts and the second music resources of the multiple parts associated with the at least one second virtual character are respectively set on different music output buses, wherein the volume of the music output bus corresponding to the first virtual character suppresses the volume of the music output bus corresponding to the at least one second virtual character.
5. The method according to claim 4, It is characterized in that Based on the first music event, synchronously playing the first music resource of the multiple parts includes: Based on the first music event, the playing state of the first music resource of the multiple parts is set to the first state, so as to synchronously play the first music resource of the multiple parts.
6. The method according to claim 4, It is characterized in that The method further comprises: In response to the first virtual character terminating the execution of the target game action, determining a second music event corresponding to the first virtual character, wherein the second music event is used to trigger adjusting the playing state of the first music resource of the multiple parts associated with the first virtual character to an off state; Based on the second music event, the playing state of the first music resource of the multiple parts is set to the second state to stop playing the first music resource of the multiple parts.
7. A device for playing music resources, It is characterized in that A graphical user interface is provided through a first terminal device, the content displayed by the graphical user interface at least partially includes a game scene, and the content displayed by the game scene at least partially includes a first virtual character controlled by the first terminal device and at least one second virtual character controlled by at least one second terminal device, the apparatus comprising: a determination module, configured to determine a first music event corresponding to the first virtual character in response to the first virtual character and the at least one second virtual character synchronously executing a target game action, wherein the first music event is used to trigger adjusting a play state of a first music resource of a plurality of voice parts associated with the first virtual character to an on state; A playing module is used to synchronously play the first music resources of the multiple parts based on the first music event, wherein the first music resources of the multiple parts have the same music playing attribute.
8. A non-volatile storage medium, It is characterized in that The storage medium stores a computer program, wherein the computer program is configured to execute the method for playing music resources as claimed in any one of claims 1 to 6 when running.
9. An electronic device comprising a memory and a processor, It is characterized in that The memory stores a computer program, and the processor is configured to run the computer program to execute the method for playing music resources as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Game audio output method and device, storage medium and electronic device
CN112691371A
Music control method in game, nonvolatile storage medium and electronic device
CN113318432A
