Audio playing method, device, equipment, medium and program product

By introducing the Web Audio code component into the parent application, the sub-application can perform diversified processing of audio resources, solving the problem of monotonous audio effects in the sub-application and realizing diversified performance and fast playback of audio resources.

CN115857864BActive Publication Date: 2025-11-28GUANGZHOU TENCENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111114831.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-23
Publication Date
2025-11-28
Estimated Expiration
2041-09-23

AI Technical Summary

Technical Problem

Sub-applications cannot achieve diverse audio effects in existing technologies, and the migration from the web page to the sub-application is difficult.

Method used

By introducing the Web Audio code component into the parent application, the child application calls its function interface to process audio resources with sound effects, including ambient sound effects, spatial sound effects, delayed playback, and variable speed playback. The processed audio resources are then output and played by the audio playback component.

Benefits of technology

It enables diverse audio resource presentation in sub-applications, reduces the difficulty of migration from the web page to the sub-application, and allows the audio playback component to quickly acquire and play processed audio resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115857864B_ABST
    Figure CN115857864B_ABST
Patent Text Reader

Abstract

The application discloses an audio playing method, device, equipment, medium and program product, and belongs to the technical field of audio. The method includes a parent application program comprising a Web Audio code component. The method comprises: generating an audio playing event in a running process of a child application program, the audio playing event corresponding to a target audio resource in an audio resource package of the child application program; calling a Web Audio function interface provided by the Web Audio code component on the parent application program to perform first sound effect processing on the target audio resource corresponding to the audio playing event, to obtain a processed target audio resource; and outputting the processed target audio resource to an audio playing component of a terminal for playing. The above scheme can be applied to various scenes such as cloud technology, artificial intelligence and intelligent transportation, and provides various audio effects for the child application program on the terminal.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the field of audio technology, and in particular to an audio playing method and device, equipment, medium and program product. BACKGROUND

[0002] With the development of sub-application technology, it is often necessary to add various audio effects on the audio resources of the sub-application.

[0003] In the related art, the sub-application calls the audio function interface provided by the base audio code component on the parent application, and the sub-application can implement basic audio processing on the audio resources. For example, the sub-application calls the audio function interface provided by the AudioMedia (a kind of audio media component) component or the OpenAL (a kind of open sound effect component) component on the parent application, and the sub-application can only implement simple playing, pausing, terminating, jumping and other basic audio processing on the audio resources. The AudioMedia component is provided by the Android operating system, and the OpenAL component is provided by the IOS operating system.

[0004] How to provide various audio effects for the sub-application has become an important problem to be solved. SUMMARY

[0005] The present application provides an audio playing method, device, equipment, medium and program product, so that the audio of the sub-application can be expressed as diversified audio effects. The technical solution is as follows:

[0006] According to an aspect of the present application, an audio playing method is provided, the method is executed by a terminal, the terminal runs a parent application and a sub-application, the sub-application is a program running in dependence on the parent application, and the parent application includes a Web Audio code component. The method comprises the following steps:

[0007] The sub-application generates an audio playing event in the running process, and the audio playing event corresponds to a target audio resource in an audio resource package of the sub-application;

[0008] The sub-application calls a Web Audio function interface provided by the Web Audio code component on the parent application, and performs first sound effect processing on the target audio resource corresponding to the audio playing event to obtain a processed target audio resource;

[0009] The Web Audio code component outputs the processed target audio resource to an audio playing component of the terminal for playing.

[0010] According to another aspect of the present application, an audio playing device is provided, the device runs a parent application and a child application, the child application is a program dependent on the parent application, the parent application comprises a Web Audio code component, and the device comprises:

[0011] a generating module configured to generate an audio playing event during the running process, the audio playing event corresponding to a target audio resource in an audio resource package of the child application;

[0012] a processing module configured to call a Web Audio function interface provided by the Web Audio code component on the parent application, to perform a first sound effect processing on the target audio resource corresponding to the audio playing event, and to obtain a processed target audio resource;

[0013] an output module configured to output the processed target audio resource to an audio playing component of the device for playing.

[0014] In an optional embodiment, the first sound effect processing comprises at least one of the following processes:

[0015] environmental sound effect processing of the target audio resource;

[0016] spatial sound effect processing of the target audio resource;

[0017] delayed playing processing of the target audio resource;

[0018] variable speed playing processing of the target audio resource.

[0019] In an optional embodiment, the generating module is further configured to generate a first audio playing event during the running process, a first audio resource in the first audio playing event being determined based on a behavior of a first virtual character, and a first sound effect resource in the first audio playing event being determined based on a virtual environment in which the first virtual character is located.

[0020] In an optional embodiment, the processing module is further configured to call a first Web Audio function interface provided by the Web Audio code component on the parent application, to perform superimposed fitting on the first audio resource according to the first sound effect resource, and to obtain the processed first audio resource.

[0021] In an optional embodiment, the generating module is further configured to generate a second audio playing event during the running process, a second audio resource in the second audio playing event being determined based on a behavior of a second virtual character.

[0022] In an optional embodiment, the processing module is further configured to invoke a second network audio function interface provided by the network audio code component on the parent application, and play the second audio resource on a sound source corresponding to the spatial coordinates of the second virtual object in the three-dimensional space to obtain a processed second audio resource.

[0023] In an optional embodiment, the generating module is further configured to generate a third audio playback event during the running process, and a third audio resource and a delay playback duration in the third audio playback event are determined based on the behavior of the first virtual role.

[0024] In an optional embodiment, the processing module is further configured to invoke a third network audio function interface provided by the network audio code component on the parent application, and process the third audio resource according to the delay playback duration to obtain a processed third audio resource.

[0025] In an optional embodiment, the generating module is further configured to generate a fourth audio playback event during the running process, and a fourth audio resource and a playback multiple in the fourth audio playback event are determined based on the behavior of the first virtual role.

[0026] In an optional embodiment, the processing module is further configured to invoke a fourth network audio function interface provided by the network audio code component on the parent application, and process the fourth audio resource according to the playback multiple to obtain a processed fourth audio resource.

[0027] In an optional embodiment, the generating module is further configured to generate a native audio playback event during the running process, and the native audio playback event corresponds to a native audio resource in the parent application.

[0028] In an optional embodiment, the processing module is further configured to invoke a network audio function interface provided by the network audio code component on the parent application, and perform a second audio effect processing on the native audio resource to obtain a processed native audio resource.

[0029] In an optional embodiment, the output module is further configured to output the processed native audio resource to an audio playback component of the terminal for playback.

[0030] In an optional embodiment, the generating module is further configured to generate a fifth audio playback event during the running process, and the fifth audio playback event corresponds to a fifth audio resource in the parent application.

[0031] In an optional embodiment, the processing module is further configured to invoke a network audio function interface provided by the network audio code component on the parent application, and perform fade-in and fade-out sound effect processing on the fifth audio resource according to fifth audio parameters to obtain a processed fifth audio resource, the fifth audio parameters including at least one of a fade-in volume size and a fade-out volume size of the fifth audio resource, and the fifth audio parameters further including at least one of a fade-in time length and a fade-out time length of the fifth audio resource.

[0032] In an optional embodiment, the generating module is further configured to generate, during the running, a sixth audio playback event, the sixth audio playback event corresponding to n sixth audio resources in the parent application.

[0033] In an optional embodiment, the processing module is further configured to invoke a network audio function interface provided by the network audio code component on the parent application, and perform fade-in and fade-out sound effect processing on the fifth audio resource according to fifth audio parameters to obtain a processed fifth audio resource, the fifth audio parameters including at least one of a fade-in volume size and a fade-out volume size of the fifth audio resource, and the fifth audio parameters further including at least one of a fade-in time length and a fade-out time length of the fifth audio resource.

[0034] In an optional embodiment, the native audio playback event includes at least one of playing a video, playing a live broadcast, and playing virtual reality (VR).

[0035] According to an aspect of the present application, a computer device is provided, which includes a processor and a memory, the memory storing a computer program, the computer program being loaded and executed by the processor to implement the audio playback method as above.

[0036] According to another aspect of the present application, a computer readable storage medium is provided, the storage medium storing a computer program, the computer program being loaded and executed by a processor to implement the audio playback method as above.

[0037] According to another aspect of the present application, a computer program product is provided, the computer program product including computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the audio playback method provided in the above aspect.

[0038] The technical scheme provided by the embodiments of the present application has at least the following beneficial effects:

[0039] The sub-application can perform sound effect processing on the audio resource by invoking the network audio function interface provided by the network audio code component on the parent application, so that the audio of the sub-application can be expressed in various audio effects. Moreover, the standard network audio function interface introduced by the parent application can reduce the migration difficulty of mature products from the web page end to the sub-application end.

[0040] Furthermore, through the network audio function interface provided by the parent application, provided that the sub-application can be used without downloading, the terminal's audio playback component only needs to perform audio processing on the parent application platform each time it plays an audio resource. The audio playback component can quickly obtain and play the processed target audio resource. Attached Figure Description

[0041] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0042] Figure 1 A block diagram of a computer system provided in an exemplary embodiment is shown;

[0043] Figure 2 A schematic diagram of the operating environment on a terminal provided by an exemplary embodiment is shown;

[0044] Figure 3 A flowchart of an audio playback method provided by an exemplary embodiment is shown;

[0045] Figure 4 A flowchart of an audio playback method provided by another exemplary embodiment is shown;

[0046] Figure 5 A flowchart of an audio playback method provided by another exemplary embodiment is shown;

[0047] Figure 6 A flowchart of an audio playback method provided by another exemplary embodiment is shown;

[0048] Figure 7 A flowchart of an audio playback method provided by another exemplary embodiment is shown;

[0049] Figure 8 A flowchart of an audio playback method provided by another exemplary embodiment is shown;

[0050] Figure 9 A flowchart of an audio playback method provided by another exemplary embodiment is shown;

[0051] Figure 10 A flowchart of an audio playback method provided by another exemplary embodiment is shown;

[0052] Figure 11 A schematic diagram of a terminal running a sub-application provided by an exemplary embodiment is shown;

[0053] Figure 12 A flow chart of a process of developing a mini-game by a developer is shown in an example embodiment;

[0054] Figure 13 A structural block diagram of an audio playing device is shown in an example embodiment;

[0055] Figure 14 A structural schematic diagram of a computer device is shown in an example embodiment. DETAILED DESCRIPTION

[0056] The example embodiments will be described in detail herein with reference to the attached drawings. In the following description, unless otherwise indicated, like numbers in the attached drawings refer to the same or similar elements. The following description of example embodiments is not representative of all possible embodiments consistent with the present application. Rather, it is merely an example of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0057] It should be understood that the terms “a number of” and “a plurality of” refer to one or more than one, and “a number of” refers to two or more than two. The “and / or” describes the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which can represent the three cases of A alone, A and B together, and B alone. The character “ / ” generally represents an “or” relationship between the associated objects before and after it.

[0058] First, the terms involved in the embodiments of the present application are briefly introduced:

[0059] WebAudio code component: provides a general system for controlling audio on a webpage, allowing developers to select audio sources, add special effects to audio, and visualize audio, etc.

[0060] Web audio function interface: the calling interface left after the encapsulation of the WebAudio code component. Developers can quickly access the WebAudio code component through this interface and develop using the functions provided by the WebAudio code component.

[0061] SDK (Software Development Kit): refers to a collection of related documents, examples, and tools that assist in the development of a certain type of software. In the related technology of the present application, in order to achieve a variety of audio effects, the application program often integrates third-party audio SDKs, such as FMOD (an audio system) and WWISE (an audio system). On a terminal with the application program installed, the application program can achieve rich audio effects by calling the interfaces provided by the third-party audio SDK.

[0062] In the related art of the present application, in order to realize various audio effects of the sub-application, the developer may also rewrite the SDK toolkit of FMOD or WWISE into a JavaScript version and integrate it into the source code of the sub-application, which often leads to a large size and poor performance of the sub-application. In this scheme, under the premise that the sub-application meets the requirement of being used without downloading, the audio playback component of the terminal often needs to obtain the audio resource from the server of the sub-application every time the audio resource is played, and the audio playback component takes a long time to obtain the audio, which is not suitable for the scene of playing the audio of the sub-application.

[0063] The above has briefly explained the terms involved in the present application. Next, the implementation environment part is introduced.

[0064] Figure 1 A structural block diagram of a terminal 100 provided by an example embodiment of the present application is shown. The terminal 100 can be a vehicle-mounted terminal, a smart home control center, a smart sound box, a smart refrigerator, a smart washing machine, a smart robot, etc. The terminal 100 includes at least one processor 110, a memory 150, at least one network interface 120, and a user interface 130. The various components in the server 100 are coupled together through a bus system 140. It can be understood that the bus system 140 is used to realize the connection and communication between the components. In addition to including a data bus, the bus system 140 also includes a power bus, a control bus, and a status signal bus. However, in order to clearly illustrate, all kinds of buses are marked as the bus system 140 in the Figure 1

[0065] The processor 110 can be an integrated circuit chip with signal processing capability, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc., wherein the general-purpose processor can be a microprocessor or any conventional processor.

[0066] ​The user interface 130 includes one or more output devices that enable presentation of media content. Typically, the output devices include a display screen 131 and hardware input peripherals 132. The display screen 131 can be a touch screen or a non-touch screen. The hardware input peripherals 132 include at least one of a hardware knob, a hardware dial, a hardware touchpad, and a hardware button. In one example, the hardware input peripherals 132 include a hardware knob for triggering a selection operation, a confirmation button for triggering a confirmation operation, and a back button for triggering a back operation. The hardware knob for triggering a selection operation can also be implemented as a hardware dial or a hardware touchpad. In some examples, there is a center console button that supports multiple control functions, which supports at least one of rotary control, dial control, touchpad control, and button control. Optionally, the hardware input peripherals 132 refer to input peripherals that are non-touch screens, or input peripherals that are in a physical input form, or input peripherals that are in a mechanical or electromechanical input form. The electromechanical input refers to a mechanical and electrical combination input form, also known as semi-mechanical.

[0067] The memory 150 can be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard drives, optical drives, and the like. The memory 150 optionally includes one or more storage devices remotely located from the processor 110 in a physical location.

[0068] The memory 150 includes volatile memory or nonvolatile memory, and can include both volatile and nonvolatile memory. Nonvolatile memory can be read only memory (ROM), volatile memory can be random access memory (RAM). The memory 150 described in the embodiments of the present application is intended to include any suitable type of memory.

[0069] In some embodiments, the memory 150 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or a subset or superset thereof, which are described below.

[0070] The operating system 151 includes system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, and the like, for implementing various basic services and processing hardware-based tasks. The operating system 151 can be an Android operating system or an IOS operating system, and the specific type of the operating system is not limited in the present application.

[0071] The host program 152 and the native application 153 run in the operating system 151.

[0072] The host program 152 is used to provide a running environment for the applet. One or more applets, such as applet 1 and applet 2, run in the host program 152. Regardless of the car machine operating system, as long as the host program 152 runs in the car machine operating system, the applet can rely on the host program 152 to run. The host program 152 is also called an applet engine.

[0073] As shown in the schematic diagram, Figure 3 The host program 152 is an application program that carries the applet and provides an environment for the implementation of the applet. The host program 152 is a native application program. The native application program is an application program that can run directly on the operating system 151. The host program 152 can be a social application program, a special application program specially supporting the applet 152, a file management application program, a mail application program, a game application program, a map application program, a navigation application program, etc. The social application program includes an instant messaging application, an SNS (Social Network Service) application, or a live broadcast application, etc. The applet is an application program running in the environment provided by the host program. The applet can specifically be a social application program, a file management application program, a mail application program, or a game application program, etc. The host program 152 can specifically be a WeChat program or a corresponding applet can be called a mini program.

[0074] The applet logic layer unit 151c and the corresponding applet view layer unit 151b are used to implement the applet instance. One applet can be implemented by one applet logic layer unit 151c and at least one applet view layer unit 151b. The applet view layer unit 151b and the applet page can be in a one-to-one correspondence.

[0075] The applet view layer unit 152b is used to organize the view of the applet and render. The applet logic layer unit 152c is used to process the data processing logic of the applet and the corresponding applet page. The unit can specifically be a process or a thread. The applet view layer unit 152b is, for example, an applet view layer thread. The applet logic layer unit 152c is, for example, an applet logic layer thread. The applet logic layer unit 152c can run in a virtual machine. The applet view layer unit 152b and the applet logic layer unit 152c can communicate through the host program native unit 152a, which is an interface for the communication between the host program 152 and the applet. The host program native unit 152a can be a thread or a process of the host program 152 itself. The page logic code belonging to the program package of each applet page can be registered by the applet logic layer unit 152c at startup, and the registered page logic code is executed when data needs to be processed.

[0076] The local application 153 is an application program designed based on an operating system. Generally, the local application 153 can only run in the current operating system. The local application 153 is also called a native application.

[0077] In an embodiment, the terminal of the present application is a vehicle terminal, and the audio playing method provided by the present application can be implemented in an intelligent traffic system and an intelligent vehicle infrastructure cooperative system. The intelligent traffic system (Intelligent Traffic System, ITS) is also called an intelligent transportation system (Intelligent Transportation System). The intelligent transportation system is a comprehensive transportation system that effectively integrates advanced scientific technologies (information technology, computer technology, data communication technology, sensor technology, electronic control technology, automatic control theory, operations research, artificial intelligence, etc.) in transportation, service control and vehicle manufacturing, and strengthens the connection among vehicles, roads and users, so as to form a comprehensive transportation system that guarantees safety, improves efficiency, improves the environment and saves energy.

[0078] The intelligent vehicle infrastructure cooperative system (Intelligent Vehicle Infrastructure Cooperative Systems, IVICS), referred to as a vehicle infrastructure cooperative system, is a development direction of the intelligent traffic system (ITS). The vehicle infrastructure cooperative system is a safe, efficient and environmentally friendly road traffic system that uses advanced wireless communication and new generation Internet technologies to implement dynamic real-time information interaction between vehicles and roads in all directions, and develops vehicle active safety control and road cooperative management on the basis of full-time and space dynamic traffic information collection and fusion, fully realizes effective cooperation among people, vehicles and roads, guarantees traffic safety and improves traffic efficiency.

[0079] In an embodiment, the audio playing method provided by the present application can be implemented by an artificial intelligence cloud service. Several common AI services can be split on the platform of the parent application program, and independent or packaged services can be provided in the cloud. This service mode is similar to opening an AI theme mall: all developers can access one or more artificial intelligence services provided by the platform through an API (Application Program Interface) interface, and some experienced developers can also use the AI framework and AI infrastructure provided by the platform to deploy and maintain their own cloud artificial intelligence services.

[0080] To realize that the audio of the sub-application can present diversified audio effects, and the audio playing component of the terminal can quickly play the processed target audio resource, Figure 3An audio playing method provided by an example embodiment of the present application is shown, which is executed by a terminal, and a parent application and a child application are run in the terminal, the child application is a program dependent on the parent application, the parent application comprises a Web Audio code component, and the method is applied to Figure 1 The terminal is shown by way of example, and the method comprises the following steps:

[0081] In step 320, the child application generates an audio playing event during running;

[0082] The audio playing event refers to an event pre-set on the child application for triggering audio playing. Optionally, in the case that the child application is a music player type application, the audio playing event refers to an event generated by the child application for playing a specified audio in response to a user touching a control for playing the specified song; optionally, in the case that the child application is a card making application, the audio playing event refers to an event generated by the child application for playing a default audio in response to a user starting to run the child application; optionally, in the case that the child application is a shooting type game, the audio playing event refers to an event generated by the child application for playing a shooting audio in response to a user touching a control for firing.

[0083] It is worth mentioning that in the present application, the audio playing event can be generated based on a user's operation or based on a developer's pre-setting, such as the developer setting that the child application always plays the song “My Heart for China” on the National Day.

[0084] In an embodiment, the audio playing event corresponds to a target audio resource in an audio resource package of the child application, and optionally, in response to the terminal starting to run the child application, the terminal loads the audio resource package from a server of the child application and caches it locally in the terminal. The audio resource package contains part or all of the audio resources of the child application. Illustratively, in the case that the child application is a small game of the Battle Royale type, the audio resource package contains virtual character footstep audio resources, shooting audio resources, car driving audio resources, etc.

[0085] In step 340, the child application calls a Web Audio function interface provided by the Web Audio code component on the parent application to perform first audio effect processing on the target audio resource corresponding to the audio playing event, to obtain a processed target audio resource;

[0086] In an embodiment, the first audio effect processing comprises at least one of the following processing:

[0087] • environmental audio effect processing of the target audio resource;

[0088] • spatial audio effect processing of the target audio resource;

[0089] • Delayed playback processing of the target audio resource;

[0090] • Speed-changed playback processing of the target audio resource;

[0091] For detailed descriptions of the above four sound effect processing, please refer to the following first to fourth possible implementation manners.

[0092] At step 360, the network audio code component outputs the processed target audio resource to the audio playback component of the terminal for playback.

[0093] The network audio component outputs the processed target audio resource to the loudspeaker, wired earphone, Bluetooth playback device connected to the terminal, etc. of the terminal. Optionally, the loudspeaker, earphone, or Bluetooth playback device can implement basic audio processing on the audio resource, such as playback, pause, termination, jump, etc.

[0094] In summary, the sub-application program can perform sound effect processing on the audio resource by calling the network audio function interface provided by the network audio code component of the parent application program, so that the audio of the sub-application program can exhibit various audio effects. Moreover, the standard network audio function interface introduced by the parent application program reduces the migration difficulty of mature products from the web page end to the sub-application program end.

[0095] Moreover, through the network audio function interface provided by the parent application program, on the premise that the sub-application program meets the requirement of being used without downloading, the audio playback component of the terminal only needs to perform audio processing on the parent application program platform every time the audio resource is played, and the audio playback component can quickly obtain and play the processed target audio resource.

[0096] First possible implementation manner:

[0097] To enable the audio of the sub-application program to exhibit environmental sound effects, based on the premise that the parent application program provides a network audio function interface, the first possible implementation manner includes: Figure 3 As shown in the embodiment, in combination with reference to Figure 4 Step 320 can be replaced by the following step 320-1, and step 340 can be replaced by the following step 340-1, and the first possible implementation manner includes:

[0098] At step 320-1, the sub-application program generates a first audio playback event during running;

[0099] The first audio resource in the first audio playback event is determined based on the behavior of the first virtual role, and the first sound effect resource in the first audio playback event is determined based on the virtual environment in which the first virtual role is located.

[0100] In an embodiment, the sub-application is a small game, a virtual character controlled by a terminal running the sub-application is the first virtual character, and an environment in which the first virtual character is located in the small game is a virtual environment.

[0101] The virtual environment can be a simulated environment of the real world, a semi-simulated and semi-fictional environment, or a purely fictional environment. The virtual environment can be any one of a two-dimensional virtual environment, a 2.5-dimensional virtual environment, and a three-dimensional virtual environment, which is not limited in the present application. Optionally, the virtual environment can provide a virtual character battle environment. For example, in a battle royale type game, at least one virtual object performs a single round of battle in a virtual environment, the virtual object survives in the virtual environment by avoiding attacks launched by enemy units and dangers existing in the virtual environment (such as a toxic gas ring, a marsh, etc.), and when the virtual object has zero life value in the virtual environment, the life of the virtual object in the virtual environment ends, and the virtual object that successfully survives is the winning side.

[0102] Illustratively, in response to the first virtual object walking on the grass, the sub-application generates a first audio playback event of walking on the grass, wherein the first audio resource in the first audio playback event is determined based on the walking of the first virtual character, that is, the first audio resource is the sound of the first virtual object walking, and the first sound effect resource in the first audio playback event is determined based on the grass where the first virtual character is located, that is, the first sound effect resource is the sound effect resource of the grass.

[0103] Illustratively, in response to the first virtual object driving a car on the desert, the sub-application generates a first audio playback event of driving a car on the desert, wherein the first audio resource in the first audio playback event is determined based on the behavior of the first virtual character driving the car, and the first sound effect resource in the first audio playback event is determined based on the desert where the first virtual character is located, that is, the first sound effect resource is the sound effect resource of the desert.

[0104] In step 340-1, the sub-application calls a first network audio function interface provided by the network audio code component on the parent application, and superimposes and fits the first audio resource according to the first sound effect resource to obtain a processed first audio resource.

[0105] The sub-application inputs the first audio resource and the first sound effect resource to the first network audio function interface for superimposition and fitting by the network audio function code component.

[0106] Illustratively, the network audio code component superimposes and fits the basic sound of the first virtual object walking and the sound effect resource of the grass to obtain the sound of the first virtual object walking on the grass.

[0107] Illustratively, the network audio code component superimposes the sound of the first virtual object driving a car and the sound effect resource of the desert to obtain the sound of the first virtual object driving a car in the desert.

[0108] In summary, the first network audio function interface provided by the parent application program can realize environment sound effect processing, enrich the audio effect of the child application program, and bring a more realistic game experience to the user.

[0109] The second possible implementation manner:

[0110] To realize the spatial sound effect of the audio of the child application program, based on Figure 3 In the embodiment shown, reference is made to Figure 5 Step 320 can be replaced by the following step 320-2, and step 340 can be replaced by the following step 340-2, and the second possible implementation manner includes:

[0111] Step 320-2, the child application program generates a second audio playback event in the running process;

[0112] The second audio resource in the second audio playback event is determined based on the behavior of the second virtual role.

[0113] In one embodiment, the child application program is a small game, the virtual role controlled by the terminal running the child application program is the first virtual role, and the environment in which the first virtual role is located in the small game is a virtual environment. The second virtual object is a virtual object in a different camp from the first virtual object, and the audio resource based on the behavior of the second virtual object is played on the terminal controlling the first virtual object.

[0114] Illustratively, the second virtual object walks near the first virtual object, and the footstep sound of the second virtual object is played on the terminal controlling the first virtual object.

[0115] Illustratively, the second virtual object releases a skill near the first virtual object, and the audio resource of the skill is played on the terminal controlling the first virtual object.

[0116] Step 340-2, the child application program calls the second network audio function interface provided by the network audio code component on the parent application program to play the second audio resource on the sound source corresponding to the spatial coordinates of the second virtual object in the three-dimensional space, to obtain the processed second audio resource.

[0117] The child application program inputs the second audio resource and the spatial coordinates of the second virtual object into the second network audio function interface for processing by the network audio function code component.

[0118] The network audio code component obtains the spatial coordinates of the second virtual object provided by the sub-application, takes the spatial coordinates as a sound source position, and simulates playing of the second audio resource at the sound source position to obtain a processed second audio resource.

[0119] Illustratively, the network audio code component obtains the spatial coordinates of the second virtual object, takes the spatial coordinates as a sound source position, and plays the footstep sound of the second virtual object at the sound source position to obtain a processed footstep sound of the second virtual object.

[0120] Illustratively, the network audio code component obtains the spatial coordinates of the second virtual object, takes the spatial coordinates as a sound source position, and plays the audio of the second virtual object releasing a skill at the sound source position to obtain a processed skill audio of the second virtual object.

[0121] To sum up, through the second network audio function interface provided by the parent application, spatial sound effect processing can be implemented, the audio effect of the sub-application is enriched, and a more realistic game experience is brought to the user.

[0122] A third possible implementation manner:

[0123] To realize the audio delayed playing of the sub-application, based on Figure 3 In the embodiment shown, in combination with reference Figure 6 Step 320 can be replaced by the following step 320-3, and step 340 can be replaced by the following step 340-3, and the third possible implementation manner includes:

[0124] Step 320-3: The sub-application generates a third audio playing event in the running process;

[0125] The third audio resource in the third audio playing event and the delayed playing duration are determined based on the behavior of the first virtual character;

[0126] In an embodiment, the sub-application is a small game, in which a virtual character controlled by a terminal running the sub-application is the first virtual character, and an environment in which the first virtual character is located in the small game is a virtual environment.

[0127] Illustratively, in response to the first virtual object shooting, the sub-application generates a shooting audio playing event, wherein the third audio resource in the third audio playing event is determined based on the shooting behavior of the first virtual object, and the delayed playing duration in the third audio playing event is also determined based on the shooting behavior of the first virtual object.

[0128] Optionally, the sub-application randomly generates a delay playback duration based on the shooting behavior, for example, the sub-application sets an arbitrary delay of 0.2s to 0.3s for audio playback of each shooting behavior to simulate the impact that each shooting may be subjected to in the real world, such as sound delay caused by friction between the bullet and the barrel, sound delay caused by friction between the bullet and the air.

[0129] Optionally, the sub-application matches a delay playback duration based on the shooting behavior according to a preset gear, for example, the sub-application sets a delay of 0.2s for audio playback of a sub-machine gun and a delay of 0.3s for audio playback of a pistol.

[0130] Illustratively, in response to the first virtual object releasing a skill, the sub-application generates an audio playback event of the skill, wherein the third audio resource in the third audio playback event is determined based on the behavior of the first virtual object releasing the skill, and the delay playback duration in the third audio playback event is also determined based on the behavior of the first virtual object releasing the skill.

[0131] Optionally, the sub-application matches a delay playback duration based on the behavior of releasing the skill according to a preset gear, for example, the sub-application sets a delay of 0.1s for audio playback of releasing a first skill and a delay of 0.15s for audio playback of releasing a second skill.

[0132] In step 340-3, the sub-application calls a third network audio function interface provided by the network audio code component on the parent application to process the third audio resource according to the delay playback duration to obtain a processed third audio resource.

[0133] The sub-application inputs the third audio resource and the delay playback duration to the third network audio function interface for processing by the network audio function code component.

[0134] Illustratively, the network audio function code component sets the audio resource of the shooting behavior to be played after the delay playback duration to obtain a processed audio resource of the shooting behavior.

[0135] Illustratively, the network audio function code component sets the audio resource of the behavior of releasing the skill to be played after the delay playback duration to obtain a processed audio resource of the behavior of releasing the skill.

[0136] In summary, through the third network audio function interface provided by the parent application, delay playback processing can be realized, the audio effect of the sub-application is enriched, and a more realistic game experience is provided to the user.

[0137] The fourth possible implementation manner:

[0138] To realize variable speed playback of the audio of the sub-application, based onFigure 3 In the embodiment shown, in combination with reference to Figure 7 , step 320 can be replaced by the following step 320-4, and step 340 can be replaced by the following step 340-4, then the third possible implementation includes:

[0139] Step 320-4, the sub-application generates a fourth audio playback event during running;

[0140] Among them, the fourth audio resource and the playback multiple in the fourth audio playback event are determined based on the behavior of the first virtual role;

[0141] In one embodiment, the sub-application is a small game, and in the small game, the terminal controlled virtual role running the sub-application is the first virtual role, and the environment in which the first virtual role is located in the small game is a virtual environment.

[0142] Illustratively, in response to the first virtual object shooting, the sub-application generates a shooting audio playback event, wherein the fourth audio resource in the fourth audio playback event is determined based on the shooting behavior of the first virtual object, and the playback speed in the fourth audio playback event is also determined based on the shooting behavior of the first virtual object.

[0143] Optionally, the sub-application randomly generates the playback speed based on the shooting behavior, such as the sub-application setting the audio playback speed of each shooting behavior to be any value between 0.8 and 1.2, for simulating the influence that each shooting may be subjected to in the real world, such as the sound playback time length increasing due to the friction between the bullet and the gun barrel, the sound playback time length increasing due to the friction between the bullet and the air.

[0144] Optionally, the sub-application matches the playback speed according to a preset gear based on the shooting behavior, such as the sub-application setting the audio playback speed of a handgun to be 0.8 and the audio playback speed of a submachine gun to be 1.1.

[0145] Illustratively, in response to the first virtual object releasing a skill, the sub-application generates a skill audio playback event, wherein the fourth audio resource in the fourth audio playback event is determined based on the behavior of the first virtual object releasing the skill, and the playback speed in the fourth audio playback event is also determined based on the behavior of the first virtual object releasing the skill.

[0146] Optionally, the sub-application matches the delay playback time length according to a preset gear based on the behavior of releasing the skill, such as the sub-application setting the audio playback speed of releasing the first skill to be 0.8 and the audio playback speed of releasing the second skill to be 1.1.

[0147] At step 340-4, the sub-application calls a fourth network audio function interface provided by the network audio code component on the parent application, processes the fourth audio resource according to the playback speed, and obtains a processed fourth audio resource.

[0148] The sub-application inputs the fourth audio resource and the playback speed into the fourth network audio function interface, and processes the fourth audio resource through the network audio function code component.

[0149] Illustratively, the network audio function code component adjusts the playback speed of the audio resource of the shooting behavior to 0.8 times of the original, and obtains a processed audio resource of the shooting behavior.

[0150] Illustratively, the network audio function code component adjusts the playback speed of the audio resource of the skill releasing behavior to 1.1 times of the original, and obtains a processed audio resource of the skill releasing behavior.

[0151] In summary, through the fourth network audio function interface provided by the parent application, the speed-variable playback processing can be realized, the audio effect of the sub-application is enriched, and a more real game experience is brought to the user.

[0152] In order to realize that the audio of the parent application can present diversified audio effects, Figure 8 A flowchart of an audio playback method provided by an example embodiment of the present application is shown to Figure 8 The method shown is applied to Figure 2 The terminal shown is an example to illustrate that the method comprises:

[0153] At step 810, the parent application generates a native audio playback event in a running process.

[0154] The native audio playback event corresponds to a native audio resource in the parent application.

[0155] The native audio playback event refers to an event for triggering audio playback that is pre-set on the parent application. Optionally, the native audio playback event comprises at least one of playing a video, playing a live broadcast, and playing virtual reality (VR).

[0156] The native audio resource refers to an audio resource that is played on the parent application.

[0157] At step 820, the parent application calls a network audio function interface provided by a network audio code component on the parent application, performs second sound effect processing on the native audio resource, and obtains a processed native audio resource.

[0158] In an embodiment, the second sound effect processing comprises at least one of the following processing:

[0159] • fade-in and fade-out sound effect processing of the native audio resource;

[0160] • reverberation sound effect processing of the native audio resource;

[0161] The above two sound effect processing will be described in detail in the following fifth and sixth possible implementation modes.

[0162] Step 830, the network audio code component outputs the processed native audio resource to the audio playback component of the terminal for playing.

[0163] The network audio component outputs the processed target audio resource to the loudspeaker, wired earphone, Bluetooth playback device connected to the terminal, etc. of the terminal. Optionally, the loudspeaker, earphone or Bluetooth playback device can implement basic audio processing on the audio resource, such as playing, pausing, terminating, jumping, etc.

[0164] As described above, the parent application can perform sound effect processing on the audio resource by calling the network audio function interface provided by the network audio code component on the parent application, so that the same audio can be presented in various audio effects.

[0165] Fifth possible implementation mode:

[0166] To realize that the audio of the parent application can present a fade-in and fade-out sound effect, based on Figure 8 In the embodiment shown, in combination with reference to Figure 9 Step 820 can be replaced by the following step 820-1, and step 840 can be replaced by the following step 840-1, and the fifth possible implementation mode includes:

[0167] Step 820-1, the parent application generates a fifth audio playback event during running;

[0168] Among them, the fifth audio playback event corresponds to a fifth audio resource in the parent application.

[0169] Illustratively, the parent application generates a fifth audio playback event in response to the terminal playing a local video. The audio resource included in the local video is the fifth audio resource.

[0170] Illustratively, the parent application generates a fifth audio playback event in response to the terminal playing the audio of the third-party application. Optionally, the third-party application grants the audio playback permission to the parent application, so that the parent application can play the audio of the third-party application; optionally, the third-party application sends the fifth audio resource to the parent application, so that the parent application can play the audio of the third-party application.

[0171] At step 840-1, the parent application invokes the network audio function interface provided by the network audio code component on the parent application to perform fade-in and fade-out sound effect processing on the fifth audio resource according to the fifth audio parameter, to obtain a processed fifth audio resource.

[0172] The fifth audio parameter includes at least one of a fade-in volume size and a fade-out volume size of the fifth audio resource, and at least one of a fade-in time length and a fade-out time length of the fifth audio resource.

[0173] Illustratively, the parent application invokes the network audio function interface provided by the network audio code component on the parent application to perform fade-in and fade-out sound effect processing on the audio contained in the local video according to the fade-in volume size and the fade-out volume size, and the fade-in time length and the fade-out time length, so that the local video plays a movie-level audio effect. The fifth audio parameter can be a parameter carried by the local video, or can be a parameter pre-set by the parent application.

[0174] Illustratively, the parent application invokes the network audio function interface provided by the network audio code component on the parent application to perform fade-in and fade-out sound effect processing on the audio provided by the third-party music player according to the fade-in volume size and the fade-out volume size, and the fade-in time length and the fade-out time length, so that the connection between the two songs is smoother, and the user has a better rhythmic experience. The fifth audio parameter can be a parameter provided by the third-party application, or can be a parameter pre-set by the parent application.

[0175] To sum up, the parent application can perform fade-in and fade-out sound effect processing on the original native audio resource by invoking the fifth network audio function interface provided by the network audio code component on the parent application, thereby enriching the audio effect of the parent application.

[0176] The sixth possible implementation manner:

[0177] To enable the audio of the parent application to present a reverberation sound effect, based on Figure 8 In the embodiment, reference is made to Figure 10 Step 820 can be replaced by the following step 820-2, and step 840 can be replaced by the following step 840-2, and the sixth possible implementation manner includes:

[0178] At step 820-2, the parent application generates a sixth audio playback event during running.

[0179] The sixth audio playback event corresponds to n sixth audio resources in the parent application, and n is an integer greater than 1.

[0180] Illustratively, the parent application generates a sixth audio playback event in response to the terminal playing audio of the third-party application, and optionally, the third-party application transmits a first sixth audio resource and a second sixth audio resource to the parent application, so that the parent application can play the audio of the third-party application. It should be noted that the third-party application here is not limited to one application, but can be multiple applications that transmit audio resources to the parent application. The first sixth audio resource and the second sixth audio resource here are not limited to the same audio resource, but can be different types of audio resources. The limitation of the sixth audio resource here is only a limitation of the audio resource participating in the reverberation sound effect processing from the expression, such as the first sixth audio resource being cicadas and the second sixth audio resource being human voice.

[0181] Step 840-2, the parent application calls the network audio function interface provided by the network audio code component on the parent application to superimpose the n sixth audio resources in the time dimension to obtain the processed sixth audio resource.

[0182] Illustratively, the parent application calls the network audio function interface provided by the network audio code component on the parent application to superimpose the first sixth audio resource and the second sixth audio resource in the time dimension to obtain the processed sixth audio resource, so that the sixth audio resource after reverberation processing is rich in thickness and realism.

[0183] In summary, the parent application can implement reverberation sound effect processing on the original native audio resource by calling the sixth network audio function interface provided by the network audio code component on the parent application, thereby enriching the audio effects of the parent application.

[0184] Next, an example will be given at the code level to illustrate how the child application calls the network audio function interface provided by the network audio code component on the parent application to perform first sound effect processing on the target audio resource corresponding to the audio playback event.

[0185] First, the parent application will call the initWithJSContext method to provide the WebAudio object to the child application, and the child application will call the WebAudio audio interface provided by the parent application through the WebAudio object;

[0186] (id)initWithJSContext:{

[0187] self = [super init]; / / initialization

[0188] if (self) {

[0189] jscontext = JS_NEW_CONTEXT_FROM_RAW_PTR(context);

[0190] JS_ENTER_CONTEXT(jscontext); / / Get the current JavaScript environment

[0191] mm::JSObject parentObject = NULL;

[0192] / / Get the global object of the current environment

[0193] if (parent == NULL) {

[0194] parentObject = JS_GLOBAL_OBJECT();

[0195] }

[0196] else{

[0197] parentObject = parent;

[0198] }

[0199] / / Create the underlying audio management object

[0200] AudioMgr *audioMgr = new AudioMgr();

[0201] long mgrId = uintptr_t(audioMgr);

[0202] AudioScriptState* audioScriptState = new AudioScriptState(jscontext,mgrId);

[0203] / / Expose the underlying audio management object to JavaScript under the name "WXAUDIO"

[0204] JS_BIND_CLASS(BindingAudio);

[0205] JS_SET_CLASS(parentObject, "WXAUDIO", BindingAudio,audioScriptState);

[0206] }

[0207] return self;

[0208] }

[0209] Second, the sub-application creates a BufferSourceNode object through the createBufferSource interface provided by the parent application;

[0210] BIND_METHOD(BindingAudio::createBufferSource) {

[0211] / / Create a BindingBufferSourceNode object

[0212] JSObject audioBufferSource = JS_NEW_CLASS_INSTANCE(BindingBufferSourceNode, scriptState);

[0213] / / Return the object to JavaScript

[0214] JS_RETURN(audioBufferSource);

[0215] }

[0216] Third, after the sub-application creates the BufferSourceNode object, the sub-application can get the playbackRate attribute on the BufferSourceNode object. This attribute is used to control the playback rate of the audio, so that the audio can be played at different speeds. This attribute can be obtained through the get_playbackRate method provided by the parent application;

[0217] BIND_GET(BindingBufferSourceNode::get_playbackRate) {

[0218] / / Create a BindingAudioParam object

[0219] BindingAudioParam* audioParam = new BindingAudioParam(

[0220] / / Convert the BindingAudioParam object to a JS object

[0221] JSObject jsaudioParam = JS_WRAP(audioParam, BindingAudioParam);

[0222] / / Return the JS object to JavaScript

[0223] JS_RETURN(jsaudioParam);

[0224] }

[0225] Fourthly, the playbackRate property is actually a BindingAudioParam type in the code, and the sub-application can set the specific value through the set_value method provided by the BindingAudioParam type;

[0226] BIND_SET(BindingAudioParam::set_value) {

[0227] if(param_) {

[0228] / / Get the value parameter passed in and convert it to a float type

[0229] float float_value = JS_TO_FLOAT(NEW_VALUE());

[0230] / / Call the setValue function and pass in the float value

[0231] param_->setValue(float_value);

[0232] } else {

[0233] JS_THROW("Audio.AudioParam param is nil");

[0234] }

[0235] }

[0236] Fifthly, param corresponds to the AudioParam object implemented internally by the parent application, and the AudioParam class also provides a corresponding setValue method, which can be used by the sub-application to store the values of different properties;

[0237] void AudioParam::setValue(float value)

[0238] {

[0239] / / Save the value in the local local variable

[0240] m_value = std::clamp(value, minValue(), maxValue());

[0241] }

[0242] Step 6: Based on the completed BufferSourceNode setup, the sub-application specifies the audio output by calling the connect method of the base class BindingAudioNode of BufferSourceNode;

[0243] BIND_METHOD(BindingAudioNode::connect) {

[0244] unsigned outputIndex = 0;

[0245] unsigned inputIndex = 0;

[0246] mm::JSObject mobj =JS_TO_OBJECT(ARGS[0]);

[0247] / / Create a BindingAudioNode object

[0248] BindingAudioNode* audionode = JS_UNWRAP(mobj, BindingAudioNode);

[0249] if (ARGS_LEN() > 1) {

[0250] / / Get the outputIndex parameter

[0251] outputIndex =JS_TO_UINT32(ARGS[1]);

[0252] }

[0253] if (ARGS_LEN() > 2) {

[0254] / / Get the inputIndex parameter

[0255] inputIndex =JS_TO_UINT32(ARGS[2]);

[0256] }

[0257] / / Connect the current Node to the passed-in BindingAudioNode object.

[0258] get_Node()->connect(*(audionode->get_Node()), outputIndex,inputIndex);

[0259] JS_RETURN(0);

[0260] }

[0261] Step 7, the AudioNode class implemented in the parent application also provides a connect method, the child application can connect different nodes through the method;

[0262] ExceptionOr <void>AudioNode::connect(AudioParam¶m, unsigned outputIndex)

[0263] {

[0264] / / Get the output according to outputIndex

[0265] auto* output = this->output(outputIndex);

[0266] / / Connect the current Node to the output

[0267] param.connect(output);

[0268] return {};

[0269] }

[0270] Step 8: If the connected output source is an AudioDestinationNode, it will call the internal render method recursively. This method will fetch the input audio data based on the start marker and play it with the properties of the connected Node.

[0271] void AudioDestinationNode::render(AudioBus*, AudioBus* destinationBus, size_t numberOfFrames, const AudioIOPosition& outputPosition)

[0272] {

[0273] / / Specify the current thread environment and preprocess the task queue

[0274] context().setAudioThread(Thread::current());

[0275] context().handlePreRenderTasks(outputPosition);

[0276] / / Get the rendering pipeline

[0277] AudioBus *renderedBus = input(0)- >pull(destinationBus, numberOfFrames);

[0278] / / Update output pipeline data

[0279] if (!renderedBus)

[0280] destinationBus- >zero();

[0281] else if (renderedBus!= destinationBus) {

[0282] destinationBus- >copyFrom(*renderedBus);

[0283] }

[0284] / / Try to call process to see if there are any other properties that need to be modified

[0285] context().processAutomaticPullNodes(numberOfFrames);

[0286] / / Hold task queue

[0287] context().handlePostRenderTasks();

[0288] m_currentSampleFrame += numberOfFrames;

[0289] / / Set whether to mute

[0290] setIsSilent(destinationBus- >isSilent());

[0291] if (m_muted)

[0292] destinationBus- >zero();

[0293] }

[0294] Step 9. After connecting the output source, the child application calls the start method of BufferSourceNode and passes in the when parameter to specify the start time of playback.

[0295] BIND_METHOD(BindingBufferSourceNode::start) {

[0296] double when = 0,grainOffset = 0,grainDuration = 0;

[0297] / / Retrieve different parameters based on the number of input parameters

[0298] if(ARGS_LEN() == 1) {

[0299] when = JS_TO_DOUBLE(ARGS[0]);

[0300] } else if(ARGS_LEN() == 2) {

[0301] when = JS_TO_DOUBLE(ARGS[0]);

[0302] grainOffset = JS_TO_DOUBLE(ARGS[1]);

[0303] } else if(ARGS_LEN() == 3) {

[0304] when = JS_TO_DOUBLE(ARGS[0]);

[0305] grainOffset = JS_TO_DOUBLE(ARGS[1]);

[0306] grainDuration = JS_TO_DOUBLE(ARGS[2]);

[0307] }

[0308] / / Start playing

[0309] m_buffersourcenode.returnValue()->startLater(when, grainOffset, o_grainDuration);

[0310] JS_RETURN(0);

[0311] }

[0312] In the tenth step, the sub-application calls the startLater method of the AudioBufferSourceNode implemented in the parent application. The startLater method records the playbackRate, when, and other attributes set by the developer, and modifies the state to start playing, which triggers the process method in the eighth step to play. Based on the playbackRate (speed) and when (play start time) set by the sub-application, the playback rate and start time of each bullet are different, and the sound effect of each bullet is very close to the sound effect of the bullet in the real scene.

[0313] ExceptionOr <void>AudioBufferSourceNode::startLater(double when,double grainOffset, double grainDuration)

[0314] {

[0315] / / Assign the passed parameters to local variables

[0316] context().nodeWillBeginPlayback();

[0317] m_isGrain = true;

[0318] m_grainOffset = grainOffset;

[0319] m_grainDuration = grainDuration;

[0320] m_startTime = when;

[0321] if (buffer()) {

[0322] / / Set duration, offset, and maximum playback time

[0323] if (m_isGrain) {

[0324] double bufferDuration = buffer()->duration();

[0325] m_grainOffset = std::min(bufferDuration, grainOffset);

[0326] double maxDuration = bufferDuration - m_grainOffset;

[0327] m_grainDuration = std::min(maxDuration, grainDuration);

[0328] } else {

[0329] m_grainOffset = 0.0;

[0330] m_grainDuration = buffer()->duration();

[0331] }

[0332] / / Set playback rate

[0333] if (playbackRate().value()<0)

[0334] m_virtualReadIndex = AudioUtilities::timeToSampleFrame(m_grainOffset+ m_grainDuration, buffer()->sampleRate()) - 1;

[0335] else

[0336] m_virtualReadIndex = AudioUtilities::timeToSampleFrame(m_grainOffset,buffer()->sampleRate());

[0337] }

[0338] / / Set playback state

[0339] m_playbackState = SCHEDULED_STATE;

[0340] return {};

[0341] }

[0342] Next, take the PannerNode spatial node as an example to show the calling process.

[0343] Step 10, before step 7, the child application first creates a PannerNode object, which can be achieved by creating a Panner through the method provided by the parent application;

[0344] BIND_METHOD(BindingAudio::createPanner) {

[0345] / / Convert BindingPannerNode object to JS object

[0346] JSObject pannerNode = JS_NEW_CLASS_INSTANCE(BindingPannerNode,scriptState);

[0347] / / Return the JS object to JavaScript

[0348] JS_RETURN(pannerNode);

[0349] }

[0350] Twelfth, the class BindingPannerNode provides the get_positionX method, the child application through the get_positionX method to obtain the sound source in the entire space coordinate system X axis coordinate;

[0351] BIND_GET(BindingPannerNode::get_positionX) {

[0352] / / Create BindingAudioParam object

[0353] BindingAudioParam* audioParam = new BindingAudioParam(scriptState,&(m_pannernode.returnValue()->positionX()));

[0354] / / Convert BindingAudioParam object into JS object

[0355] JSObject jsaudioParam = JS_WRAP(audioParam, BindingAudioParam);

[0356] / / Return the JS object to JavaScript

[0357] JS_RETURN(jsaudioParam);

[0358] }

[0359] Thirteenth, similar to the playbackRate in the fourth step, positionX is also a BindingAudioParam type, the child application through the set_value method provided by the BindingAudioParam type to set the specific value, similarly, the child application also sets the positionY and positionZ values, the child application changes the position of the sound source in the space coordinate system through the setting of the three values;

[0360] In step fourteen, after setting the coordinates, the sub-application calls the connect method in step seven to connect the PannerNode to the output audio source. When the start method is called in step ten, the render method of AudioDestinationNode in step eight will trigger the process method of PannerNode to obtain the specific location information of the playback audio source. Combined with the corresponding spatial algorithm, step fourteen converts the coordinate information into a sound pressure signal of the audio source and superimposes it onto the original audio resource to play the effect of different spatial locations.

[0361] void PannerNode::process(size_t framesToProcess)

[0362] {

[0363] / / Get the output pipeline

[0364] AudioBus* destination = output(0)->bus();

[0365] Get input pipeline

[0366] AudioBus* source = input(0)->bus();

[0367] double azimuth;

[0368] double elevation

[0369] azimuthElevation(&azimuth,&elevation);

[0370] / / Calculate the sound pressure level of the sound source based on coordinates

[0371] m_panner->pan(azimuth, elevation, source, destination,framesToProcess);

[0372] / / Obtain sound pressure signal

[0373] double totalGain = distanceConeGain();

[0374] / / Set the sound pressure signal to the output line

[0375] destination->copyWithGainFrom(*destination, totalGain);

[0376] }

[0377] Figure 11 Fig. 1 shows a schematic diagram of a terminal running a sub-application according to an example embodiment of the present application.

[0378] Firstly, the terminal displays a discovery interface, and the terminal displays a sub-application interface 1120 by jumping from the "sub-application" function item in the discovery interface 1110. If there is no "sub-application" function item in the discovery interface 1110, the user can click the "magnifying glass" button in the upper right corner of the discovery interface 1110, and input the name of the sub-application, such as "dancing line", in the search box to search for the corresponding sub-application.

[0379] Then, the terminal starts the sub-game in response to the user clicking "dancing line" in the sub-application interface 1120.

[0380] Next, the terminal displays a start interface 1130 of "dancing line".

[0381] Finally, the terminal displays a loading interface 1140 of "dancing line", and the terminal starts playing the audio of the sub-game.

[0382] Figure 12 Fig. 12 shows a flowchart of a method for a developer developing a sub-game according to an example embodiment of the present application. The method comprises:

[0383] Step 1201, the developer logs in a developer account on a developer.

[0384] The developer applies for and logs in the developer account, and downloads the developer tool provided by the parent application.

[0385] Step 1202, the developer starts developing the sub-game.

[0386] After the developer determines the type and style of the game, the developer develops the game interface.

[0387] Step 1203, the developer applies for using the WebAudio permission.

[0388] The developer confirms to use the WebAudio audio interface provided by the parent application, and applies for using the WebAudio permission to the development team of the parent application.

[0389] Step 1204, the developer obtains the WebAudio permission.

[0390] After the developer obtains the WebAudio permission, the developer can call the WebAudio audio interface.

[0391] Step 1205, the developer adjusts the playing time of the audio.

[0392] The developer can adjust the playing time of the in-game audio. For example, if the mini-game is a shooting game, the developer can adjust the playing time of the sound effect of each bullet shooting to simulate the sound of real-world gunshots.

[0393] In step 1206, the developer superimposes environmental sound effects on the audio.

[0394] The developer can superimpose environmental sound effects on the in-game audio. For example, if the mini-game is a battle royale game, the developer can superimpose environmental sound effects through the ConvolverNode interface to simulate different environmental footstep sounds, such as footstep sounds on sand and footstep sounds on grass.

[0395] In step 1207, the developer combines the positions of game elements and superimposes spatial coordinates to achieve spatial sound effects.

[0396] The developer can implement spatial sound effects on the in-game audio. For example, if the mini-game is a battle royale game, the developer can use the PannerNode interface to input the position information of other players and combine spatial positioning algorithms to emit different sound waves, simulating the effect of sound localization in a real environment.

[0397] In step 1208, the developer tests the completed mini-game.

[0398] After the developer completes the mini-game development, the developer sends the mini-game to the parent application for testing. After the testing is completed, the mini-game can be officially launched.

[0399] In step 1209, the developer publishes the tested mini-game on the parent application platform.

[0400] The developer publishes the tested mini-game on the parent application platform.

[0401] Figure 13 A structural block diagram of an audio playing device provided by an example embodiment of the present application is shown. The device runs a parent application and a child application, the child application is a program that depends on the parent application to run, the parent application includes a Web Audio code component, and the device includes:

[0402] The generating module 1301 is configured to generate an audio playing event during running, and the audio playing event corresponds to a target audio resource in an audio resource package of the child application;

[0403] The processing module 1302 is configured to call a Web Audio function interface provided by the Web Audio code component on the parent application to perform first sound effect processing on the target audio resource corresponding to the audio playing event, and obtain a processed target audio resource.

[0404] The output module 1303 is configured to output the processed target audio resource to an audio playing component of the terminal for playing.

[0405] In an optional embodiment, the first sound effect processing includes at least one of the following processing:

[0406] environmental sound effect processing of the target audio resource;

[0407] spatial sound effect processing of the target audio resource;

[0408] delayed playing processing of the target audio resource;

[0409] variable speed playing processing of the target audio resource.

[0410] In an optional embodiment, the generation module 1301 is further configured to generate a first audio playing event during the running process, the first audio resource in the first audio playing event being determined based on the behavior of the first virtual role, and the first sound effect resource in the first audio playing event being determined based on the virtual environment in which the first virtual role is located.

[0411] In an optional embodiment, the processing module 1302 is further configured to call a first network audio function interface provided by the network audio code component on the parent application, and perform superposition fitting on the first audio resource according to the first sound effect resource, to obtain the processed first audio resource.

[0412] In an optional embodiment, the generation module 1301 is further configured to generate a second audio playing event during the running process, the second audio resource in the second audio playing event being determined based on the behavior of the second virtual role.

[0413] In an optional embodiment, the processing module 1302 is further configured to call a second network audio function interface provided by the network audio code component on the parent application, and simulate playing of the second audio resource on a sound source corresponding to the spatial coordinates of the second virtual object in the three-dimensional space, to obtain the processed second audio resource.

[0414] In an optional embodiment, the generation module 1301 is further configured to generate a third audio playing event during the running process, the third audio resource and the delay playing time length in the third audio playing event being determined based on the behavior of the first virtual role.

[0415] In an optional embodiment, the processing module 1302 is further configured to call a third network audio function interface provided by the network audio code component on the parent application, and perform processing on the third audio resource according to the delay playing time length, to obtain the processed third audio resource.

[0416] In an optional embodiment, the generating module 1301 is further configured to generate a fourth audio playback event during the running process, and a fourth audio resource and a playback multiple in the fourth audio playback event are determined based on the behavior of the first virtual role.

[0417] In an optional embodiment, the processing module 1302 is further configured to call a fourth network audio function interface provided by the network audio code component on the parent application, and process the fourth audio resource according to the playback multiple, to obtain a processed fourth audio resource.

[0418] In an optional embodiment, the generating module 1301 is further configured to generate a native audio playback event during the running process, and the native audio playback event corresponds to a native audio resource in the parent application.

[0419] In an optional embodiment, the processing module 1302 is further configured to call a network audio function interface provided by the network audio code component on the parent application, and perform a second sound effect processing on the native audio resource, to obtain a processed native audio resource.

[0420] In an optional embodiment, the output module 1303 is further configured to output the processed native audio resource to an audio playback component of the terminal for playback.

[0421] In an optional embodiment, the generating module 1301 is further configured to generate a fifth audio playback event during the running process, and the fifth audio playback event corresponds to a fifth audio resource in the parent application.

[0422] In an optional embodiment, the processing module 1302 is further configured to call a network audio function interface provided by the network audio code component on the parent application, and perform a fade-in and fade-out sound effect processing on the fifth audio resource according to a fifth audio parameter, to obtain a processed fifth audio resource, the fifth audio parameter includes at least one of a fade-in volume size and a fade-out volume size of the fifth audio resource, and the fifth audio parameter further includes at least one of a fade-in time length and a fade-out time length of the fifth audio resource.

[0423] In an optional embodiment, the generating module 1301 is further configured to generate a sixth audio playback event during the running process, and the sixth audio playback event corresponds to n sixth audio resources in the parent application.

[0424] In an optional embodiment, the processing module 1302 is further configured to call a network audio function interface provided by the network audio code component on the parent application, and superimpose the n sixth audio resources in a time dimension, to obtain a processed sixth audio resource.

[0425] In an optional embodiment, the native audio playback event includes at least one of playing a video, playing a live broadcast, and playing in virtual reality (VR).

[0426] In summary, the above device can perform sound effect processing on the audio resource by calling the network audio function interface provided by the network audio code component of the parent application, so that the audio of the child application can be expressed in various audio effects. In addition, the standard network audio function interface introduced by the parent application can reduce the migration difficulty of mature products from the web page end to the child application end.

[0427] In addition, through the network audio function interface provided by the parent application, the terminal audio playback component only needs to perform audio processing on the parent application platform for each time of playing the audio resource on the premise that the child application meets the requirement of being used without downloading, and the audio playback component can quickly obtain and play the target audio resource after processing.

[0428] Figure 14 A structural block diagram of a computer device 1400 provided by an example embodiment of the present application is shown. The computer device 1400 can be a portable mobile terminal, such as a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV) player, a notebook computer, or a desktop computer. The computer device 1400 can also be referred to as a user device, a portable terminal, a laptop terminal, a desktop terminal, or other names.

[0429] Generally, the computer device 1400 includes a processor 1401 and a memory 1402.

[0430] The processor 1401 can include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 1401 can be implemented in at least one of a hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), a PLA (Programmable Logic Array). The processor 1401 can also include a main processor and a coprocessor, the main processor being a processor for processing data in an awake state, also referred to as a CPU (Central Processing Unit), and the coprocessor being a low-power processor for processing data in a standby state. In some embodiments, the processor 1401 can be integrated with a GPU (Graphics Processing Unit) for rendering and drawing content required to be displayed by the display screen. In some embodiments, the processor 1401 can further include an AI (Artificial Intelligence) processor for processing computing operations related to machine learning.

[0431] The memory 1402 can include one or more computer-readable storage media that can be non-transitory. The memory 1402 can also include a high-speed random access memory, and a nonvolatile memory such as one or more disk storage devices, flash storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1402 is used to store at least one instruction for being executed by the processor 1401 to implement the audio playing method provided by the method embodiments in the present application.

[0432] In some embodiments, the computer device 1400 can also optionally include a peripheral device interface 1403 and at least one peripheral device. The processor 1401, the memory 1402, and the peripheral device interface 1403 can be connected through a bus or a signal line. Each peripheral device can be connected to the peripheral device interface 1403 through a bus, a signal line, or a circuit board. For example, the peripheral device can include at least one of a radio frequency circuit 1404, a display screen 1405, a camera assembly 1406, an audio circuit 1407, and a power supply 1408.

[0433] The peripheral interface 1403 can be used to connect at least one I / O (Input / Output) related peripheral device to the processor 1401 and the memory 1402. In some embodiments, the processor 1401, the memory 1402 and the peripheral interface 1403 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 1401, the memory 1402 and the peripheral interface 1403 can be implemented on a separate chip or circuit board, and the present embodiments are not limited in this regard.

[0434] The radio frequency circuit 1404 is used to receive and send RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 1404 communicates with a communication network and other communication devices through electromagnetic signals. The radio frequency circuit 1404 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the radio frequency circuit 1404 includes an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and the like. The radio frequency circuit 1404 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes but is not limited to the World Wide Web, a metropolitan area network, an intranet, various generations of mobile communication networks (2G, 3G, 4G and 14G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 1404 can also include NFC (Near Field Communication) related circuitry, and the present application is not limited in this regard.

[0435] The display screen 1405 is configured to display a UI (User Interface). The UI can include graphics, text, icons, video, and any combination thereof. When the display screen 1405 is a touch display screen, the display screen 1405 is further configured to capture touch signals on or above the surface of the display screen 1405. The touch signals can be input to the processor 1401 as control signals for processing. In this case, the display screen 1405 can also be configured to provide virtual buttons and / or virtual keyboard, also known as soft buttons and / or soft keyboard. In some embodiments, the display screen 1405 can be one, disposed on the front panel of the computer device 1400; in other embodiments, the display screen 1405 can be at least two, respectively disposed on different surfaces of the computer device 1400 or in a folding design; in other embodiments, the display screen 1405 can be a flexible display screen, disposed on a curved surface or a folding surface of the computer device 1400. Even, the display screen 1405 can also be disposed in an irregular shape, i.e. a special-shaped screen. The display screen 1405 can be made of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), etc.

[0436] The camera assembly 1406 is configured to capture images or videos. Optionally, the camera assembly 1406 includes a front camera and a rear camera. Typically, the front camera is disposed on the front panel of the terminal, and the rear camera is disposed on the back of the terminal. In some embodiments, the rear camera is at least two, which is any one of a main camera, a depth-of-field camera, a wide-angle camera, and a long-focus camera, to realize the background blur function of the main camera and the depth-of-field camera, the panoramic shooting and VR (Virtual Reality) shooting function of the main camera and the wide-angle camera, or other fusion shooting functions. In some embodiments, the camera assembly 1406 can further include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. The dual-color temperature flash refers to the combination of a warm light flash and a cold light flash, which can be used for light compensation under different color temperatures.

[0437] The audio circuit 1407 can include a microphone and a speaker. The microphone is used to collect sound waves of the user and the environment, and convert the sound waves into an electrical signal input to the processor 1401 for processing, or input to the radio frequency circuit 1404 to realize voice communication. For the purpose of stereo sound collection or noise reduction, the microphone can be multiple, respectively arranged at different parts of the computer device 1400. The microphone can also be an array microphone or an omnidirectional collection type microphone. The speaker is used to convert the electrical signal from the processor 1401 or the radio frequency circuit 1404 into sound waves. The speaker can be a traditional diaphragm speaker, or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, not only can it convert electrical signals into sound waves that humans can hear, but it can also convert electrical signals into sound waves that humans cannot hear for ranging purposes. In some embodiments, the audio circuit 1407 can also include a headphone jack.

[0438] The power supply 1408 is used to supply power to various components in the computer device 1400. The power supply 1408 can be alternating current, direct current, disposable battery or rechargeable battery. When the power supply 1408 includes a rechargeable battery, the rechargeable battery can be a wired charging battery or a wireless charging battery. The wired charging battery is a battery that is charged through a wired line, and the wireless charging battery is a battery that is charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.

[0439] In some embodiments, the computer device 1400 further includes one or more sensors 1409. The one or more sensors 1409 include, but are not limited to, an acceleration sensor 1410, a gyroscope sensor 1411, a pressure sensor 1412, an optical sensor 1413, and a proximity sensor 1414.

[0440] The acceleration sensor 1410 can detect the acceleration magnitude in three coordinate axes of the coordinate system established by the computer device 1400. For example, the acceleration sensor 1410 can be used to detect the components of the gravitational acceleration in three coordinate axes. The processor 1401 can control the display screen 1405 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 1410. The acceleration sensor 1410 can also be used for game or user motion data collection.

[0441] The gyroscope sensor 1411 can detect the body orientation and rotation angle of the computer device 1400, and the gyroscope sensor 1411 can collect 3D actions of the user on the computer device 1400 in cooperation with the acceleration sensor 1410. The processor 1401 can realize the following functions according to the data collected by the gyroscope sensor 1411: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization when shooting, game control, and inertial navigation.

[0442] The pressure sensor 1412 is arranged at the side frame of the computer device 1400 and / or the lower layer of the display screen 1405. When the pressure sensor 1412 is arranged at the side frame of the computer device 1400, the holding signal of the user to the computer device 1400 can be detected, and the left-hand or right-hand recognition or shortcut operation is performed by the processor 1401 according to the holding signal collected by the pressure sensor 1412. When the pressure sensor 1412 is arranged at the lower layer of the display screen 1405, the operable control on the UI interface is controlled by the processor 1401 according to the pressure operation of the user to the display screen 1405. The operable control includes at least one of a button control, a scroll bar control, an icon control, and a menu control.

[0443] The optical sensor 1413 is used to collect the ambient light intensity. In an embodiment, the processor 1401 can control the display brightness of the display screen 1405 according to the ambient light intensity collected by the optical sensor 1413. For example, when the ambient light intensity is high, the display brightness of the display screen 1405 is increased; when the ambient light intensity is low, the display brightness of the display screen 1405 is decreased. In another embodiment, the processor 1401 can also dynamically adjust the shooting parameter of the camera assembly 1406 according to the ambient light intensity collected by the optical sensor 1416.

[0444] The proximity sensor 1414, also referred to as a distance sensor, is usually arranged at the front panel of the computer device 1400. The proximity sensor 1414 is used to collect the distance between the user and the front of the computer device 1400. In an embodiment, when the proximity sensor 1414 detects that the distance between the user and the front of the computer device 1400 gradually decreases, the display screen 1405 is switched from the bright screen state to the screen-off state by the processor 1401; when the proximity sensor 1414 detects that the distance between the user and the front of the computer device 1400 gradually increases, the display screen 1405 is switched from the screen-off state to the bright screen state by the processor 1401.

[0445] Those skilled in the art can understand that the structure shown in the above embodiments is not a limitation on the computer device 1400, and the computer device 1400 can include more or fewer components than those shown in the figure, or combine certain components, or adopt a different component arrangement. Figure 14 The present application also provides a computer readable storage medium, wherein at least one instruction, at least one program, a code set or an instruction set is stored in the storage medium, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the audio playing method provided by the above method embodiments.

[0446]

[0447] ​The application provides a computer program product or computer program, which comprises computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the audio playing method provided in the method embodiments.

[0448] The above-mentioned sequence numbers of the embodiments of the application are only for description, and do not represent advantages or disadvantages of the embodiments.

[0449] Those skilled in the art can understand that all or part of the steps of the above-mentioned embodiments can be completed by hardware, or can be instructed by a program to complete the related hardware, and the program can be stored in a computer readable storage medium. The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk.

[0450] The above-mentioned is only optional embodiment of the application, and does not limit the application. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the application shall be included in the protection scope of the application.< / void> < / void>

Claims

1. An audio playback method, characterized by, The method is executed by a terminal, a parent application and a child application are run in the terminal, the child application is a program dependent on the parent application, the parent application comprises a Web Audio code component, and the method comprises: The child application generates an audio playback event during running, and the audio playback event corresponds to a target audio resource in an audio resource package of the child application; The child application calls a Web Audio function interface provided by the Web Audio code component on the parent application, performs first sound effect processing on the target audio resource corresponding to the audio playback event, and obtains a processed target audio resource; The Web Audio code component outputs the processed target audio resource to an audio playback component of the terminal for playback; The parent application generates a native audio playback event during running, and the native audio playback event corresponds to a native audio resource in the parent application; the native audio resource is an audio resource corresponding to a local video of the terminal or an audio resource of a third-party application; The parent application calls a Web Audio function interface provided by the Web Audio code component on the parent application, performs second sound effect processing on the native audio resource, and obtains a processed native audio resource; The Web Audio code component outputs the processed native audio resource to an audio playback component of the terminal for playback.

2. The method of claim 1, wherein, The first sound effect processing comprises at least one of the following processing: Ambient sound effect processing of the target audio resource; Spatial sound effect processing of the target audio resource; Delay playback processing of the target audio resource; Variable speed playback processing of the target audio resource.

3. The method of claim 2, wherein, The first sound effect processing comprises ambient sound effect processing of the target audio resource; The child application generates an audio playback event during running, comprising: The child application generates a first audio playback event during running, a first audio resource in the first audio playback event is determined based on a behavior of a first virtual character, and a first sound effect resource in the first audio playback event is determined based on a virtual environment in which the first virtual character is located; The child application calls a Web Audio function interface provided by the Web Audio code component on the parent application, performs first sound effect processing on the target audio resource corresponding to the audio playback event, and obtains a processed target audio resource, comprising: The child application calls a first Web Audio function interface provided by the Web Audio code component on the parent application, superimposes and fits the first audio resource according to the first sound effect resource, and obtains a processed first audio resource.

4. The method of claim 2, wherein, The first sound effect processing comprises spatial sound effect processing of the target audio resource; The child application generates an audio playback event during running, comprising: The child application generates a second audio playback event during running, a second audio resource in the second audio playback event is determined based on a behavior of a second virtual character; The sub-application calls a network audio function interface provided by the network audio code component on the parent application, performs first sound effect processing on the target audio resource corresponding to the audio playback event, and obtains a processed target audio resource, including: The sub-application calls a second network audio function interface provided by the network audio code component on the parent application, simulates playing the second audio resource on a sound source corresponding to the spatial coordinates of the second virtual role in three-dimensional space, and obtains a processed second audio resource.

5. The method of claim 2, wherein, The first sound effect processing includes delay playback processing of the target audio resource; The sub-application generates an audio playback event during running, including: The sub-application generates a third audio playback event during running, and a third audio resource and a delay playback duration in the third audio playback event are determined based on the behavior of the first virtual role; The sub-application calls a network audio function interface provided by the network audio code component on the parent application, performs first sound effect processing on the target audio resource corresponding to the audio playback event, and obtains a processed target audio resource, including: The sub-application calls a third network audio function interface provided by the network audio code component on the parent application, processes the third audio resource according to the delay playback duration, and obtains a processed third audio resource.

6. The method of claim 2, wherein, The first sound effect processing includes variable speed playback processing of the target audio resource; The sub-application generates an audio playback event during running, including: The sub-application generates a fourth audio playback event during running, and a fourth audio resource and a playback speed in the fourth audio playback event are determined based on the behavior of the first virtual role; The sub-application calls a network audio function interface provided by the network audio code component on the parent application, performs first sound effect processing on the target audio resource corresponding to the audio playback event, and obtains a processed target audio resource, including: The sub-application calls a fourth network audio function interface provided by the network audio code component on the parent application, processes the fourth audio resource according to the playback speed, and obtains a processed fourth audio resource.

7. The method of claim 1, wherein, The second sound effect processing includes fade-in and fade-out sound effect processing of the native audio resource; The parent application generates a native audio playback event during running, and the native audio playback event corresponds to a native audio resource in the parent application, including: The parent application generates a fifth audio playback event during running, and the fifth audio playback event corresponds to a fifth audio resource in the parent application; The parent application calls a network audio function interface provided by the network audio code component on the parent application, performs second sound effect processing on the native audio resource, and obtains a processed native audio resource, including: The parent application calls a network audio function interface provided by the network audio code component on the parent application, and performs a fade-in and fade-out sound effect processing on the fifth audio resource according to a fifth audio parameter, to obtain a processed fifth audio resource, the fifth audio parameter including at least one of a fade-in volume size and a fade-out volume size of the fifth audio resource, and the fifth audio parameter further including at least one of a fade-in time length and a fade-out time length of the fifth audio resource.

8. The method of claim 1, wherein, The second sound effect processing includes a reverberation sound effect processing of the native audio resource. The parent application generates a native audio playback event during running, and a sixth audio playback event corresponds to n sixth audio resources in the parent application, n being an integer greater than 1. The parent application calls a network audio function interface provided by the network audio code component on the parent application, and performs a second sound effect processing on the native audio resource to obtain a processed native audio resource, including: The parent application calls a network audio function interface provided by the network audio code component on the parent application, and performs a second sound effect processing on the native audio resource to obtain a processed native audio resource, including: The native audio playback event includes at least one of playing a video, playing a live broadcast, and playing virtual reality (VR).

9. The method of claim 1, wherein, The device runs a parent application and a child application, the child application is a program dependent on the parent application, the parent application includes a Web Audio (WebAudio) code component, and the device includes:

10. An audio playback device, characterized by A generation module configured to generate an audio playback event during running, the audio playback event corresponding to a target audio resource in an audio resource package of the child application; A processing module configured to call a network audio function interface provided by the network audio code component on the parent application, and perform a first sound effect processing on the target audio resource corresponding to the audio playback event to obtain a processed target audio resource; An output module configured to output the processed target audio resource to an audio playback component of the device for playback; The generation module is configured to generate a native audio playback event during running of the parent application, and the native audio playback event corresponds to a native audio resource in the parent application; the native audio resource is an audio resource corresponding to a local video of the terminal or an audio resource of a third-party application; The processing module is configured to call a network audio function interface provided by the network audio code component on the parent application, and perform a second sound effect processing on the native audio resource to obtain a processed native audio resource; The output module is configured to output the processed native audio resource to an audio playback component of the terminal for playback. The first sound effect processing includes at least one of the following processes:

11. The apparatus of claim 10, wherein, ​ Ambience effect processing of the target audio resource; Reverberation effect processing of the target audio resource; Delay playback processing of the target audio resource; Variable speed playback processing of the target audio resource.

12. A computer device, comprising: The computer device comprises a processor and a memory, and the memory stores a computer program, which is loaded and executed by the processor to implement the audio playback method according to any one of claims 1 to 9.

13. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, which is loaded and executed by a processor to implement the audio playback method according to any one of claims 1 to 9.

14. A computer program product, characterised in that, The computer program product stores computer instructions, which are stored in a computer readable storage medium, and a processor reads the computer instructions from the computer readable storage medium, and the computer instructions are loaded and executed by the processor to implement the audio playback method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Information processing method, device and equipment in virtual scene and storage medium

    CN112044053A

  • Audio processing method, storage medium and electronic equipment

    CN112860213A