Audio playing method and device

文档序号:1861303 发布日期:2021-11-19 浏览:7次 中文

阅读说明:本技术 一种音频播放方法及装置 (Audio playing method and device ) 是由 黄申 于 2021-08-23 设计创作,主要内容包括:本公开提供了一种音频播放方法及装置,首先获取针对目标音效的音效播放请求;然后,在所述目标音效对应的音频文件处于可播放状态后,基于所述目标音效对应的最大延迟响应时长、获取到所述音效播放请求的初始时间节点以及当前时间节点,确定是否响应所述音效播放请求;最后,在确定响应所述音效播放请求的情况下,播放所述音频文件。本公开实施方式通过目标音效对应的最大延迟影响时长、获取到音效播放请求的初始节点及当前节点确定是否响应音效播放请求,使得播放音效时更符合当前场景,提高用户体验。(The present disclosure provides an audio playing method and apparatus, first obtaining a sound effect playing request for a target sound effect; then, after the audio file corresponding to the target sound effect is in a playable state, determining whether to respond to the sound effect playing request or not based on the maximum delay response time corresponding to the target sound effect, the initial time node for acquiring the sound effect playing request and the current time node; and finally, under the condition that the sound effect playing request is determined to be responded, playing the audio file. According to the method and the device, whether the sound effect playing request is responded or not is determined through the maximum delay influence duration corresponding to the target sound effect, the initial node obtaining the sound effect playing request and the current node, so that the sound effect is played more in accordance with the current scene, and the user experience is improved.)

1. An audio playing method, comprising:

acquiring a sound effect playing request aiming at a target sound effect;

after the audio file corresponding to the target sound effect is in a playable state, determining whether to respond to the sound effect playing request or not based on the maximum delay response time corresponding to the target sound effect, the initial time node for obtaining the sound effect playing request and the current time node;

and under the condition that the sound effect playing request is determined to be responded, playing the audio file.

2. The method of claim 1, wherein the audio file is obtained by:

when the sound effect playing request aiming at the target sound effect is obtained or a loading time node corresponding to the target sound effect is reached, downloading an audio file corresponding to the target sound effect from a resource server;

the method further comprises the following steps:

and when the audio file is downloaded, determining that the audio file is in a playable state.

3. The method according to claim 1, wherein the determining whether to respond to the sound effect playing request based on the maximum delay response time corresponding to the target sound effect, the initial time node at which the sound effect playing request is acquired, and the current time node comprises:

determining a time interval between a current time node and an initial time node for acquiring the sound effect playing request;

and determining to respond to the sound effect playing request under the condition that the maximum delay response time length is greater than or equal to the time interval and a playing stopping request aiming at the target sound effect is not acquired in a time period between the current time node and an initial time node for acquiring the sound effect playing request.

4. The method according to claim 1, wherein the determining whether to respond to the sound effect playing request based on the maximum delay response time corresponding to the target sound effect, the initial time node at which the sound effect playing request is acquired, and the current time node comprises:

setting an overtime timer for the sound effect playing request at an initial time node for acquiring the sound effect playing request;

and determining a time accumulation variable corresponding to the current time node by the overtime timer, and determining to respond to the sound effect playing request under the condition that the maximum delay response time length is greater than or equal to the time accumulation variable and a playing stopping request aiming at the target sound effect is not acquired in a time period between the current time node and the time node acquiring the sound effect playing request.

5. The method of claim 1, further comprising:

and determining the maximum delay response time length based on the audio time length of the audio file corresponding to the target sound effect and a preset delay weight.

6. The method of claim 2, wherein the audio file is an audio file in a target audio group; when the audio file is downloaded, determining that the audio file is in a playable state includes:

and when at least one audio file which is downloaded completely exists in the target audio group, determining that the audio file which is downloaded completely in the target audio group is in a playable state.

7. The method according to claim 5, wherein the playing the audio file corresponding to the sound effect playing request comprises:

randomly playing any audio file in at least one downloaded audio file in the target audio group; alternatively, the first and second electrodes may be,

and playing the audio file which is downloaded at the earliest time in the target audio group according to the download completion time corresponding to at least one audio file which is downloaded completely in the target audio group.

8. The method according to any one of claims 1-7, wherein the target sound effect is a sound effect in a webpage based on hypertext HTML5 standard.

9. An audio playback apparatus, comprising:

the acquisition module is used for acquiring a sound effect playing request aiming at a target sound effect;

the determining module is used for determining whether to respond to the sound effect playing request or not based on the maximum delay response duration corresponding to the target sound effect, the initial time node for acquiring the sound effect playing request and the current time node after the audio file corresponding to the target sound effect is in a playable state;

and the playing module is used for playing the audio file under the condition of determining to respond to the sound effect playing request.

10. An electronic device, comprising: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating via the bus when the electronic device is operating, the machine-readable instructions when executed by the processor performing the steps of the audio playback method according to any one of claims 1 to 8.

11. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the audio playback method according to one of claims 1 to 8.

Technical Field

The present disclosure relates to the field of computer technologies, and in particular, to an audio playing method and apparatus.

Background

Hyper Text Markup Language (HTML) is a Markup Language, and can unify the format of documents on a network through a series of tags, so that scattered network resources are connected into a logic whole. HTML text is descriptive text consisting of HTML commands, HTML5 is a specification of the core language HTML in the Web, and a netpage game under the HTML5 specification is also called H5 game.

In scenes such as an H5 game, static resources such as audio are usually stored in a server, and a browser needs to download these files from the server to a local area before use, and since the file size of an audio file is usually large, the time consumption for downloading the audio file is long, and the audio file may not be downloaded successfully when the audio file needs to be played, the audio is delayed when the audio file needs to be played, and the user experience is poor.

Disclosure of Invention

The embodiment of the disclosure at least provides an audio playing method and device.

In a first aspect, an embodiment of the present disclosure provides an audio playing method, including:

acquiring a sound effect playing request aiming at a target sound effect;

after the audio file corresponding to the target sound effect is in a playable state, determining whether to respond to the sound effect playing request or not based on the maximum delay response time corresponding to the target sound effect, the initial time node for obtaining the sound effect playing request and the current time node;

and under the condition that the sound effect playing request is determined to be responded, playing the audio file.

In an alternative embodiment, the audio file is obtained by:

when the sound effect playing request aiming at the target sound effect is obtained or a loading time node corresponding to the target sound effect is reached, downloading an audio file corresponding to the target sound effect from a resource server;

the method further comprises the following steps:

and when the audio file is downloaded, determining that the audio file is in a playable state.

In an optional implementation manner, the determining whether to respond to the sound effect playing request based on the maximum delay response time corresponding to the target sound effect, the initial time node at which the sound effect playing request is obtained, and the current time node includes:

determining a time interval between a current time node and an initial time node for acquiring the sound effect playing request;

and determining to respond to the sound effect playing request under the condition that the maximum delay response time length is greater than or equal to the time interval and a playing stopping request aiming at the target sound effect is not acquired in a time period between the current time node and an initial time node for acquiring the sound effect playing request.

In an optional implementation manner, the determining whether to respond to the sound effect playing request based on the maximum delay response time corresponding to the target sound effect, the initial time node at which the sound effect playing request is obtained, and the current time node includes:

setting an overtime timer for the sound effect playing request at an initial time node for acquiring the sound effect playing request;

and determining a time accumulation variable corresponding to the current time node by the overtime timer, and determining to respond to the sound effect playing request under the condition that the maximum delay response time length is greater than or equal to the time accumulation variable and a playing stopping request aiming at the target sound effect is not acquired in a time period between the current time node and the time node acquiring the sound effect playing request.

In an optional embodiment, the method further comprises:

and determining the maximum delay response time length based on the audio time length of the audio file corresponding to the target sound effect and a preset delay weight.

In an optional embodiment, the audio file is an audio file in a target audio group; when the audio file is downloaded, determining that the audio file is in a playable state includes:

and when at least one audio file which is downloaded completely exists in the target audio group, determining that the audio file which is downloaded completely in the target audio group is in a playable state.

In an optional implementation manner, the playing the audio file corresponding to the sound effect playing request includes:

randomly playing any audio file in at least one downloaded audio file in the target audio group; alternatively, the first and second electrodes may be,

and playing the audio file which is downloaded at the earliest time in the target audio group according to the download completion time corresponding to at least one audio file which is downloaded completely in the target audio group.

In an alternative embodiment, the target sound effect is a sound effect in a webpage based on the hypertext HTML5 standard.

In a second aspect, an embodiment of the present disclosure further provides an audio playing apparatus, including:

the acquisition module is used for acquiring a sound effect playing request aiming at a target sound effect;

the determining module is used for determining whether to respond to the sound effect playing request or not based on the maximum delay response duration corresponding to the target sound effect, the initial time node for acquiring the sound effect playing request and the current time node after the audio file corresponding to the target sound effect is in a playable state;

and the playing module is used for playing the audio file under the condition of determining to respond to the sound effect playing request.

In an optional embodiment, the apparatus further comprises a downloading module configured to:

when the sound effect playing request aiming at the target sound effect is obtained or a loading time node corresponding to the target sound effect is reached, downloading an audio file corresponding to the target sound effect from a resource server;

the determination module is further to:

and when the audio file is downloaded, determining that the audio file is in a playable state.

In an optional implementation manner, the determining module is specifically configured to:

determining a time interval between a current time node and an initial time node for acquiring the sound effect playing request;

and determining to respond to the sound effect playing request under the condition that the maximum delay response time length is greater than or equal to the time interval and a playing stopping request aiming at the target sound effect is not acquired in a time period between the current time node and an initial time node for acquiring the sound effect playing request.

In an optional implementation manner, when determining whether to respond to the sound effect playing request based on the maximum delay response duration corresponding to the target sound effect, the initial time node at which the sound effect playing request is acquired, and the current time node, the determining module is configured to:

setting an overtime timer for the sound effect playing request at an initial time node for acquiring the sound effect playing request;

and determining a time accumulation variable corresponding to the current time node by the overtime timer, and determining to respond to the sound effect playing request under the condition that the maximum delay response time length is greater than or equal to the time accumulation variable and a playing stopping request aiming at the target sound effect is not acquired in a time period between the current time node and the time node acquiring the sound effect playing request.

In an optional embodiment, the determining module is further configured to:

and determining the maximum delay response time length based on the audio time length of the audio file corresponding to the target sound effect and a preset delay weight.

In an optional embodiment, the audio file is an audio file in a target audio group; the determining module is configured to, when determining that the audio file is in a playable state when the audio file is downloaded,:

and when at least one audio file which is downloaded completely exists in the target audio group, determining that the audio file which is downloaded completely in the target audio group is in a playable state.

In an optional implementation manner, when playing an audio file corresponding to the sound effect playing request, the playing module is configured to:

randomly playing any audio file in at least one downloaded audio file in the target audio group; alternatively, the first and second electrodes may be,

and playing the audio file which is downloaded at the earliest time in the target audio group according to the download completion time corresponding to at least one audio file which is downloaded completely in the target audio group.

In an alternative embodiment, the target sound effect is a sound effect in a webpage based on the hypertext HTML5 standard.

In a third aspect, an embodiment of the present disclosure further provides an electronic device, including: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating via the bus when the electronic device is running, the machine-readable instructions when executed by the processor performing the steps of the first aspect described above, or any possible implementation of the first aspect.

In a fourth aspect, this disclosed embodiment also provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the steps in the first aspect or any one of the possible implementation manners of the first aspect.

The audio playing method and the audio playing device provided by the embodiment of the disclosure firstly obtain a sound effect playing request aiming at a target sound effect; then, after the audio file corresponding to the target sound effect is in a playable state, determining whether to respond to the sound effect playing request or not based on the maximum delay response time corresponding to the target sound effect, the initial time node for acquiring the sound effect playing request and the current time node; and finally, under the condition that the sound effect playing request is determined to be responded, playing the audio file. According to the method and the device, whether the sound effect playing request is responded or not is determined through the maximum delay influence duration corresponding to the target sound effect, the initial node obtaining the sound effect playing request and the current node, so that the sound effect is played more in accordance with the current scene, and the user experience is improved.

In order to make the aforementioned objects, features and advantages of the present disclosure more comprehensible, preferred embodiments accompanied with figures are described in detail below.

Drawings

In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the embodiments will be briefly described below, and the drawings herein incorporated in and forming a part of the specification illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the technical solutions of the present disclosure. It is appreciated that the following drawings depict only certain embodiments of the disclosure and are therefore not to be considered limiting of its scope, for those skilled in the art will be able to derive additional related drawings therefrom without the benefit of the inventive faculty.

Fig. 1 shows a flowchart of an audio playing method provided by an embodiment of the present disclosure;

FIG. 2 illustrates an audio management system provided by an embodiment of the present disclosure;

fig. 3 is a schematic diagram of an audio playing apparatus provided in an embodiment of the present disclosure;

fig. 4 shows a schematic diagram of an electronic device provided by an embodiment of the present disclosure.

Detailed Description

In order to make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are only a part of the embodiments of the present disclosure, not all of the embodiments. The components of the embodiments of the present disclosure, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present disclosure, presented in the figures, is not intended to limit the scope of the claimed disclosure, but is merely representative of selected embodiments of the disclosure. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the disclosure without making creative efforts, shall fall within the protection scope of the disclosure.

It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.

The term "and/or" herein merely describes an associative relationship, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of A, B, C, and may mean including any one or more elements selected from the group consisting of A, B and C.

Research shows that in scenes such as an H5 game, static resources such as audio are usually stored on a server, and a browser can use the files after downloading the files from the server to the local, and because the file volume of the audio file is usually large, the time consumption for downloading the audio file is long, the audio file may not be successfully downloaded when the audio file needs to be played, and the audio is delayed when the audio file needs to be played after being downloaded, so that the user experience is poor.

Based on the research, the audio playing method determines whether to respond to the sound effect playing request through the maximum delay influence duration corresponding to the target sound effect, the initial node obtaining the sound effect playing request and the current node, so that the sound effect playing method is more consistent with the current scene, and the user experience is improved.

To facilitate understanding of the present embodiment, first, an audio playing method disclosed in the embodiments of the present disclosure is described in detail, where an execution subject of the audio playing method provided in the embodiments of the present disclosure is generally a computer device with certain computing capability, and the computer device may run a browser.

Referring to fig. 1, a flowchart of an audio playing method provided in the embodiment of the present disclosure is shown, where the method includes steps S101 to S103, where:

s101, acquiring a sound effect playing request aiming at a target sound effect.

In this step, when a page such as an H5 game is opened, various files need to be loaded, in order to reduce the loading time, necessary files for the H5 game to normally run may be loaded, and then, when there is a need for use or the H5 game runs to a preset loading node, these unnecessary files are loaded, and the unnecessary files may include some static resource files, which are usually stored on a server, need to be downloaded from the server to the local, and then are loaded. The target sound effect is one of the static resource files, and the loading strategy can be adopted.

At some nodes of the H5 game, corresponding sound effects are played, for example, if a virtual character in the H5 game enters a fighting state, a fighting sound effect needs to be played, if the virtual character uses skills, a skill sound effect needs to be played, in the case that the fighting sound effect needs to be played, a playing request of the fighting sound effect can be generated, and an audio component of the H5 game can obtain the sound effect playing request and respond.

Specifically, the target sound effect may correspond to one or more audio files, and when the target sound effect needs to be played, one or more audio files may be selected from the audio files for playing.

In a possible embodiment, when the sound effect playing request for the target sound effect is acquired or a loading time node corresponding to the target sound effect is reached, an audio file corresponding to the target sound effect may be downloaded from a resource server. Thus, delaying the downloading and loading of the audio files may increase the speed at which the H5 game loads files at startup.

When the audio file download is complete, it may be determined that the audio file is in a playable state.

S102, after the audio file corresponding to the target sound effect is in a playable state, determining whether to respond to the sound effect playing request or not based on the maximum delay response time corresponding to the target sound effect, the initial time node for obtaining the sound effect playing request and the current time node.

In this step, since the audio file corresponding to the target sound effect may not be downloaded yet or may not be downloaded yet when the sound effect playing request for the target sound effect is obtained, and the target sound effect may not need to be played again after the audio file is downloaded, it is possible to determine whether to respond to the sound effect playing request and determine whether there is a demand for playing the target sound effect at present based on the maximum delay response duration corresponding to the target sound effect, the initial time node at which the sound effect playing request is obtained, and the current time node after detecting that the audio file corresponding to the target sound effect is downloaded and is in a playable state,

specifically, the audio file playing request may be compared with a maximum delay response duration corresponding to the audio file according to a time interval between the current time node and an initial time node at which the audio playing request is obtained, and if the maximum delay response duration is greater than or equal to the time interval and a playing stopping request for a target audio is not obtained within a time period between the initial time node and the current time node, the audio playing request may be determined to be responded.

In this step, the maximum delay response time is used to indicate the maximum time interval between playing the audio file and obtaining the audio playing request, and if the time interval is greater than the maximum delay response time, it indicates that a large delay is generated when playing the audio file, and the audio is played only when the corresponding animation in the H5 game is finished, which seriously affects the user experience, and at this time, the audio file may not be played, i.e., the audio playing request is not responded.

In a possible implementation manner, an overtime timer may be set for the sound effect playing request at the initial time node where the sound effect playing request is obtained, and if the time accumulation variable corresponding to the current time node is smaller than the maximum delay response duration and the request for stopping playing is obtained, the volume playing request is determined to be responded.

The maximum delay response time can be determined according to the audio duration of the audio file and a preset delay weight. For example, if the delay weight is 0.4, a duration of 40 percent of the total length of the audio duration may be taken as the maximum delay response time.

In a possible embodiment, if the target audio corresponds to a plurality of audio files, and the plurality of audio files may form a target audio group, it may be determined that the audio file is in a playable state when at least one downloaded audio file exists in the target audio group.

S103, under the condition that the sound effect playing request is determined to be responded, the audio file is played.

In a possible implementation manner, if the audio file is an audio file in the target audio group, any one of the at least one downloaded audio file in the target audio group may be played randomly, or the audio file that is downloaded earliest in the target audio group may be played according to the download completion time corresponding to the at least one downloaded audio file in the target audio group.

Therefore, whether the sound effect playing request is responded or not is determined through the maximum delay influence duration corresponding to the target sound effect, the initial node obtaining the sound effect playing request and the current node, so that the sound effect playing method is more suitable for the current scene when the sound effect is played, and the user experience is improved.

Referring to fig. 2, in order to provide the audio management system according to the embodiment of the present disclosure, the audio management system adopts client-side audio management, and first, audio configuration information that can be stored by an audioeffectcfg.ts control may include a playlist and a playlist configuration, and after the configuration of the audio playlist is obtained, the audioeffectplaylistmay be managed by using the audioeffectplaylistts.ts control, and functions such as random play, specified play, stop play, volume control, and audio information acquisition may be provided, and the audioeffectitemts.ts control corresponding to each audio may be controlled, and the audioeffectitets control is used to manage a certain audio file, and includes functions such as play, stop, reload, volume control, and audio information acquisition, and the audioeffectitemts control may call an encapsulated interface, thereby implementing bottom layer logical encapsulation for calling audio play and controlling the audio file.

It will be understood by those skilled in the art that in the method of the present invention, the order of writing the steps does not imply a strict order of execution and any limitations on the implementation, and the specific order of execution of the steps should be determined by their function and possible inherent logic.

Based on the same inventive concept, an audio playing device corresponding to the audio playing method is also provided in the embodiments of the present disclosure, and as the principle of solving the problem of the device in the embodiments of the present disclosure is similar to the audio playing method in the embodiments of the present disclosure, the implementation of the device may refer to the implementation of the method, and repeated details are not repeated.

Referring to fig. 3, a schematic diagram of an audio playing apparatus provided in an embodiment of the present disclosure is shown, where the apparatus includes:

an obtaining module 310, configured to obtain a sound effect playing request for a target sound effect;

a determining module 320, configured to determine whether to respond to the sound effect playing request based on the maximum delay response duration corresponding to the target sound effect, the initial time node at which the sound effect playing request is obtained, and the current time node after the audio file corresponding to the target sound effect is in a playable state;

the playing module 330 is configured to play the audio file when the sound effect playing request is determined to be responded.

In an optional embodiment, the apparatus further comprises a downloading module configured to:

when the sound effect playing request aiming at the target sound effect is obtained or a loading time node corresponding to the target sound effect is reached, downloading an audio file corresponding to the target sound effect from a resource server;

the determining module 320 is further configured to:

and when the audio file is downloaded, determining that the audio file is in a playable state.

In an optional implementation manner, the determining module 320 is specifically configured to:

determining a time interval between a current time node and an initial time node for acquiring the sound effect playing request;

and determining to respond to the sound effect playing request under the condition that the maximum delay response time length is greater than or equal to the time interval and a playing stopping request aiming at the target sound effect is not acquired in a time period between the current time node and an initial time node for acquiring the sound effect playing request.

In an optional implementation manner, when determining whether to respond to the sound effect playing request based on the maximum delay response time corresponding to the target sound effect, the initial time node at which the sound effect playing request is acquired, and the current time node, the determining module 320 is configured to:

setting an overtime timer for the sound effect playing request at an initial time node for acquiring the sound effect playing request;

and determining a time accumulation variable corresponding to the current time node by the overtime timer, and determining to respond to the sound effect playing request under the condition that the maximum delay response time length is greater than or equal to the time accumulation variable and a playing stopping request aiming at the target sound effect is not acquired in a time period between the current time node and the time node acquiring the sound effect playing request.

In an optional embodiment, the determining module 320 is further configured to:

and determining the maximum delay response time length based on the audio time length of the audio file corresponding to the target sound effect and a preset delay weight.

In an optional embodiment, the audio file is an audio file in a target audio group; the determining module 320, when determining that the audio file is in the playable state when the audio file is downloaded, is configured to:

and when at least one audio file which is downloaded completely exists in the target audio group, determining that the audio file which is downloaded completely in the target audio group is in a playable state.

In an optional implementation manner, when playing the audio file corresponding to the sound effect playing request, the playing module 330 is configured to:

randomly playing any audio file in at least one downloaded audio file in the target audio group; alternatively, the first and second electrodes may be,

and playing the audio file which is downloaded at the earliest time in the target audio group according to the download completion time corresponding to at least one audio file which is downloaded completely in the target audio group.

In an alternative embodiment, the target sound effect is a sound effect in a webpage based on the hypertext HTML5 standard.

The description of the processing flow of each module in the device and the interaction flow between the modules may refer to the related description in the above method embodiments, and will not be described in detail here.

Corresponding to the audio playing method in fig. 1, an embodiment of the present disclosure further provides an electronic device 400, as shown in fig. 4, a schematic structural diagram of the electronic device 400 provided in the embodiment of the present disclosure includes:

a processor 41, a memory 42, and a bus 43; the memory 42 is used for storing execution instructions and includes a memory 421 and an external memory 422; the memory 421 is also referred to as an internal memory, and is used for temporarily storing the operation data in the processor 41 and the data exchanged with the external memory 422 such as a hard disk, the processor 41 exchanges data with the external memory 422 through the memory 421, and when the electronic device 400 operates, the processor 41 communicates with the memory 42 through the bus 43, so that the processor 41 executes the following instructions:

acquiring a sound effect playing request aiming at a target sound effect;

after the audio file corresponding to the target sound effect is in a playable state, determining whether to respond to the sound effect playing request or not based on the maximum delay response time corresponding to the target sound effect, the initial time node for obtaining the sound effect playing request and the current time node;

and under the condition that the sound effect playing request is determined to be responded, playing the audio file.

In an optional embodiment, the processor 41 is further configured to:

when the sound effect playing request aiming at the target sound effect is obtained or a loading time node corresponding to the target sound effect is reached, downloading an audio file corresponding to the target sound effect from a resource server;

the processor 41 is further configured to perform:

and when the audio file is downloaded, determining that the audio file is in a playable state.

In an optional implementation manner, the determining whether to respond to the sound effect playing request based on the maximum delay response time corresponding to the target sound effect, the initial time node at which the sound effect playing request is obtained, and the current time node includes:

determining a time interval between a current time node and an initial time node for acquiring the sound effect playing request;

and determining to respond to the sound effect playing request under the condition that the maximum delay response time length is greater than or equal to the time interval and a playing stopping request aiming at the target sound effect is not acquired in a time period between the current time node and an initial time node for acquiring the sound effect playing request.

In an optional implementation manner, in the instructions executed by the processor 41, the determining whether to respond to the sound effect playing request based on the maximum delay response time corresponding to the target sound effect, the initial time node at which the sound effect playing request is acquired, and the current time node includes:

setting an overtime timer for the sound effect playing request at an initial time node for acquiring the sound effect playing request;

and determining a time accumulation variable corresponding to the current time node by the overtime timer, and determining to respond to the sound effect playing request under the condition that the maximum delay response time length is greater than or equal to the time accumulation variable and a playing stopping request aiming at the target sound effect is not acquired in a time period between the current time node and the time node acquiring the sound effect playing request.

In an optional embodiment, the processor 41 is further configured to:

and determining the maximum delay response time length based on the audio time length of the audio file corresponding to the target sound effect and a preset delay weight.

In an alternative embodiment, the processor 41 executes the instructions, where the audio file is an audio file in a target audio group; when the audio file is downloaded, determining that the audio file is in a playable state includes:

and when at least one audio file which is downloaded completely exists in the target audio group, determining that the audio file which is downloaded completely in the target audio group is in a playable state.

In an optional implementation manner, in the instructions executed by the processor 41, the playing the audio file corresponding to the sound effect playing request includes:

randomly playing any audio file in at least one downloaded audio file in the target audio group; alternatively, the first and second electrodes may be,

and playing the audio file which is downloaded at the earliest time in the target audio group according to the download completion time corresponding to at least one audio file which is downloaded completely in the target audio group.

In an alternative embodiment, the processor 41 executes instructions in which the target sound effect is a sound effect in a web page based on the hypertext HTML5 standard.

The embodiments of the present disclosure also provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program performs the steps of the audio playing method in the above-mentioned method embodiments. The storage medium may be a volatile or non-volatile computer-readable storage medium.

The embodiments of the present disclosure also provide a computer program product, where the computer program product carries a program code, and instructions included in the program code may be used to execute the steps of the audio playing method in the foregoing method embodiments, which may be referred to specifically in the foregoing method embodiments, and are not described herein again.

The computer program product may be implemented by hardware, software or a combination thereof. In an alternative embodiment, the computer program product is embodied in a computer storage medium, and in another alternative embodiment, the computer program product is embodied in a Software product, such as a Software Development Kit (SDK), or the like.

It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the system and the apparatus described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, apparatus, and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.

The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.

In addition, functional units in the embodiments of the present disclosure may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.

The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present disclosure may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present disclosure. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.

Finally, it should be noted that: the above-mentioned embodiments are merely specific embodiments of the present disclosure, which are used for illustrating the technical solutions of the present disclosure and not for limiting the same, and the scope of the present disclosure is not limited thereto, and although the present disclosure is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive of the technical solutions described in the foregoing embodiments or equivalent technical features thereof within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present disclosure, and should be construed as being included therein. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.

14页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:歌单生成方法、装置、介质和计算设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!