CN106649297B - Method for playing webpage audio file, browser and server - Google Patents

Method for playing webpage audio file, browser and server Download PDF

Info

Publication number
CN106649297B
CN106649297B CN201510430691.3A CN201510430691A CN106649297B CN 106649297 B CN106649297 B CN 106649297B CN 201510430691 A CN201510430691 A CN 201510430691A CN 106649297 B CN106649297 B CN 106649297B
Authority
CN
China
Prior art keywords
audio
combined
current page
data
browser
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510430691.3A
Other languages
Chinese (zh)
Other versions
CN106649297A (en
Inventor
韦伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201510430691.3A priority Critical patent/CN106649297B/en
Publication of CN106649297A publication Critical patent/CN106649297A/en
Application granted granted Critical
Publication of CN106649297B publication Critical patent/CN106649297B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/951Indexing; Web crawling techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/60Information retrieval; Database structures therefor; File system structures therefor of audio data
    • G06F16/68Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually

Abstract

The invention discloses a method for playing a webpage audio file, which comprises the following steps: the browser receives an audio tag triggering instruction and acquires an audio tag triggered this time in a current page; when the combined audio corresponding to the triggered audio tag is loaded, searching the corresponding time period of the triggered audio tag in the combined audio; and playing the audio data of the corresponding time section in the combined audio. The invention also discloses a method for playing the webpage audio file, a browser and a server. The browser directly searches and plays the audio data of the time period corresponding to the audio label in the loaded combined audio of the current page, the combined audio is formed by sequentially arranging the audio data of a plurality of original audio files of the current page by the server in advance, and re-editing and combining the audio data according to the time sequence, and the browser does not need to send a loading request to the server, so that the time for waiting for loading is effectively reduced, and the audio playing delay is avoided.

Description

Method for playing webpage audio file, browser and server
Technical Field
The invention relates to the technical field of internet, in particular to a method, a browser and a server for playing a webpage audio file.
Background
At present, after a web page is opened by a browser of a terminal, the web page may automatically play audio or play audio according to user selection, and before an audio file is played each time, an audio tag of the audio file is automatically or manually triggered. Because there is a certain time delay in the process of sending the request and loading the audio file, after a certain audio tag is triggered, it is necessary to wait for a short period of time before playing the audio file. If a plurality of different audios exist in the page, after an audio tag is triggered each time, the browser needs to send an http request to the server, and after the request is sent each time, the browser needs to wait for a period of time to finish loading and playing the audio, which undoubtedly increases the time for waiting for loading, and causes audio playing delay.
Disclosure of Invention
The embodiment of the invention provides a method for playing a webpage audio file, a browser and a server, which effectively reduce waiting time and avoid audio playing delay when the webpage plays the audio file.
The embodiment of the invention provides a method for playing a webpage audio file, which comprises the following steps:
the browser receives an audio tag triggering instruction and acquires an audio tag triggered this time in a current page;
when the combined audio corresponding to the triggered audio tag is loaded, searching the corresponding time period of the triggered audio tag in the combined audio;
and playing the audio data of the corresponding time section in the combined audio.
The embodiment of the invention also provides a method for playing the webpage audio file, which comprises the following steps:
the server acquires an original audio file corresponding to each audio label on the current page from a database;
sequentially arranging the audio data of the original audio files, re-editing and merging the audio data into one audio file according to the time sequence, and using the audio file as the combined audio of the current page;
determining a corresponding time period of each original audio file in the combined audio according to the duration of each original audio file;
and establishing a mapping relation between the corresponding time period of each original audio file in the combined audio and the audio label of the original audio file.
The embodiment of the present invention further provides a browser for playing a webpage audio file, including:
the instruction module is used for receiving an audio tag triggering instruction and acquiring the currently triggered audio tag in the current page;
the searching module is used for searching the corresponding time period of the triggered audio tag in the combined audio when the combined audio corresponding to the triggered audio tag is loaded;
and the playing module is used for playing the audio data of the corresponding time period in the combined audio.
The embodiment of the present invention further provides a server for playing a webpage audio file, including:
the editing module is used for acquiring an original audio file corresponding to each audio tag on the current page from a database; sequentially arranging the audio data of the original audio files, re-editing and merging the audio data into one audio file according to the time sequence, and using the audio file as the combined audio of the current page;
the mapping module is used for determining a corresponding time period of each original audio file in the combined audio according to the duration of each original audio file; and establishing a mapping relation between the corresponding time period of each original audio file in the combined audio and the audio label of the original audio file.
When the browser plays the audio according to the currently triggered audio tag, the browser directly searches the time period corresponding to the currently triggered audio tag in the loaded combined audio of the current page, and plays the audio data of the time period corresponding to the combined audio, wherein the combined audio is an audio file formed by sequentially arranging the audio data of a plurality of original audio files in the current page in advance by a server and re-editing and combining the audio data according to the time sequence, the combined audio comprises the audio data corresponding to all the audio tags of the current page, and no matter which audio tag of the current page is triggered, as long as the browser loads the combined audio of the current page in advance, the browser does not need to send a loading request to the server any more, the time for waiting for loading is effectively reduced, and the audio playing delay is avoided.
Drawings
FIG. 1 is a diagram of an operating environment of a terminal where a browser playing a web page audio file interacts with a server according to an embodiment of the present invention;
FIG. 2 is a bus diagram of a terminal where a browser for playing a web page audio file is located according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a method for playing an audio file of a web page by a browser according to a first embodiment of the present invention;
FIG. 4 is a flowchart illustrating a method for implementing audio file playing of a web page by a browser according to a second embodiment of the present invention;
FIG. 5 is a flowchart illustrating a method for implementing audio file playing on a web page by a browser according to a third embodiment of the present invention;
FIG. 6 is a flowchart illustrating a method for playing an audio file of a web page by a server according to a first embodiment of the present invention;
FIG. 7 is a flowchart illustrating a method for playing an audio file of a web page by a server according to a second embodiment of the present invention;
FIG. 8 is a flowchart illustrating a third exemplary embodiment of a method for playing an audio file on a web page by a server according to the present invention;
FIG. 9 is a block diagram of a browser for playing audio files of web pages according to a first embodiment of the present invention;
FIG. 10 is a block diagram of a browser for playing audio files on a web page according to a second embodiment of the present invention;
FIG. 11 is a block diagram illustrating a server for playing audio files of web pages according to a first embodiment of the present invention;
FIG. 12 is a block diagram illustrating a server for playing audio files of web pages according to a second embodiment of the present invention;
FIG. 13a is a diagram of a first embodiment of generating combined audio from multiple audio files in an embodiment of the present invention;
FIG. 13b is a diagram of a second embodiment of generating combined audio from multiple audio files according to the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, the browser for playing the webpage audio file provided by the present invention is disposed on the terminal 100, the terminal 100 may be a computer, a PAD, a mobile phone, or the like, the browser may be an independent browser installed in the terminal 100, or may be a browser of an application installed on the terminal 100, and the server 200 may be a server corresponding to a webpage, or a server for recoding another webpage. The browser is connected to the server 200 through a data network, wifi, wired network, etc. of the terminal 100, so as to implement data interaction.
Referring to fig. 2, fig. 2 is a bus diagram of a terminal where a browser for playing a web page audio file is located in the embodiment of the present invention, where the terminal may include: at least one processor 101, e.g., a CPU, at least one network interface 104, a user interface 103, a memory 105, at least one communication bus 102. Wherein the communication bus 102 is used for enabling connection communication between these components. The user interface 103 may include a Display (Display), a Keyboard (Keyboard), a standard wired interface, and a standard wireless interface. The network interface 104 may include a standard wired interface, a wireless interface (e.g., a WIFI interface). The memory 105 may be a high-speed RAM memory or a non-volatile memory (e.g., at least one disk memory). The memory 105 may also be at least one memory browser located remotely from the aforementioned processor 101. The memory 105, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a web page audio file playing program.
In the terminal where the browser for playing the webpage audio file shown in fig. 2 is located, the network interface 104 is mainly used for connecting a server or other terminals and performing data communication with the server or other terminals; the user interface 103 is mainly used for receiving user instructions and interacting with users; and the processor 101 may be configured to call the web page audio file playing program stored in the memory 105, and perform the following operations:
receiving an audio tag triggering instruction through a user interface 103, and acquiring an audio tag triggered this time in a current page;
when the combined audio corresponding to the triggered audio tag is loaded, searching the corresponding time period of the triggered audio tag in the combined audio;
and playing the audio data of the corresponding time section in the combined audio.
In one embodiment, the processor 101 invoking the web page audio file playing program stored in the memory 105 may further perform the following operations:
after entering the current page, requesting the server to load the combined audio of the current page through the network interface 104;
the combined audio for the current page returned by the server is received through the network interface 104.
In one embodiment, the processor 101 invoking the web page audio file playing program stored in the memory 105 may further perform the following operations:
when the combined audio corresponding to the triggered audio tag is not loaded, requesting the server to load the combined audio through the network interface 104;
and receiving the combined audio corresponding to the triggered audio tag returned by the server through the network interface 104.
In the browser and the server for playing the webpage audio file described in fig. 1 and fig. 2 in this embodiment, when the browser plays audio according to the currently triggered audio tag, the browser directly searches the time period corresponding to the currently triggered audio tag in the loaded combined audio of the current page, and plays audio data in the combined audio corresponding to the time period, where the combined audio is an audio file formed by previously arranging audio data of multiple original audio files in the current page in sequence by the server and re-editing and merging the audio data according to a time sequence, the combined audio includes audio data corresponding to all audio tags of the current page, and no matter which audio tag of the current page is triggered at this time, as long as the browser has loaded the combined audio of the current page in advance, the browser does not need to send a loading request to the server any more, thereby effectively reducing the time waiting for loading, audio playback delays are avoided.
Fig. 3 is a flowchart illustrating a method for playing an audio file of a web page by a browser according to a first embodiment of the present invention. The method for playing the webpage audio file includes:
step S110, the browser receives an audio tag triggering instruction and acquires an audio tag triggered this time in the current page;
in this embodiment, a current page is loaded through a browser of a terminal, if there is audio to be played in the current page, there is an audio tag corresponding to a certain audio in the loaded current page, and if there are multiple audio to be played, there are multiple audio tags in the page. When a certain audio is triggered, for example, the audio tag "audio 2", the browser acquires information of the audio tag, mainly including the audio ID "audio 2" corresponding to the audio tag.
Step S120, when the combined audio corresponding to the triggered audio tag is loaded, searching the corresponding time period of the triggered audio tag in the combined audio;
the audio corresponding to each audio tag on the current page is not independent audio files, but the server arranges the audio data of the original audio files in the current page in sequence in advance, and edits and merges the audio data into one audio file according to the time sequence, that is, the combined audio, as shown in fig. 13 a. The combined audio comprises data of a plurality of audios on the current page, and the corresponding time period of each audio in the combined audio is determined according to the duration of each audio. After the browser acquires the audio tag triggered this time, whether the currently loaded data has the combined audio corresponding to the audio tag is searched, and if the combined audio is loaded, the time period corresponding to the audio tag triggered this time in the combined audio is searched. For example, in FIG. 13a, the audio tag "audio 2" corresponds to a combined audio of sprite1.mp3 and a corresponding time period in the combined audio of 8-14 s.
Step S130, playing the audio data of the corresponding time period in the combined audio.
After the browser acquires the corresponding time period of the audio tag in the combined audio, playing the audio data of the combined audio in the time period, such as the audio data of 8-14 s in the above embodiment, which is the audio data corresponding to the currently triggered audio tag "audio 2", and after the audio data of the time period is played, automatically pausing the playing by the browser. In addition, if the durations of the multiple audios are not equal, blank data can be filled in a blank manner, so that the start time interval or the end time interval of each section of audio data in the combined audio is equal, as shown in fig. 13b, the start time intervals of each section of audio data are equal, which is beneficial for the browser to quickly find the start time of the audio tag triggered this time when the audio is played, and improves the playing efficiency.
When the browser plays the audio according to the currently triggered audio tag, the browser of this embodiment directly searches the time period corresponding to the currently triggered audio tag in the loaded combined audio of the current page, and plays the audio data of the time period corresponding to the combined audio, where the combined audio is an audio file formed by arranging the audio data of multiple original audio files in the current page in sequence by the server in advance and re-editing and combining the audio data according to the time sequence, the combined audio includes the audio data corresponding to all the audio tags of the current page, and no matter which audio tag of the current page is triggered, as long as the browser has loaded the combined audio of the current page in advance, the browser does not need to send a loading request to the server any more, thereby effectively reducing the time for waiting for loading, and avoiding audio playing delay.
Fig. 4 is a flowchart illustrating a method for playing an audio file of a web page by a browser according to a second embodiment of the present invention. The present embodiment includes all the steps in the embodiment shown in fig. 3, and further includes, before step S110:
step S141, after the browser enters the current page, the browser requests a server to load the combined audio of the current page;
and step S142, receiving the combined audio of the current page returned by the server.
In this embodiment, after the browser finishes loading the current page, the browser checks whether audio to be played on the current page is available, and if so, in order to reduce the waiting time during loading, the browser sends a loading request to the server to load the combined audio of the current page in advance. Because the server has arranged the audio data of the original audio files in the current page in sequence in advance, and re-edits and merges the original audio files according to the time sequence to form one audio file, the browser does not need to send multiple loading requests and multiple loading of the audio files respectively aiming at the original audio files, and only needs to send the sequential loading requests and load one combined audio, thereby effectively reducing the time and the times of audio loading. Meanwhile, after the audio tag is triggered, the browser only needs to play the audio data of the audio tag in the combined audio within the corresponding time period, and does not need to send a loading request to the server again, so that the time for waiting for loading is effectively reduced, and the audio playing delay is avoided.
Referring to fig. 5, fig. 5 is a flowchart illustrating a method for implementing audio file playing of a web page by a browser according to a third embodiment of the present invention. The present embodiment includes all the steps in the embodiment shown in fig. 3, and further includes, after step S110:
step S151, when the combined audio corresponding to the triggered audio tag is not loaded, requesting a server to load the combined audio;
step S152, receiving the combined audio corresponding to the currently triggered audio tag returned by the server, and executing step S120.
In this embodiment, when the browser loads the current page, if another program or another component of the current page occupies the network, or the current network is temporarily unstable, or the user closes the function of immediately loading the combined audio in advance, or the browser detects that the current page is temporarily changed to operate in the background, the browser may not load the combined audio of the current page temporarily, which is beneficial to avoiding occupying the current network resource or causing a load to the terminal in the process of loading in advance. If the browser does not find the combined audio corresponding to the audio tag after receiving the instruction that the audio tag is triggered, the browser requests the server to load the combined audio, if other subsequent audio tags are triggered, the browser only needs to play the audio data of the audio tag which is triggered again in the combined audio within the corresponding time period because the combined audio is loaded, and does not need to send the loading request to the server again, so that the time for waiting for loading is effectively reduced, and the audio playing delay is avoided.
Fig. 6 is a flowchart illustrating a method for playing a web page audio file by a server according to a first embodiment of the present invention. The method for playing the webpage audio file comprises the following steps:
step S210, the server obtains an original audio file corresponding to each audio label on the current page from a database;
the server in this embodiment may be a server corresponding to the current web page, or may be a server for recoding another web page. When the audio to be played in the current web page is to be played, each audio tag in the original web page corresponds to a respective audio file, that is, the original audio file in this embodiment, the audio files are stored in the database of the server or the database of the server corresponding to the original web page, the server acquires the original audio files corresponding to the audio tags from the database, and one audio tag corresponds to one original audio file, for example, audio1.mp3, audio2.mp3, and audio3.mp3 shown in fig. 13a and 13 b.
Step S220, sequentially arranging the audio data of a plurality of original audio files, re-editing and combining the audio data into an audio file according to a time sequence, and using the audio file as the combined audio of the current page;
the server arranges the audio data of a plurality of original audio files in the current page in sequence, and re-edits and merges the audio data into one audio file according to the time sequence, namely, the combined audio, such as the sprite1.mp3 shown in fig. 13a and fig. 13 b. The audio combination mode can be processed by adopting a special audio editing tool.
Step S230, determining a corresponding time period of each original audio file in the combined audio according to the duration of each original audio file;
step S240, establishing a mapping relationship between the corresponding time period of each original audio file in the combined audio and the audio tag of the original audio file.
The re-edited combined audio comprises data of a plurality of audios on the current page, the corresponding time period of each audio in the combined audio is determined according to the duration of each audio, and the mapping relation between the audio label and the corresponding time period is established. For example, in FIG. 13a, the audio label "audio 3" corresponds to a combined audio time period of 14-22 seconds for sprite1.mp 3. Therefore, when the browser plays the audio according to the currently triggered audio tag, the time period corresponding to the currently triggered audio tag is directly searched in the combined audio of the current page, and the audio data of the combined audio in the corresponding time period is played.
Fig. 7 is a flowchart illustrating a method for playing a web page audio file by a server according to a second embodiment of the present invention. The present embodiment includes all the steps in the embodiment shown in fig. 6, and further includes, after step S220:
step S221, when the corresponding time periods of the original audio files in the combined audio are not equal, blank data is added before audio data with shorter corresponding time periods in the combined audio, so that the time intervals of the termination time of two adjacent sections of audio data in the combined audio are equal; or blank data is added after the audio data with the shorter corresponding time period in the combined audio, so that the time intervals of the starting time of two adjacent sections of audio data in the combined audio are equal.
In this embodiment, if the durations of the multiple audios are not the same, blank data may be filled in by a blank method, so that the start time interval or the end time interval of each audio data in the combined audio is equal, as shown in fig. 13b, the time period of the combined audio corresponding to the audio label "audio 3" is 16-24 seconds of sprite1.mp 3. The time intervals of the starting time of each section of audio data are equal, so that the browser can quickly find the starting time of the triggered audio label when playing the audio, and the playing efficiency is improved.
Fig. 8 is a flowchart illustrating a method for playing a web page audio file by a server according to a third embodiment of the present invention. The present embodiment includes all steps in the embodiment shown in fig. 6, and further includes, after step S240:
step S251, receiving a request for loading the combined audio of the current page sent by the browser;
step S252, returning the combined audio of the current page and the mapping relationship between the audio tag of the current page and the corresponding time period of the combined audio to the browser.
In this embodiment, when the server receives a loading request of a combined audio sent by the browser, the server sends the pre-recombined combined audio to the browser, and simultaneously sends an audio tag and a mapping relationship between the audio tag and a corresponding time period in the combined audio to the browser. Therefore, after the audio tag is triggered at this time, the browser only needs to play the audio data of the audio tag triggered at this time in the corresponding time period in the combined audio, and does not need to send a loading request to the server again, so that the time for waiting for loading is effectively reduced, and the audio playing delay is avoided.
As shown in fig. 9, fig. 9 is a schematic block diagram of a browser for playing audio files in a web page according to a first embodiment of the present invention. The browser for playing the webpage audio file mentioned in this embodiment includes:
the instruction module 310 is configured to receive an audio tag triggering instruction, and acquire an audio tag triggered this time in a current page;
the searching module 320 is configured to search, when the combined audio corresponding to the currently triggered audio tag is loaded, a corresponding time period of the currently triggered audio tag in the combined audio;
the playing module 330 is configured to play audio data of a corresponding time period in the combined audio.
In this embodiment, a current page is loaded through a browser of a terminal, if there is audio to be played in the current page, there is an audio tag corresponding to a certain audio in the loaded current page, and if there are multiple audio to be played, there are multiple audio tags in the page. When a certain audio is triggered, for example, the audio tag "audio 2", the browser acquires information of the audio tag, mainly including the audio ID "audio 2" corresponding to the audio tag.
The audio corresponding to each audio tag on the current page is not independent audio files, but the server arranges the audio data of the original audio files in the current page in sequence in advance, and edits and merges the audio data into one audio file according to the time sequence, that is, the combined audio, as shown in fig. 13 a. The combined audio comprises data of a plurality of audios on the current page, and the corresponding time period of each audio in the combined audio is determined according to the duration of each audio. After the browser acquires the audio tag triggered this time, whether the currently loaded data has the combined audio corresponding to the audio tag is searched, and if the combined audio is loaded, the time period corresponding to the audio tag triggered this time in the combined audio is searched. For example, in FIG. 13a, the audio tag "audio 2" corresponds to a combined audio of sprite1.mp3 and a corresponding time period in the combined audio of 8-14 s.
After the browser acquires the corresponding time period of the audio tag in the combined audio, playing the audio data of the combined audio in the time period, such as the audio data of 8-14 s in the above embodiment, which is the audio data corresponding to the currently triggered audio tag "audio 2", and after the audio data of the time period is played, automatically pausing the playing by the browser. In addition, if the durations of the multiple audios are not equal, blank data can be filled in a blank manner, so that the start time interval or the end time interval of each section of audio data in the combined audio is equal, as shown in fig. 13b, the start time intervals of each section of audio data are equal, which is beneficial for the browser to quickly find the start time of the audio tag triggered this time when the audio is played, and improves the playing efficiency.
When the browser plays the audio according to the currently triggered audio tag, the browser of this embodiment directly searches the time period corresponding to the currently triggered audio tag in the loaded combined audio of the current page, and plays the audio data of the time period corresponding to the combined audio, where the combined audio is an audio file formed by arranging the audio data of multiple original audio files in the current page in sequence by the server in advance and re-editing and combining the audio data according to the time sequence, the combined audio includes the audio data corresponding to all the audio tags of the current page, and no matter which audio tag of the current page is triggered, as long as the browser has loaded the combined audio of the current page in advance, the browser does not need to send a loading request to the server any more, thereby effectively reducing the time for waiting for loading, and avoiding audio playing delay.
Referring to fig. 10, fig. 10 is a block diagram illustrating a browser for playing audio files of web pages according to a second embodiment of the present invention. This embodiment includes all the modules in the embodiment shown in fig. 9, and further includes a browser network module 340, configured to:
after entering the current page, requesting a server to load the combined audio of the current page;
and receiving the combined audio of the current page returned by the server.
In this embodiment, after the browser finishes loading the current page, the browser checks whether audio to be played on the current page is available, and if so, in order to reduce the waiting time during loading, the browser sends a loading request to the server to load the combined audio of the current page in advance. Because the server has arranged the audio data of the original audio files in the current page in sequence in advance, and re-edits and merges the original audio files according to the time sequence to form one audio file, the browser does not need to send multiple loading requests and multiple loading of the audio files respectively aiming at the original audio files, and only needs to send the sequential loading requests and load one combined audio, thereby effectively reducing the time and the times of audio loading. Meanwhile, after the audio tag is triggered, the browser only needs to play the audio data of the audio tag in the combined audio within the corresponding time period, and does not need to send a loading request to the server again, so that the time for waiting for loading is effectively reduced, and the audio playing delay is avoided.
Further, the browser network module 340 is further configured to:
when the combined audio corresponding to the triggered audio tag is not loaded, requesting a server to load the combined audio;
and receiving the combined audio corresponding to the triggered audio label returned by the server.
In this embodiment, when the browser loads the current page, if another program or another component of the current page occupies the network, or the current network is temporarily unstable, or the user closes the function of immediately loading the combined audio in advance, or the browser detects that the current page is temporarily changed to operate in the background, the browser may not load the combined audio of the current page temporarily, which is beneficial to avoiding occupying the current network resource or causing a load to the terminal in the process of loading in advance. If the browser does not find the combined audio corresponding to the audio tag after receiving the instruction that the audio tag is triggered, the browser requests the server to load the combined audio, if other subsequent audio tags are triggered, the browser only needs to play the audio data of the audio tag which is triggered again in the combined audio within the corresponding time period because the combined audio is loaded, and does not need to send the loading request to the server again, so that the time for waiting for loading is effectively reduced, and the audio playing delay is avoided.
As shown in fig. 11, fig. 11 is a schematic block diagram of a server for playing a web page audio file according to a first embodiment of the present invention. The server for playing the webpage audio file mentioned in this embodiment includes:
the editing module 210 is configured to obtain an original audio file corresponding to each audio tag on the current page in the database; sequentially arranging audio data of a plurality of original audio files, and re-editing and combining the audio data into an audio file according to a time sequence to be used as combined audio of a current page;
the mapping module 220 is configured to determine, according to a duration of each original audio file, a corresponding time period of each original audio file in the combined audio; and establishing a mapping relation between the corresponding time period of each original audio file in the combined audio and the audio label of the original audio file.
The server in this embodiment may be a server corresponding to the current web page, or may be a server for recoding another web page. When the audio to be played in the current web page is to be played, each audio tag in the original web page corresponds to a respective audio file, that is, the original audio file in this embodiment, the audio files are stored in the database of the server or the database of the server corresponding to the original web page, the server acquires the original audio files corresponding to the audio tags from the database, and one audio tag corresponds to one original audio file, for example, audio1.mp3, audio2.mp3, and audio3.mp3 shown in fig. 13a and 13 b.
The server arranges the audio data of a plurality of original audio files in the current page in sequence, and re-edits and merges the audio data into one audio file according to the time sequence, namely, the combined audio, such as the sprite1.mp3 shown in fig. 13a and fig. 13 b. The audio combination mode can be processed by adopting a special audio editing tool.
The re-edited combined audio comprises data of a plurality of audios on the current page, the corresponding time period of each audio in the combined audio is determined according to the duration of each audio, and the mapping relation between the audio label and the corresponding time period is established. For example, in FIG. 13a, the audio label "audio 3" corresponds to a combined audio time period of 14-22 seconds for sprite1.mp 3. Therefore, when the browser plays the audio according to the currently triggered audio tag, the time period corresponding to the currently triggered audio tag is directly searched in the combined audio of the current page, and the audio data of the combined audio in the corresponding time period is played.
Further, the editing module 210 is further configured to, when the corresponding time periods of the original audio files in the combined audio are not equal, add blank data before audio data with a shorter corresponding time period in the combined audio, so that time intervals of termination times of two adjacent pieces of audio data in the combined audio are equal; or blank data is added after the audio data with the shorter corresponding time period in the combined audio, so that the time intervals of the starting time of two adjacent sections of audio data in the combined audio are equal.
In this embodiment, if the durations of the multiple audios are not the same, blank data may be filled in by a blank method, so that the start time interval or the end time interval of each audio data in the combined audio is equal, as shown in fig. 13b, the time period of the combined audio corresponding to the audio label "audio 3" is 16-24 seconds of sprite1.mp 3. The time intervals of the starting time of each section of audio data are equal, so that the browser can quickly find the starting time of the triggered audio label when playing the audio, and the playing efficiency is improved.
Fig. 12 is a block diagram illustrating a server for playing a web page audio file according to a second embodiment of the present invention. This embodiment includes all the modules in the embodiment shown in fig. 11, and further includes a server network module 230, configured to:
receiving a request for loading the combined audio of the current page, which is sent by a browser;
and returning the combined audio of the current page and the mapping relation between the audio label of the current page and the corresponding time period of the combined audio to the browser.
In this embodiment, when the server receives a loading request of a combined audio sent by the browser, the server sends the pre-recombined combined audio to the browser, and simultaneously sends an audio tag and a mapping relationship between the audio tag and a corresponding time period in the combined audio to the browser. Therefore, after the audio tag is triggered at this time, the browser only needs to play the audio data of the audio tag triggered at this time in the corresponding time period in the combined audio, and does not need to send a loading request to the server again, so that the time for waiting for loading is effectively reduced, and the audio playing delay is avoided.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or browser that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or browser. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or browser that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (12)

1. A method for playing a webpage audio file is characterized by comprising the following steps:
the browser receives an audio tag triggering instruction and acquires an audio tag triggered this time in a current page;
when the combined audio corresponding to the triggered audio tag is loaded, searching the corresponding time period of the triggered audio tag in the combined audio;
playing audio data of a corresponding time period in the combined audio;
the combined audio is an audio file formed by sequentially arranging audio data of a plurality of original audio files in a current page and re-editing and combining the audio data according to a time sequence, blank data are filled in a blank mode under the condition that the durations of the original audio files are different, so that the starting time interval or the ending time interval of each section of audio data in the combined audio is equal, and the combined audio comprises audio data corresponding to all audio tags of the current page.
2. The method for playing audio files on a web page according to claim 1, wherein the step of receiving an audio tag triggering instruction by the browser and obtaining the currently triggered audio tag in the current page further comprises:
after entering a current page, the browser requests a server to load the combined audio of the current page;
and receiving the combined audio of the current page returned by the server.
3. The method for playing the audio file of the webpage according to claim 2, wherein the step of receiving the audio tag triggering instruction by the browser and obtaining the currently triggered audio tag in the current page further comprises:
when the combined audio corresponding to the triggered audio tag is not loaded, requesting a server to load the combined audio;
and receiving the combined audio corresponding to the triggered audio tag returned by the server, and executing the step of searching the corresponding time period of the triggered audio tag in the combined audio.
4. A method for playing a webpage audio file is characterized by comprising the following steps:
the server acquires an original audio file corresponding to each audio label on the current page from a database;
sequentially arranging the audio data of the original audio files, re-editing and merging the audio data into one audio file according to the time sequence, and using the audio file as the combined audio of the current page;
determining a corresponding time period of each original audio file in the combined audio according to the duration of each original audio file;
establishing a mapping relation between the corresponding time period of each original audio file in the combined audio and the audio label of the original audio file;
and under the condition that the time lengths of the original audio files are different, blank data are filled in a blank mode, so that the starting time interval or the ending time interval of each section of audio data in the combined audio is equal, and the combined audio comprises the audio data corresponding to all the audio tags of the current page.
5. The method for playing audio files on web pages according to claim 4, wherein the step of sequentially arranging the audio data of a plurality of said original audio files and re-editing and combining the audio data into one audio file in time sequence further comprises:
when the corresponding time periods of the original audio files in the combined audio are not equal, blank data is added before audio data with shorter corresponding time periods in the combined audio, so that the time intervals of the termination time of two adjacent sections of audio data in the combined audio are equal; or blank data is added after the audio data with the shorter corresponding time period in the combined audio, so that the time intervals of the starting time of two adjacent sections of audio data in the combined audio are equal.
6. The method for playing web page audio files according to claim 5, wherein the step of mapping each of the original audio files to the audio tags of the original audio files for the corresponding time period in the combined audio further comprises:
receiving a request for loading the combined audio of the current page, which is sent by a browser;
and returning the combined audio of the current page and the mapping relation between the audio tag of the current page and the corresponding time period of the combined audio to the browser.
7. A browser for playing audio files on a web page, comprising:
the instruction module is used for receiving an audio tag triggering instruction and acquiring the currently triggered audio tag in the current page;
the searching module is used for searching the corresponding time period of the triggered audio tag in the combined audio when the combined audio corresponding to the triggered audio tag is loaded;
the playing module is used for playing the audio data of the corresponding time period in the combined audio;
the generating module is used for sequentially arranging the audio data of a plurality of original audio files in the current page and re-editing and combining the audio data according to the time sequence to form an audio file, and under the condition that the durations of the original audio files are different, blank data are filled in a blank mode to enable the starting time interval or the ending time interval of each section of audio data in the combined audio to be equal, and the combined audio comprises the audio data corresponding to all audio tags of the current page.
8. The browser for playing back audio files on a web page of claim 7, further comprising a browser network module for:
after entering the current page, requesting a server to load the combined audio of the current page;
and receiving the combined audio of the current page returned by the server.
9. The browser for playing audio files on a web page of claim 8, wherein the browser network module is further configured to:
when the combined audio corresponding to the triggered audio tag is not loaded, requesting a server to load the combined audio;
and receiving the combined audio corresponding to the triggered audio label returned by the server.
10. A server for playing an audio file from a web page, comprising:
the editing module is used for acquiring an original audio file corresponding to each audio tag on the current page from a database; sequentially arranging the audio data of the original audio files, re-editing and merging the audio data into one audio file according to the time sequence, and using the audio file as the combined audio of the current page;
the mapping module is used for determining a corresponding time period of each original audio file in the combined audio according to the duration of each original audio file; establishing a mapping relation between the corresponding time period of each original audio file in the combined audio and the audio label of the original audio file
And the editing module is further configured to fill up blank data in a blank manner under the condition that the durations of the plurality of original audio files are different, so that the start time interval or the end time interval of each section of audio data in the combined audio is equal, and the combined audio includes audio data corresponding to all audio tags of the current page.
11. The server for playing web page audio files according to claim 10, wherein the editing module is further configured to:
when the corresponding time periods of the original audio files in the combined audio are not equal, blank data is added before audio data with shorter corresponding time periods in the combined audio, so that the time intervals of the termination time of two adjacent sections of audio data in the combined audio are equal; or blank data is added after the audio data with the shorter corresponding time period in the combined audio, so that the time intervals of the starting time of two adjacent sections of audio data in the combined audio are equal.
12. The server for playing the audio file of the web page as claimed in claim 10 or 11, further comprising a server network module for:
receiving a request for loading the combined audio of the current page, which is sent by a browser;
and returning the combined audio of the current page and the mapping relation between the audio tag of the current page and the corresponding time period of the combined audio to the browser.
CN201510430691.3A 2015-07-21 2015-07-21 Method for playing webpage audio file, browser and server Active CN106649297B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510430691.3A CN106649297B (en) 2015-07-21 2015-07-21 Method for playing webpage audio file, browser and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510430691.3A CN106649297B (en) 2015-07-21 2015-07-21 Method for playing webpage audio file, browser and server

Publications (2)

Publication Number Publication Date
CN106649297A CN106649297A (en) 2017-05-10
CN106649297B true CN106649297B (en) 2021-06-25

Family

ID=58815128

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510430691.3A Active CN106649297B (en) 2015-07-21 2015-07-21 Method for playing webpage audio file, browser and server

Country Status (1)

Country Link
CN (1) CN106649297B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112579039A (en) * 2020-12-25 2021-03-30 福州掌中云科技有限公司 Method and equipment for automatically playing audio of H5 page based on WeChat
CN115357211B (en) * 2022-10-19 2023-01-31 北京尽微致广信息技术有限公司 Audio playing method and device

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104410914A (en) * 2014-11-03 2015-03-11 乐视网信息技术(北京)股份有限公司 Method, device and terminal for playing multimedia contents

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2000043999A2 (en) * 1999-01-22 2000-07-27 Sony Electronics, Inc. Method and apparatus for synchronizing playback of multiple media types over networks having different transmission characteristics
WO2012033271A1 (en) * 2010-09-07 2012-03-15 에스케이텔레콤 주식회사 System for displaying cached webpages, a server therefor, a terminal therefor, a method therefor and a computer-readable recording medium on which the method is recorded
CN102156713A (en) * 2011-03-11 2011-08-17 上海全景数字技术有限公司 Multimedia playing method based on embedded equipment
CN102929971B (en) * 2012-10-15 2015-07-01 长春指南针科技有限公司 Multimedia information playing method and system
CN103618942B (en) * 2013-12-16 2016-09-28 乐视致新电子科技(天津)有限公司 Intelligent television and the playing method and device of browsing device net page video thereof

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104410914A (en) * 2014-11-03 2015-03-11 乐视网信息技术(北京)股份有限公司 Method, device and terminal for playing multimedia contents

Also Published As

Publication number Publication date
CN106649297A (en) 2017-05-10

Similar Documents

Publication Publication Date Title
CN102957712B (en) Site resource loading method and system
US20170163753A1 (en) Method and apparatus for controlling play device to play video
US20140243028A1 (en) Enhanced text messaging service
CN109036417B (en) Method and apparatus for processing voice request
CN103997452A (en) Information sharing method and apparatus among multiple platforms
CN103338384A (en) Video play method and video play device
CN109462601B (en) Multi-platform access method and device based on eSIM
CN107329976B (en) Webpage paging method and device, computer equipment and computer readable storage medium
CN107276842B (en) Interface test method and device and electronic equipment
WO2018107719A1 (en) Data sharing method, apparatus, terminal device and server
WO2015000383A1 (en) Method, apparatus and system for information recommending
CN104090887A (en) Music search method and device
EP3651421A1 (en) Multimedia display method, apparatus, and device
CN110928767A (en) Webpage analysis method, device, equipment and storage medium
CN106649297B (en) Method for playing webpage audio file, browser and server
JP2018500670A (en) Handling unstructured messages
CN109343908B (en) Method and device for delaying loading of JS script
CN112689170A (en) Content playing method of display terminal, display terminal and readable storage medium
CN116304403A (en) Webpage access method and device, computer equipment and storage medium
GB2505552A (en) Providing interactive content
CN111026669A (en) Test log management method, test log management device, and storage medium
CN111046308A (en) Page loading method and device
KR20180021152A (en) Information push method and apparatus
CN105589870B (en) Method and system for filtering webpage advertisements
CN114327675A (en) Method for starting mini-game application and related device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant