CN113284521A - Audio playing method, device, equipment, storage medium and program product - Google Patents

Audio playing method, device, equipment, storage medium and program product Download PDF

Info

Publication number
CN113284521A
CN113284521A CN202110544843.8A CN202110544843A CN113284521A CN 113284521 A CN113284521 A CN 113284521A CN 202110544843 A CN202110544843 A CN 202110544843A CN 113284521 A CN113284521 A CN 113284521A
Authority
CN
China
Prior art keywords
audio
time
network
playing
downloading
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.)
Pending
Application number
CN202110544843.8A
Other languages
Chinese (zh)
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.)
Qianhai Qijian Technology Shenzhen Co ltd
Original Assignee
Qianhai Qijian 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 Qianhai Qijian Technology Shenzhen Co ltd filed Critical Qianhai Qijian Technology Shenzhen Co ltd
Priority to CN202110544843.8A priority Critical patent/CN113284521A/en
Publication of CN113284521A publication Critical patent/CN113284521A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B20/00Signal processing not specific to the method of recording or reproducing; Circuits therefor
    • G11B20/10Digital recording or reproducing
    • G11B20/10009Improvement or modification of read or write signals
    • G11B20/10018Improvement or modification of read or write signals analog processing for digital recording or reproduction

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The present disclosure provides a method, an apparatus, a device, a storage medium, and a program product for audio playing, which relate to the audio playing technology and include: downloading and storing continuous audio clips, and stopping downloading when the total playing time of the stored audio clips reaches a storage time threshold; playing the stored audio clip when the network is disconnected; when the network disconnection time length is greater than the storage time length threshold value, if the network is recovered, determining the starting time of the audio clip needing to be downloaded according to the current time and the storage time length threshold value; the step of downloading and storing successive audio segments is continued in accordance with the start time. According to the scheme, the audio clip with the total playing time as the storage time threshold is downloaded and stored to the local when the network is normal, the audio clip stored in the local is played under the condition of network disconnection, the audio is continuously downloaded after the network is recovered, when the network disconnection time is less than or equal to the storage time threshold, the user does not feel network disconnection, and the experience of the user is improved.

Description

Audio playing method, device, equipment, storage medium and program product
Technical Field
The present disclosure relates to audio playing technologies, and in particular, to a method, an apparatus, a device, a storage medium, and a program product for audio playing.
Background
At present, with the increasing maturity of car networking technology, playing network radio on a car has become a trend.
In the prior art, when a network radio plays audio, audio data is acquired through a network and played. The playing address can be accessed specifically, and then audio data can be acquired.
The vehicle often can pass in and out the relatively poor region of network signal in the course of traveling, for example the vehicle can pass in and out the tunnel, and when the vehicle was in the tunnel, the network radio just can't visit the broadcast address, and then can't obtain audio data, just also can't normally broadcast the audio frequency. After the network exits the tunnel, the network radio can access the playing address, and then continue to acquire and play the audio data.
Therefore, under the condition of network interruption, the network radio stops playing audio, and when the network is recovered, the network radio recovers playing audio, and when the vehicle frequently enters and exits an area with poor network signals, the network radio can continuously play audio, so that poor user experience is caused.
Disclosure of Invention
The present disclosure provides a method, an apparatus, a device, a storage medium, and a program product for audio playing, so as to solve the problem that in the prior art, when a network is interrupted, a network radio stops playing audio, and when the network is recovered, the network radio resumes playing audio, and when a vehicle frequently enters an area with a poor network signal, the network radio may intermittently play audio, resulting in poor user experience.
According to a first aspect of the present application, there is provided an audio playing method, including: downloading and storing a plurality of audio clips with continuous time information, and stopping downloading the audio clips when the total playing time of the stored audio clips reaches a storage time threshold; sequentially acquiring and playing the stored audio clips under the condition of no network; when the network disconnection time length is greater than the storage time length threshold value, if the network is recovered, acquiring the current time, and determining the starting time of the audio clip needing to be downloaded according to the current time and the storage time length threshold value; and continuing to execute the step of downloading and storing a plurality of audio segments with continuous time information according to the starting time.
According to a second aspect of the present application, there is provided an audio playback apparatus comprising: the downloading unit is used for downloading and storing a plurality of audio clips with continuous time information, and stopping downloading the audio clips when the total playing time of the stored audio clips reaches a storage time threshold; the playing unit is used for sequentially acquiring and playing the stored audio clips under the condition that no network exists; the starting time determining unit is used for acquiring the current time if the network is recovered when the network disconnection time length is greater than the storage time length threshold value, and determining the starting time of the audio clip needing to be downloaded according to the current time and the storage time length threshold value; the downloading unit is further used for continuously executing the steps of downloading and storing a plurality of audio segments with continuous time information according to the starting time.
According to a third aspect of the present application, there is provided an electronic device comprising a memory and a processor; wherein the memory is used for storing a computer program; the processor is configured to read the computer program stored in the memory, and execute the audio playing method according to the computer program in the memory.
According to a fourth aspect of the present application, there is provided a computer-readable storage medium having stored therein computer-executable instructions, which when executed by a processor, implement an audio playing method according to the first aspect.
According to a fifth aspect of the present application, there is provided a computer program product comprising a computer program which, when executed by a processor, implements an audio playback method as described in the first aspect.
The present disclosure provides a method, an apparatus, a device, a storage medium, and a program product for audio playing, including: downloading and storing a plurality of audio clips with continuous time information, and stopping downloading the audio clips when the total playing time of the stored audio clips reaches a storage time threshold; sequentially acquiring and playing the stored audio clips under the condition of no network; when the network disconnection time length is greater than the storage time length threshold value, if the network is recovered, acquiring the current time, and determining the starting time of the audio clip needing to be downloaded according to the current time and the storage time length threshold value; and continuing to execute the step of downloading and storing a plurality of audio segments with continuous time information according to the starting time. According to the audio playing method, the audio clip with the total playing time as the storage time threshold is downloaded and stored to the local when the network is normal, the audio clip stored in the local can be obtained and played under the condition of network disconnection, the audio clip can be continuously downloaded to the local after the network is recovered, as long as the network disconnection time is less than or equal to the storage time threshold, a user cannot feel network disconnection, and the user experience is improved.
Drawings
Fig. 1 is a flowchart illustrating an audio playing method according to an exemplary embodiment of the present application;
fig. 2 is a schematic flowchart illustrating an audio playing method according to another exemplary embodiment of the present application;
fig. 3 is a process diagram of an audio playing method according to an exemplary embodiment of the present application;
fig. 4 is a block diagram of an audio playback device according to an exemplary embodiment of the present application;
fig. 5 is a block diagram of an audio playback apparatus according to another exemplary embodiment of the present application;
fig. 6 is a block diagram of an electronic device according to an exemplary embodiment of the present application.
Detailed Description
With the increasing maturity of car networking technology, playing network radio on cars has become a trend. When the network radio plays audio, the network radio acquires audio data through the network and plays the audio data. The playing address can be accessed specifically, and then audio data can be acquired. The vehicle often can pass in and out the relatively poor region of network signal in the course of traveling, for example the vehicle can pass in and out the tunnel, and when the vehicle was in the tunnel, the network radio just can't visit the broadcast address, and then can't obtain audio data, just also can't normally broadcast the audio frequency. After the network exits the tunnel, the network radio can access the playing address, and then continue to acquire and play the audio data.
Therefore, under the condition of network interruption, the network radio stops playing audio, and when the network is recovered, the network radio recovers playing audio, and when the vehicle frequently enters and exits an area with poor network signals, the network radio can continuously play audio, so that poor user experience is caused. Moreover, the contents played by the network radio generally have certain real-time performance, such as news programs.
In order to solve the technical problem, the scheme provided by the application comprises an audio playing method, wherein an audio clip with the total playing time as a storage time threshold is downloaded and stored to the local when the network is normal, the audio clip stored in the local can be acquired and played under the condition of network disconnection, and when the network disconnection time is greater than the storage time threshold, the starting time for downloading the audio clip can be determined according to the current time and the storage time threshold after the network is recovered. As long as the network disconnection time length is less than or equal to the storage time length threshold value, the user does not feel network disconnection, and the experience of the user is improved. When the network disconnection time length is larger than the storage time length threshold value, the starting time of playing the audio clip can be determined according to the current time and the storage time length threshold value when the audio is played again, and the real-time performance of audio playing is guaranteed.
Fig. 1 is a flowchart illustrating an audio playing method according to an exemplary embodiment of the present application.
As shown in fig. 1, the audio playing method provided by this embodiment includes:
step 101, downloading and storing a plurality of audio segments with continuous time information, and stopping downloading the audio segments when the total playing time of the stored audio segments reaches a storage time threshold.
The method provided by the application can be executed by an electronic device with computing capability, for example, an in-vehicle device provided in a vehicle, and the in-vehicle device can download an audio clip and play the audio clip.
The scheme provided by the application can be applied to a network radio, and the network radio can be arranged in electronic equipment, such as vehicle-mounted equipment. The network radio can be divided into two parts of a downloader and a player. The downloader can download and store the audio clip locally, specifically, the audio clip downloaded by the downloader can be stored in a reception pool, and the reception pool is a component of the downloader. The player can acquire the audio clips from the radio reception pool of the downloader and play the acquired audio clips.
The audio clip downloaded by the downloader may be a Transport Stream (ts) file, the ts file may be a playable voice file, and one ts file may be an audio clip.
Further, a background server of the network radio can acquire the radio station data from the cloud and slice the radio station data. For example, it is possible to set one ts file every 5s on average, and record information of an audio piece by an m3u8 file, for example, 10 ts files by an m3u8 file. Where the m3u8 file is a list file.
Specifically, the m3u8 file includes a download path of the ts file, station information, and time information. Each ts file has a time length of 5 s.
The downloader obtains the m3u8 file from the background server, analyzes the ts list file in the m3u8 file, and orderly downloads the ts file. Specifically, the audio clips may be downloaded in time sequence according to the time information of the audio clips.
The time information refers to the time attribute of the audio segments, including the start time, the end time, and the time length of each audio segment. An audio segment whose time information is continuous means that the end time of the previous audio segment is the start time of the following audio segment.
The audio clip downloaded by the downloader can be stored in a radio pool in the downloader.
The storage duration threshold refers to the duration of the maximum audio frequency storable in the reception pool. For example, the storage duration threshold may be set to be two minutes, and assuming that the duration of each audio clip is 5s, the reception pool may store 24 audio clips at maximum, and the sequence numbers may be 10001-10024 in chronological order.
Further, the downloader may stop downloading after the reception pool is full of 24 audio clips.
And step 102, sequentially acquiring and playing the stored audio clips under the condition of no network.
Specifically, the player of the network radio sequentially acquires and plays audio clips from the radio pool of the downloader, acquires and plays audio clips with the time being before first, and acquires and plays audio clips with the time being after later.
Further, under the condition that no network exists, the player can still obtain the pre-downloaded audio clip and play the audio clip, so that under the condition that no network exists, the scheme provided by the disclosure can still normally play the audio with the storage duration threshold.
In actual application, if no network exists, the downloader in the scheme can also send an HTTP request to the background server every 10s, if the background server responds to the HTTP request, the network can be connected, and if the background server does not respond to the HTTP request, it indicates that the network cannot be connected, and the downloader continues to send the HTTP request to the background server.
Further, under the condition of a network, the player acquires and plays an audio clip from the reception pool, the corresponding audio clip in the reception pool is deleted, and the downloader downloads a new audio clip from the background server and then the last audio clip in the reception pool and stores the new audio clip in the reception pool, so that the length of the audio in the reception pool is maintained at the storage duration threshold.
And 103, when the network disconnection time length is greater than the storage time length threshold value, if the network is recovered, acquiring the current time, and determining the starting time of the audio clip needing to be downloaded according to the current time and the storage time length threshold value.
Specifically, if the network disconnection time length is less than the storage time length threshold value, the downloader can continue to download the audio clip to supplement the data in the reception pool after the network is recovered. And when the network is recovered, the data in the reception pool is not played completely, so that the player can continuously acquire and play the audio clip from the reception pool in the period from the network disconnection to the network recovery, the playing state of the player cannot be interrupted, the user cannot perceive that the network is disconnected, and good user experience is further brought to the user.
Further, if the network disconnection time length is greater than the storage time length threshold value, the network is still not recovered when the player plays all the data pre-stored in the reception pool, and under the condition, the player cannot acquire the next audio clip to be played, so that the electronic equipment can display prompt information without the network.
In practical application, if the network disconnection time length is greater than the storage time length threshold value, the electronic equipment can continue to download the audio clip when the network is recovered. In this case, the electronic device may first obtain the current time, and determine the start time of the audio segment to be downloaded by combining the current time and the storage duration threshold. To ensure timeliness of the audio that continues to be downloaded.
The scheme provided by the disclosure can be applied to the network radio, and the content played by the network radio has certain real-time performance, for example, news programs are played, and the timeliness of the audio is very strong. If the content played before the network is disconnected is continuously downloaded after the network is recovered, the real-time performance of the downloaded audio content is poor. According to the scheme provided by the disclosure, the starting duration of the audio clip downloaded next can be determined according to the current time, so that the audio content conforming to the current time can be downloaded, and the audio content with better timeliness is provided for the user.
Assuming that the storage time length threshold is two minutes, if the network disconnection time length exceeds two minutes, acquiring the current time after the network is recovered, and determining the starting time of the audio clip needing to be downloaded according to the current time and the storage time length threshold.
In one embodiment, the current time may be subtracted by the storage duration threshold to obtain the start time of the audio segment to be downloaded. For example, if the score is 1/29/2021, 15/13, the network is recovered, the audio clip is downloaded at 15/11/1/29/2021, and after 5 audio clips are downloaded, the recovery play operation is performed.
The step 101 is continuously executed according to the determined starting time, that is, the step of downloading and storing a plurality of audio segments with continuous time information is continuously executed according to the starting time.
The application provides an audio playing method, which comprises the following steps: downloading and storing a plurality of audio clips with continuous time information, and stopping downloading the audio clips when the total playing time of the stored audio clips reaches a storage time threshold; sequentially acquiring and playing the stored audio clips under the condition of no network; when the network disconnection time length is greater than the storage time length threshold value, if the network is recovered, acquiring the current time, and determining the starting time of the audio clip needing to be downloaded according to the current time and the storage time length threshold value; and continuing to execute the step of downloading and storing a plurality of audio segments with continuous time information according to the starting time. According to the audio playing method, the audio clip with the total playing time as the storage time threshold is downloaded and stored to the local when the network is normal, the audio clip stored in the local can be obtained and played under the condition of network disconnection, and when the network disconnection time is greater than the storage time threshold, the starting time for downloading the audio clip can be determined according to the current time and the storage time threshold after the network is recovered. As long as the network disconnection time length is less than or equal to the storage time length threshold value, the user does not feel network disconnection, and the experience of the user is improved. When the network disconnection time length is larger than the storage time length threshold value, the starting time of playing the audio clip can be determined according to the current time and the storage time length threshold value when the audio is played again, and the real-time performance of audio playing is guaranteed.
Fig. 2 is a flowchart illustrating an audio playing method according to another exemplary embodiment of the present application.
As shown in fig. 2, the audio playing method provided by this embodiment includes:
step 201, an audio file list is obtained, where the audio file list includes a download address of each audio clip and time information of each audio clip.
The background server of the network radio station can cache one radio station audio data from the cloud end and slice the radio station audio data to generate one audio clip every 5s, and the audio clip can be in a ts format. The backend server may also record audio clips through an audio file list, which may be an m3u8 file, assuming 10 ts files are recorded at a time.
The network radio comprises a downloader and a player, wherein the downloader downloads and stores the audio clips to the local, and the player acquires the audio clips from the downloader and plays the audio.
A downloader in the network radio acquires an audio file list from a background server, wherein the audio file list is a file for recording audio clips and comprises a download address and time information of each audio clip. The downloader can parse the audio file list and acquire the download address and the time information of each audio clip.
The download address in the audio file list indicates that each audio clip corresponds to one download address, and the downloader can download the corresponding audio clip according to the download address. The time information in the audio file list means that each audio clip corresponds to a time information, and the time information includes the start time, the end time and the time length of the corresponding audio clip. Each audio clip has a corresponding download address and time information in the audio file list.
In another embodiment, the audio file list further includes station information for each audio clip.
Specifically, the audio file list may further include radio station information of each audio clip, and the downloader may acquire the audio file list from the background server and may acquire the radio station information of each audio clip after parsing the audio file list.
Further, each audio clip has a corresponding download address, time information and station information in the audio file list.
And 202, downloading and storing the audio clip according to the downloading address and the time information in the audio file list.
Specifically, the downloader parses the audio file list, may obtain a download address and time information of the audio file, may download each audio clip according to the download address and time information, and stores the downloaded audio clip in a reception pool in the downloader.
In another embodiment, the download address of each audio clip is sequentially accessed according to the time information of each audio clip; each audio clip is retrieved and stored in turn from the location pointed to by the download address.
Specifically, according to the time information in the audio file list, the download addresses of the corresponding audio clips are sequentially accessed according to the continuous time sequence, each audio clip is obtained from the position pointed by the download address, and the audio clips are stored in the sound receiving pool. Wherein, the sequential time sequence means that the end time of the previous audio segment is the start time of the next audio segment.
And step 203, when the total playing time of the downloaded audio clips reaches the playing time threshold, playing the audio clips one by one according to the time information of each audio clip.
The playing time threshold refers to a threshold of the total playing time of the audio clips stored in the reception pool, and the playing time threshold is a preset value, for example, the playing time threshold may be set to 25s, and if the time of each audio clip is 5s, the playing time threshold is reached when 5 audio clips are stored in the reception pool.
Specifically, when the network is normal, the downloader can download all the audio clips in the audio file list and store the audio clips in the reception pool, when the total playing time of the audio clips stored in the reception pool reaches the playing time threshold, the downloader sends a message to the player, the player acquires the audio clips in the reception pool according to the time information of each piece of audio information and according to the continuous and sequential time sequence, and plays the audio clips one by one after each acquisition. The audio clip obtained by the player is deleted from the sound reception pool.
And step 204, after the audio clip is played, continuing to download the audio clip, so that the total playing time of the stored and unplayed audio clip reaches the storage time threshold.
The storage duration threshold refers to the duration of the maximum audio frequency storable in the reception pool. The storage period threshold is set in advance, assuming that the storage period threshold is set to 2 minutes. Then if the duration of each audio clip is 5s, a maximum of 24 audio clips can be stored in the reception pool.
Specifically, when the network is normal, the downloader downloads and stores the audio clips into the reception pool in order, and the reception pool is full of 24 audio clips, and when the player plays an audio file, the reception pool deletes one audio clip, and the corresponding downloader downloads another audio clip into the reception pool, so that 24 audio clips are always stored in the reception pool.
And the playing time length threshold is smaller than the storage time length threshold.
The storage duration threshold refers to the duration of the maximum audio frequency storable in the reception pool. The playing time length threshold refers to a threshold of the total playing time length of the audio clips stored in the reception pool, and when the playing time length threshold is reached, the player obtains the audio clips from the reception pool and plays the audio clips. Therefore, if the playing duration threshold is greater than the storage duration threshold, the voice clip cannot be played.
And step 205, stopping downloading the audio clip when the total playing time of the stored audio clip reaches the storage time threshold.
Step 205 is similar to the implementation manner and principle of the related content in step 101, and is not described again.
And step 206, under the condition that no network exists, sequentially acquiring audio clips corresponding to the radio station information being played according to the radio station information being played and the radio station information included in the audio file list, and playing the acquired audio and video clips.
Specifically, the network radio includes more than one radio station, and if the network is disconnected, the radio station information of the audio clip stored in the radio pool is the radio station information of the audio clip currently being played. If the user does not change the radio station when the network is disconnected, the player can accordingly obtain the audio clip from the radio pool and play the audio clip.
In one embodiment, if the station is changed when the network is disconnected, no corresponding audio clip will be playable, at which point the network radio will load a turn.
In another embodiment, audio segments of multiple radio stations may be cached, and further, in the absence of a network, even if a user switches a radio station being played, the electronic device may obtain a corresponding audio segment and play the audio segment.
And step 207, when the network disconnection time length is greater than the storage time length threshold value, if the network is recovered, acquiring the current time, and taking the time obtained by subtracting the storage time length threshold value from the current time as the starting time of the audio clip needing to be downloaded.
Specifically, assuming that the storage time threshold is 2 minutes, when the network disconnection time is longer than 2 minutes, the player has no network after playing 24 audio clips stored in the reception pool, and at this time, the network radio may load a turn.
When the network is restored, the electronic device may obtain the current time, for example, the current time is 13 minutes from 1 month, 29 days and 15 days of 2021, and take the current time minus two minutes, that is, 11 minutes from 1 month, 29 days and 15 days of 2021 as the starting time for downloading the audio clip.
In step 208, the start audio segment with the same time information as the start time is downloaded and stored.
Specifically, for example, the 15 th day 11 of 29 th day 1/29 in 2021 is taken as the starting time of the audio clip to be downloaded, the downloader parses from the audio file list and finds the corresponding audio clip whose time information is the starting time and this time, and downloads and stores this audio clip as the starting audio clip.
In this case, the audio clip acquired by the electronic device may be an audio clip corresponding to the current time, and the electronic device may be further enabled to play the latest audio content after the network is restored.
And step 209, sequentially downloading and storing other audio clips with time information later than the starting time and continuous time information.
Specifically, starting from the initial audio clip, the downloader sequentially downloads and stores the audio clips into the reception pool according to a continuous time sequence. When the reception pool is full of 5 audio files, the downloader sends a signal to the player, the player sequentially acquires and plays the audio files from the reception pool, and one audio file is deleted from the reception pool every time one audio file is played. The downloader downloads the audio files to the sound reception pool, and stops downloading when the number of the audio files stored in the sound reception pool is 24, and the 24 audio files stored in the sound reception pool are always kept.
In another embodiment, when the network disconnection time length is less than or equal to the storage time length threshold value, if the network is recovered, the latest time information in each stored audio clip is determined.
Specifically, assuming that the storage time threshold is 2 minutes, when the network disconnection time is less than or equal to 2 minutes, the player does not play 24 audio clips stored in the reception pool, and the network is recovered. If the 24 audio clips in the reception pool are 10001-10024 respectively according to the time sequence, assuming that the 20 th audio clip has been played at this time, the network replies, and the downloader determines that the latest time information in each stored audio clip is 10024.
And determining the starting time of the next audio clip to be downloaded according to the latest time information.
Specifically, if the downloader determines that the latest time information included in each stored audio clip is 10024, the downloader continues to download the audio clip with the start time of the audio clip No. 10025 as the start time from the background server.
And continuing to execute the step of downloading and storing a plurality of audio segments with continuous time information according to the starting time.
Specifically, if it is determined that the start time of the 10025 th audio clip is the start time, the downloader continues to download 24 full audio files from the 10025 th audio clip and stores the audio files in the reception pool, and the iteration is continued.
Fig. 3 is a process diagram of an audio playing method according to an exemplary embodiment of the present application.
As shown in fig. 3, the downloader obtains the audio file list from the background server, parses the audio file list, obtains the time information of the audio clip, obtains the current time, compares the time information of the audio clip with the current time, and downloads the audio clip two minutes ago by the downloader, that is, downloads the audio clip two minutes ago by the current time according to the time continuity and the time sequence and stores the audio clip into the reception pool.
When the download is full of 5 audio clips, the audio clips are continuously downloaded, and a signal is given to the player, and the player acquires the audio clips from the downloader and plays the audio clips. And when the radio reception pool is full of 24 audio clips, the corresponding downloader stops downloading the audio clips, so that the audio clips stored in the radio reception pool are kept at 24.
When the network is normal, the above operations are continued. When the network is disconnected, the network is detected by adopting a heartbeat continuous detection method, specifically, the downloader sends an HTTP request to the background server every 10s, if the background server responds to the HTTP request, the network can be connected, if the background server does not respond to the HTTP request, the situation that the network cannot be connected is indicated, and the downloader can continuously send the HTTP request to the background server. When the network is restored, the above operation is continued from the acquisition of the audio file list.
Fig. 4 is a block diagram of an audio playback apparatus according to an exemplary embodiment of the present application.
As shown in fig. 4, the audio playing apparatus 400 provided by the present application includes:
the downloading unit 410 is configured to download and store a plurality of audio segments with continuous time information, and stop downloading the audio segments when a total playing time of the stored audio segments reaches a storage time threshold.
A playing unit 420, configured to sequentially acquire and play the stored audio clips without a network.
The start time determining unit 430 is configured to, when the network disconnection time length is greater than the storage time length threshold, obtain the current time if the network is recovered, and determine the start time of the audio segment to be downloaded according to the current time and the storage time length threshold.
The downloading unit 410 is further configured to continue to perform the step of downloading and storing a plurality of audio segments having time information in succession according to the start time.
The principle, implementation and technical effects of the audio playing device provided by the application are similar to those of fig. 1, and are not repeated.
Fig. 5 is a block diagram of an audio playback apparatus according to another exemplary embodiment of the present application.
As shown in fig. 5, on the basis of the above embodiment, in the audio playing apparatus 500 provided by the present application, the start time determining unit 430 includes:
and the start time determining module 431 is configured to use a time obtained by subtracting the storage duration threshold from the current time as the start time of the audio segment to be downloaded.
In the audio playing apparatus 500 provided in the present application, the downloading unit 410 is specifically configured to:
downloading and storing an initial audio clip with the same time information as the initial time;
and sequentially downloading and storing other audio clips with time information later than the starting time and continuous time information.
In the audio playback apparatus 500 provided by the present application, the downloading unit 410 includes:
an audio list file obtaining module 411, configured to obtain an audio file list, where the audio file list includes a download address of each audio clip and time information of each audio clip;
and the downloading module 412 is configured to download and store the audio clip according to the downloading address and the time information in the audio file list.
The downloading module 412 is specifically configured to: sequentially accessing the download address of each audio clip according to the time information of each audio clip and the time sequence;
each audio clip is retrieved and stored in turn from the location pointed to by the download address.
The audio list file obtaining module 411 obtains an audio file list, where the audio file list further includes station information of each audio clip.
In the audio playing apparatus 500 provided by the present application, the playing unit 420 includes:
the playing module 421 is configured to sequentially obtain an audio clip corresponding to the currently playing radio station information according to the currently playing radio station information and the radio station information included in the audio file list, and play the obtained audio/video clip.
In the audio playing apparatus 500 provided in the present application, the playing unit 420 is specifically configured to:
when the total playing time of the downloaded audio clips reaches a playing time threshold, the audio clips are played one by one according to the time information of each audio clip;
after the audio clip is played, continuing to download the audio clip so that the total playing time of the stored and unplayed audio clip reaches a storage time threshold;
and the playing time length threshold is smaller than the storage time length threshold.
In the audio playing apparatus 500 provided in the present application, the downloading unit 410 is further configured to:
when the network disconnection time length is less than or equal to the storage time length threshold value, if the network is recovered, determining the latest time information in each stored audio clip;
determining the starting time of the next audio clip to be downloaded according to the latest time information;
and continuing to execute the step of downloading and storing a plurality of audio segments with continuous time information according to the starting time.
Fig. 6 is a block diagram of an electronic device according to an exemplary embodiment of the present application.
As shown in fig. 6, the electronic device provided in this embodiment includes:
a memory 601;
a processor 602; and
a computer program;
wherein the computer program is stored in the memory 601 and configured to be executed by the processor 602 to implement any of the audio playback methods as above.
The present embodiments also provide a computer-readable storage medium, having stored thereon a computer program,
the computer program is executed by a processor to implement any of the audio playback methods as above.
The present embodiment also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the computer program implements any of the audio playing methods described above.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (12)

1. An audio playing method, comprising:
downloading and storing a plurality of audio clips with continuous time information, and stopping downloading the audio clips when the total playing time of the stored audio clips reaches a storage time threshold;
sequentially acquiring and playing the stored audio clips under the condition of no network;
when the network disconnection time length is greater than the storage time length threshold value, if the network is recovered, acquiring the current time, and determining the starting time of the audio clip needing to be downloaded according to the current time and the storage time length threshold value;
and continuing to execute the step of downloading and storing a plurality of audio segments with continuous time information according to the starting time.
2. The method of claim 1, wherein determining the start time of the audio segment to be downloaded according to the current time and the storage duration threshold comprises:
and the time obtained by subtracting the storage duration threshold value from the current time is used as the starting time of the audio clip needing to be downloaded.
3. The method of claim 1, wherein the step of continuing to download and store a plurality of audio segments with continuous time information according to the starting time comprises:
downloading and storing an initial audio clip with the same time information as the initial time;
and sequentially downloading and storing other audio clips with time information later than the starting time and continuous time information.
4. The method of claim 1, wherein downloading and storing a plurality of audio clips having time information continuity comprises:
acquiring an audio file list, wherein the audio file list comprises a download address of each audio clip and time information of each audio clip;
and downloading and storing the audio clip according to the downloading address and the time information in the audio file list.
5. The method of claim 4, wherein the downloading and storing the audio clip according to the download address and the time information in the audio file list comprises:
sequentially accessing the download address of each audio clip according to the time information of each audio clip and the time sequence;
and sequentially acquiring and storing each audio clip from the position pointed by the download address.
6. The method according to claim 1 or 5, wherein the audio file list further comprises station information of each audio clip;
the sequentially acquiring and playing the stored audio clips without a network includes:
and according to the radio station information which is currently played and the radio station information in the audio file list, sequentially acquiring audio frequency fragments corresponding to the radio station information which is currently played, and playing the acquired audio and video frequency fragments.
7. The method of claim 1, wherein after downloading and storing the plurality of audio segments with time information in succession, further comprising:
when the total playing time of the downloaded audio clips reaches a playing time threshold, the audio clips are played one by one according to the time information of each audio clip;
after the audio clip is played, continuing to download the audio clip so that the total playing time of the stored and unplayed audio clip reaches the storage time threshold;
wherein the playing time length threshold is smaller than the storage time length threshold.
8. The method of claim 1, further comprising:
when the network disconnection time length is less than or equal to the storage time length threshold value, if the network is recovered, determining the latest time information in each stored audio clip;
determining the starting time of the next audio clip to be downloaded according to the latest time information;
and continuing to execute the step of downloading and storing a plurality of audio segments with continuous time information according to the starting time.
9. An audio playback apparatus, comprising:
the downloading unit is used for downloading and storing a plurality of audio clips with continuous time information, and stopping downloading the audio clips when the total playing time of the stored audio clips reaches a storage time threshold;
the playing unit is used for sequentially acquiring and playing the stored audio clips under the condition that no network exists;
the starting time determining unit is used for acquiring the current time if the network is recovered when the network disconnection time length is greater than the storage time length threshold value, and determining the starting time of the audio clip needing to be downloaded according to the current time and the storage time length threshold value;
the downloading unit is further used for continuously executing the steps of downloading and storing a plurality of audio segments with continuous time information according to the starting time.
10. An electronic device comprising a memory and a processor; wherein,
the memory for storing a computer program;
the processor is configured to read the computer program stored in the memory and execute the method of any one of claims 1 to 8 according to the computer program in the memory.
11. A computer-readable storage medium having computer-executable instructions stored thereon which, when executed by a processor, implement the method of any one of claims 1-8.
12. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, carries out the method of any one of the preceding claims 1-8.
CN202110544843.8A 2021-05-19 2021-05-19 Audio playing method, device, equipment, storage medium and program product Pending CN113284521A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110544843.8A CN113284521A (en) 2021-05-19 2021-05-19 Audio playing method, device, equipment, storage medium and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110544843.8A CN113284521A (en) 2021-05-19 2021-05-19 Audio playing method, device, equipment, storage medium and program product

Publications (1)

Publication Number Publication Date
CN113284521A true CN113284521A (en) 2021-08-20

Family

ID=77279886

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110544843.8A Pending CN113284521A (en) 2021-05-19 2021-05-19 Audio playing method, device, equipment, storage medium and program product

Country Status (1)

Country Link
CN (1) CN113284521A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114416012A (en) * 2021-12-14 2022-04-29 阿波罗智联(北京)科技有限公司 Audio continuous playing method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104899058A (en) * 2015-05-19 2015-09-09 小米科技有限责任公司 Pre-downloading method and apparatus
CN105072480A (en) * 2015-07-29 2015-11-18 无锡天脉聚源传媒科技有限公司 Video live broadcast method and device
CN107484040A (en) * 2017-08-29 2017-12-15 四川长虹电器股份有限公司 A kind of method for realizing network acceleration
CN109672745A (en) * 2018-12-29 2019-04-23 苏州思必驰信息科技有限公司 The online control method for playing back of audio and device for FreeRTOS
CN112040303A (en) * 2020-07-22 2020-12-04 咪咕音乐有限公司 Audio and video playing method and device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104899058A (en) * 2015-05-19 2015-09-09 小米科技有限责任公司 Pre-downloading method and apparatus
CN105072480A (en) * 2015-07-29 2015-11-18 无锡天脉聚源传媒科技有限公司 Video live broadcast method and device
CN107484040A (en) * 2017-08-29 2017-12-15 四川长虹电器股份有限公司 A kind of method for realizing network acceleration
CN109672745A (en) * 2018-12-29 2019-04-23 苏州思必驰信息科技有限公司 The online control method for playing back of audio and device for FreeRTOS
CN112040303A (en) * 2020-07-22 2020-12-04 咪咕音乐有限公司 Audio and video playing method and device, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114416012A (en) * 2021-12-14 2022-04-29 阿波罗智联(北京)科技有限公司 Audio continuous playing method and device

Similar Documents

Publication Publication Date Title
CN106658226B (en) Playing method and device
CN111512635B (en) Method and system for selectively skipping media content
US9736206B2 (en) Client device, method and computer program for playing media content
CN103475932A (en) Seamless on-line playing method and device of network video and network television system
WO2017161766A1 (en) Method and device for resuming video playback across multiple terminals
CN110870280B (en) Method, system, receiver and program for delivering interrupted audio content
US10972206B1 (en) Systems and methods for generating playlist for a vehicle
CN103873926A (en) Method and system for downloading and playing media file
CN105072480B (en) A kind of net cast method and device
US10999391B2 (en) Dynamic filtering and amelioration of content stream manifests
CN106878815B (en) Video playing method and device
US20210281904A1 (en) Systems and methods for generating playlist for a vehicle
CN108153882A (en) A kind of data processing method and device
CN112104909A (en) Interactive video playing method and device, computer equipment and readable storage medium
CN107864406B (en) Time shift video broadcasting method, device and system
CN113284521A (en) Audio playing method, device, equipment, storage medium and program product
CN110290396B (en) Video processing method, device, system, equipment and storage medium
CN107205177A (en) Video broadcasting method and device
CN105451098A (en) Method and device for providing multimedia file
CN106658150B (en) Method and device for realizing review processing
JP5314915B2 (en) In-vehicle video playback device
CN113691873A (en) Video playing method, device, system, terminal and storage medium
CN101345068A (en) Multimedia document recording, locating and playing method and device
CN102594773B (en) A kind of method and system for realizing data acquisition
CN109729380B (en) Audio and video playing method and equipment

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
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20210820

WD01 Invention patent application deemed withdrawn after publication