CN108322818B - Audio format processing method in audio playing - Google Patents

Audio format processing method in audio playing Download PDF

Info

Publication number
CN108322818B
CN108322818B CN201810165083.8A CN201810165083A CN108322818B CN 108322818 B CN108322818 B CN 108322818B CN 201810165083 A CN201810165083 A CN 201810165083A CN 108322818 B CN108322818 B CN 108322818B
Authority
CN
China
Prior art keywords
audio
format
file
playing
audio file
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
CN201810165083.8A
Other languages
Chinese (zh)
Other versions
CN108322818A (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.)
Beijing Kuwo Technology Co Ltd
Original Assignee
Beijing Kuwo Technology 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 Beijing Kuwo Technology Co Ltd filed Critical Beijing Kuwo Technology Co Ltd
Priority to CN201810165083.8A priority Critical patent/CN108322818B/en
Publication of CN108322818A publication Critical patent/CN108322818A/en
Application granted granted Critical
Publication of CN108322818B publication Critical patent/CN108322818B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/439Processing of audio elementary streams
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/439Processing of audio elementary streams
    • H04N21/4398Processing of audio elementary streams involving reformatting operations of audio signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/442Monitoring of processes or resources, e.g. detecting the failure of a recording device, monitoring the downstream bandwidth, the number of times a movie has been viewed, the storage space available from the internal hard disk
    • H04N21/44204Monitoring of content usage, e.g. the number of times a movie has been viewed, copied or the amount which has been watched
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/81Monomedia components thereof
    • H04N21/8106Monomedia components thereof involving special audio data, e.g. different tracks for different languages
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/85Assembly of content; Generation of multimedia applications
    • H04N21/858Linking data to content, e.g. by linking an URL to a video object, by creating a hotspot
    • H04N21/8586Linking data to content, e.g. by linking an URL to a video object, by creating a hotspot by using a URL

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Reverberation, Karaoke And Other Acoustics (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

The invention relates to an audio format processing strategy in audio playing, which comprises the following steps: acquiring necessary information for audio playing; judging whether the necessary information for audio playing is completely available; acquiring the audio format of an audio file from the necessary audio playing information; inquiring from the temporary storage of the audio file, if yes, directly obtaining from the temporary storage, if not: acquiring an acquisition address of an audio file from the necessary audio playing information, analyzing and accessing the acquisition address, analyzing and storing the acquisition address into a temporary audio format; and judging whether the temporary audio format is the same as the audio format recorded in the necessary information of audio playing, if not, converting the temporary audio format into the audio format for correction, if so, caching the audio file, and returning the audio format for calling a decoder. The invention has clear processing flow, good fault tolerance, high safety and high decoding speed, can decode in consideration of various file protocols and various audio formats, ensures the operating efficiency of the player, has good online playing safety and reliability and is convenient for later maintenance.

Description

Audio format processing method in audio playing
Technical Field
The invention relates to the technical field of audio online transmission and playing, in particular to an audio format processing strategy in audio playing.
Background
Streaming media, also called streaming media, is a media that is broadcast while being transmitted, and is a kind of multimedia. The transmission and the broadcasting are as follows: while the media provider is "transmitting" the media over the network, the user is constantly receiving and viewing (video) or listening (audio) to the transmitted media. "streaming" of "streaming" media refers to the manner in which the media is transported (streamed), and not to the media itself. Namely: the streaming media refers to a media format played on the Internet by streaming.
The delivery server sends out media information (media for short) as packets to the network. After the user decompresses the packets through the decompression device, the media is displayed as it was before transmission. Streaming media has wide application in remote education, video on demand, network radio stations, network video and the like.
In the prior art, there are two schemes of downloading and streaming mainly for transmitting media information such as audio/video and the like on a network.
Downloading often takes minutes or even hours, a large storage capacity is locally required by the user to support downloading and saving of the media, and the user can view (video) or listen to (audio) media information after downloading, so that the processing method is also very delayed.
Streaming is particularly suitable for time-based media (audio, video, and other multimedia files) which are continuously transmitted to a user computer in real time by a transmission server, and the user does not need to wait until the whole file is completely downloaded, but only needs to watch or listen after a start delay of several seconds or tens of seconds. The remainder of the file will continue to be transferred from the server in the background as the time-based media is played on the client. Streaming not only shortens the start-up delay by ten or hundred times, but also does not require too much buffer capacity. Streaming avoids the disadvantage that the user has to wait for the entire file to be downloaded all over the Internet before viewing.
The streaming media does not download the entire file before playing, but only stores the beginning part of the content into the user's computer (e.g., memory), and the data stream of the streaming media is transmitted and played at any time, but there is some delay at the beginning. The key technology for realizing streaming media is streaming transmission.
Streaming is widely defined and refers primarily to the general term of technologies for transmitting media (e.g., audio, video) over a network. There are two methods for implementing streaming: real time streaming (Real time streaming) and sequential streaming (progressive streaming).
Sequential streaming is sequential downloading, where the user can view the online media while downloading the file, and at a given time, the user can only view the downloaded portion, but cannot jump to the top portion that has not yet been downloaded, and no adjustments are made to the download sequence during transmission based on the speed at which the user is connected.
Real-time streaming can ensure that the media signal bandwidth matches the network connection so that the media can be viewed in real-time. Real-time streaming adjusts the quality of the output audio/video according to network conditions to achieve continuous real-time delivery of media, and users can fast forward or rewind to view content ahead or behind.
Generally speaking, a real-time Protocol such as video broadcast in real time, Streaming media server, or RTSP (real time Streaming Protocol, RFC2326, real-time Streaming Protocol, which is an application layer Protocol in TCP/IP Protocol system) is applied, i.e. real-time Streaming. If an HTTP (HyperText Transfer Protocol, which is the most widely used network Protocol on the internet) server is used, the file is sent through a sequential stream, that is, the file is transmitted through a sequential stream. Which transmission method is used depends on the specific requirements. Of course, streaming files also support full download to the hard disk before playback.
Concept of flow: flow, in brief, is an abstract data processing tool based on an object-oriented basis. In a stream, some basic operations for processing data are defined, such as reading data, writing data, etc., and a programmer performs all operations on the stream without concern for the true flow direction of the other data of the stream. The stream can process not only files, but also various data forms such as dynamic memory, network data and the like. If you are very skilled in the operation of the stream, the write start procedure will greatly improve efficiency by taking advantage of the convenience of the stream in the procedure.
In the iOS system, a file stream operation class-NSFileHandle is provided, so that files can be used more effectively, and Objective-C uses the NSFileHandle class to perform stream operation on the files, so that streaming media can be well supported, and the method is more suitable for online audio transmission and playing.
The basic steps of NSFileHandle are as follows:
1. and opening the file to acquire the NSFileHandle object.
2. For the above open file, the I/O stream operation is performed through the NSFileHandle object.
3. The file is closed.
Since audio media relate to copyright, security and reliability of the audio media in network transmission are key points of industry competition, processing strategies of various families during audio playing are different, and in consideration of coordination and later maintenance of front-end development and background development, it is necessary to unify and standardize audio playing strategies suitable for apps (short for english Application, which refers to third-party Application programs of smart devices, such as smart phones, smart tablets and the like, and the smart devices can be collectively called clients) of the enterprise.
During audio playing, the cached audio file may be different from the expected audio format for various reasons, which may easily affect the normal playing of the audio, and a fault-tolerant design is required to avoid affecting the user experience.
Disclosure of Invention
Aiming at the defects in the prior art, the invention aims to provide an audio format processing strategy in audio playing, which has clear processing flow, good fault tolerance, high safety and high decoding speed, can decode multiple file protocols and multiple audio formats, ensures the operating efficiency of a player, has good online playing safety and reliability and is convenient for later maintenance.
In order to achieve the above purposes, the technical scheme adopted by the invention is as follows:
an audio format processing strategy in audio playing is characterized by comprising the following steps:
acquiring necessary information for audio playing, and taking the information as basic audio information;
judging whether the necessary information for audio playing is complete and available, and if the information is incomplete and available, returning unavailable error information;
acquiring the audio format of an audio file from the necessary audio playing information;
the audio file is searched from the temporary storage device of the audio file,
if the register has audio files with the same audio format, it will be directly obtained from the register,
if there is no audio file with the same audio format in the register, then:
acquiring an acquisition address of an audio file from the necessary audio playing information, analyzing and accessing the acquisition address, analyzing an audio format, and storing the audio format obtained by analysis as a temporary audio format;
judging whether the temporary audio format is the same as the audio format recorded in the necessary audio playing information,
if the difference is not the same, the audio format correction processing is carried out,
and if the audio file is the same, caching the audio file and returning the audio format for decoder calling.
On the basis of the above technical solution, the audio playing necessary information at least includes:
an ID of an audio file for uniquely identifying a certain audio file,
the audio file acquisition address comprises: a physical address of the audio file, or a URL address of the audio file, the physical address corresponding to playing local audio, the URL address corresponding to playing online audio,
the audio format of the audio file is such that,
the bit rate of the audio file is determined,
the playing time of the audio file.
On the basis of the technical scheme, when the acquired address is the physical address of the audio file, the local audio is played for processing,
and when the acquired address is the URL address of the audio file, requesting a network channel and attempting to access the audio file.
On the basis of the technical scheme, the specific steps for judging whether the necessary audio playing information is complete and available are as follows:
it is checked whether the necessary information for audio playback is missing,
it is checked whether the ID format of the audio file is correct,
it is checked whether the audio file is in the correct acquisition address format,
it is checked whether the audio format of the audio file is an audio format supported by the player,
check if the bitrate format of the audio file is correct.
On the basis of the technical scheme, when the audio file is cached, the audio file is written into the temporary storage device at the same time.
On the basis of the above technical solution, the audio format correction processing specifically includes:
transmitting the audio format described in the audio playback necessary information to the server,
the temporary audio format is sent to the server,
the server determines which is the correct audio format, makes the audio format correspond to the audio file,
the server modifies the audio format described in the audio playback necessary information or modifies the provisional audio format,
and according to the correction instruction of the server, stopping caching the audio file, emptying the cache region and re-caching the audio file.
On the basis of the technical scheme, if the audio format correction processing fails, returning an unknown format error, stopping caching the audio file, and emptying a cache region.
The audio format processing strategy in the audio playing of the invention has clear processing flow, good fault tolerance, high safety and high decoding speed, can simultaneously decode a plurality of file protocols and a plurality of audio formats, ensures the operating efficiency of the player, has good online playing safety and reliability and is convenient for later maintenance.
Drawings
The invention has the following drawings:
FIG. 1 is a flow chart of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings.
As shown in fig. 1, the audio format processing strategy in audio playing according to the present invention includes the following steps:
acquiring necessary information for audio playing, and taking the information as basic audio information;
judging whether the necessary information for audio playing is complete and available, and if the information is incomplete and available, returning unavailable error information;
acquiring the audio format of an audio file from the necessary audio playing information;
the audio file is searched from the temporary storage device of the audio file,
if the register has audio files with the same audio format, it will be directly obtained from the register,
if there is no audio file with the same audio format in the register, then:
acquiring an acquisition address of an audio file from the necessary audio playing information, analyzing and accessing the acquisition address, analyzing an audio format, and storing the audio format obtained by analysis as a temporary audio format;
judging whether the temporary audio format is the same as the audio format recorded in the necessary audio playing information,
if the difference is not the same, the audio format correction processing is carried out,
and if the audio file is the same, caching the audio file and returning the audio format for decoder calling.
On the basis of the above technical solution, the audio playing necessary information at least includes:
an ID of an audio file for uniquely identifying a certain audio file,
the audio file acquisition address comprises: a physical address of the audio file, or a URL address of the audio file, the physical address corresponding to playing local audio, the URL address corresponding to playing online audio,
the audio format of the audio file is such that,
the bit rate of the audio file is determined,
the playing time of the audio file.
On the basis of the technical scheme, when the acquired address is the physical address of the audio file, the local audio processing is replayed and implemented according to the prior art, detailed description is not needed,
and when the acquired address is the URL address of the audio file, requesting a network channel and attempting to access the audio file.
On the basis of the technical scheme, the specific steps for judging whether the necessary audio playing information is complete and available are as follows:
it is checked whether the necessary information for audio playback is missing,
it is checked whether the ID format of the audio file is correct,
it is checked whether the audio file is in the correct acquisition address format,
it is checked whether the audio format of the audio file is an audio format supported by the player,
check if the bitrate format of the audio file is correct.
On the basis of the technical scheme, when the audio file is cached, the audio file is written into the temporary storage device at the same time.
On the basis of the above technical solution, the audio format correction processing specifically includes:
transmitting the audio format described in the audio playback necessary information to the server,
the temporary audio format is sent to the server,
the server determines which is the correct audio format, makes the audio format correspond to the audio file,
the server modifies the audio format described in the audio playback necessary information or modifies the provisional audio format,
and according to the correction instruction of the server, stopping caching the audio file, emptying the cache region and re-caching the audio file.
On the basis of the technical scheme, if the audio format correction processing fails, returning an unknown format error, stopping caching the audio file, and emptying a cache region.
Those not described in detail in this specification are within the skill of the art.

Claims (6)

1. An audio format processing method in audio playing is characterized by comprising the following steps:
acquiring necessary information for audio playing, and taking the information as basic audio information;
judging whether the necessary information for audio playing is complete and available, and if the information is incomplete and available, returning unavailable error information;
acquiring the audio format of an audio file from the necessary audio playing information;
the audio file is searched from the temporary storage device of the audio file,
if the register has audio files with the same audio format, it will be directly obtained from the register,
if there is no audio file with the same audio format in the register, then:
acquiring an acquisition address of an audio file from the necessary audio playing information, analyzing and accessing the acquisition address, analyzing an audio format, and storing the audio format obtained by analysis as a temporary audio format;
judging whether the temporary audio format is the same as the audio format recorded in the necessary audio playing information,
if the difference is not the same, the audio format correction processing is carried out,
if the two audio files are the same, caching the audio file, and returning an audio format for calling a decoder;
the audio format correction processing specifically includes:
transmitting the audio format described in the audio playback necessary information to the server,
the temporary audio format is sent to the server,
the server determines which is the correct audio format, makes the audio format correspond to the audio file,
the server modifies the audio format described in the audio playback necessary information or modifies the provisional audio format,
and according to the correction instruction of the server, stopping caching the audio file, emptying the cache region and re-caching the audio file.
2. The audio format processing method in audio playback according to claim 1, characterized in that: the necessary audio playing information at least comprises:
an ID of an audio file for uniquely identifying a certain audio file,
the audio file acquisition address comprises: a physical address of the audio file, or a URL address of the audio file, the physical address corresponding to playing local audio, the URL address corresponding to playing online audio,
the audio format of the audio file is such that,
the bit rate of the audio file is determined,
the playing time of the audio file.
3. The audio format processing method in audio playback according to claim 1, characterized in that: when the acquired address is the physical address of the audio file, the local audio processing is replayed,
and when the acquired address is the URL address of the audio file, requesting a network channel and attempting to access the audio file.
4. The audio format processing method in audio playback according to claim 2, characterized in that: the specific steps for judging whether the necessary information for audio playing is complete and available are as follows:
it is checked whether the necessary information for audio playback is missing,
it is checked whether the ID format of the audio file is correct,
it is checked whether the audio file is in the correct acquisition address format,
it is checked whether the audio format of the audio file is an audio format supported by the player,
check if the bitrate format of the audio file is correct.
5. The audio format processing method in audio playback according to claim 1, characterized in that: when the audio file is cached, the audio file is written into the temporary storage device.
6. The audio format processing method in audio playback according to claim 1, characterized in that: and if the audio format correction processing fails, returning an unknown format error, stopping caching the audio file, and emptying a cache region.
CN201810165083.8A 2018-02-28 2018-02-28 Audio format processing method in audio playing Active CN108322818B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810165083.8A CN108322818B (en) 2018-02-28 2018-02-28 Audio format processing method in audio playing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810165083.8A CN108322818B (en) 2018-02-28 2018-02-28 Audio format processing method in audio playing

Publications (2)

Publication Number Publication Date
CN108322818A CN108322818A (en) 2018-07-24
CN108322818B true CN108322818B (en) 2020-10-09

Family

ID=62900623

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810165083.8A Active CN108322818B (en) 2018-02-28 2018-02-28 Audio format processing method in audio playing

Country Status (1)

Country Link
CN (1) CN108322818B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101286770A (en) * 2007-04-09 2008-10-15 艾威梯软件技术(北京)有限公司 Method and system for automatically configuring audio encoding format transmitted by bluetooth A2DP
CN101702767A (en) * 2009-10-28 2010-05-05 北京东方网力科技有限公司 Time-based media playing method and system
CN102148842A (en) * 2010-02-08 2011-08-10 联想(北京)有限公司 Audio processing method and equipment for remote desktop protocol
CN103929478A (en) * 2014-04-10 2014-07-16 中央电视台 Video and audio file storing and downloading method and system
CN105139859A (en) * 2015-08-18 2015-12-09 杭州士兰微电子股份有限公司 Audio data decoding method, audio data decoding device and SOC using audio data decoding method
CN105516737A (en) * 2015-12-03 2016-04-20 杭州施强网络科技有限公司 Multimedia format file conversion method
JP2017092817A (en) * 2015-11-13 2017-05-25 日本放送協会 Acoustic feature quantity regulator and program

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103905668B (en) * 2012-12-27 2016-12-28 中强光电股份有限公司 There is telephone set and the method for video signal talks thereof of video signal function

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101286770A (en) * 2007-04-09 2008-10-15 艾威梯软件技术(北京)有限公司 Method and system for automatically configuring audio encoding format transmitted by bluetooth A2DP
CN101702767A (en) * 2009-10-28 2010-05-05 北京东方网力科技有限公司 Time-based media playing method and system
CN102148842A (en) * 2010-02-08 2011-08-10 联想(北京)有限公司 Audio processing method and equipment for remote desktop protocol
CN103929478A (en) * 2014-04-10 2014-07-16 中央电视台 Video and audio file storing and downloading method and system
CN105139859A (en) * 2015-08-18 2015-12-09 杭州士兰微电子股份有限公司 Audio data decoding method, audio data decoding device and SOC using audio data decoding method
JP2017092817A (en) * 2015-11-13 2017-05-25 日本放送協会 Acoustic feature quantity regulator and program
CN105516737A (en) * 2015-12-03 2016-04-20 杭州施强网络科技有限公司 Multimedia format file conversion method

Also Published As

Publication number Publication date
CN108322818A (en) 2018-07-24

Similar Documents

Publication Publication Date Title
US20230319229A1 (en) System and method for modifying media streams using metadata
EP2015587B1 (en) Method of storing a multimedia object in memory, associated data structure and terminal
US9398064B2 (en) Method of streaming media to heterogeneous client devices
US9609340B2 (en) Just-in-time (JIT) encoding for streaming media content
US8788933B2 (en) Time-shifted presentation of media streams
CN104796796B (en) Improve the fault-tolerant method of the HLS streaming players of Android platform
US10033788B2 (en) Method and a system for smooth streaming of media content in a distributed content delivery network
CN105828096B (en) Method and device for processing media stream file
TWI577186B (en) Rendering time control
WO2012146098A1 (en) Method and corresponding system for storing and playing streaming media
WO2007053957A1 (en) Transcoder for live streams and on demand media
CN101848367B (en) File-based video live webcasting method
CN108174284B (en) Android system-based video decoding method
CN108322818B (en) Audio format processing method in audio playing
CN108400987B (en) Address protection strategy in audio playing
CN106792158A (en) Order video inserting method based on internet television client
CN108366291B (en) Audio decoding strategy in audio playing
US20140115117A1 (en) Webcasting method and apparatus
CN108322821A (en) A kind of audio play in data buffering strategy
WO2020229955A1 (en) Method for broadcasting multimedia content with low latency
EP2451163B1 (en) Method of storing a multimedia object in memory, associated data structure and terminal
EP2253144A1 (en) Reception of metadata on a terminal

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