CN110083328A - A kind of audio frequency playing method, device, electronic equipment and storage medium - Google Patents

A kind of audio frequency playing method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN110083328A
CN110083328A CN201910253068.3A CN201910253068A CN110083328A CN 110083328 A CN110083328 A CN 110083328A CN 201910253068 A CN201910253068 A CN 201910253068A CN 110083328 A CN110083328 A CN 110083328A
Authority
CN
China
Prior art keywords
audio
channel number
format
converted
played
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
CN201910253068.3A
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.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and 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 QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN201910253068.3A priority Critical patent/CN110083328A/en
Publication of CN110083328A publication Critical patent/CN110083328A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/16Sound input; Sound output
    • G06F3/165Management of the audio stream, e.g. setting of volume, audio stream path
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/16Sound input; Sound output
    • G06F3/167Audio in a user interface, e.g. using voice commands for navigating, audio feedback

Abstract

The present invention relates to a kind of audio frequency playing method, device, electronic equipment and storage mediums, audio frequency playing method includes: when the audio using the first audio format plays object and plays audio, if receiving the instruction of track handover operation, the second audio corresponding with the instruction of track handover operation is obtained;Second audio is converted to the audio to be played of the first audio format;Object is played using audio, plays audio to be played.The embodiment of the present invention is when playing the first audio, if receiving the instruction of track handover operation, it obtains track handover operation and instructs corresponding second audio, and the audio format of the second audio is converted into the first audio format, the audio to be played that object continues broadcasting the second audio conversion is played by former audio, this programme is by converting the second audio, continue to play audio in the case where not establishing new audio and playing object, it avoids audio and plays the time spent by object reconstruction process, realize seamless switching track when audio plays.

Description

A kind of audio frequency playing method, device, electronic equipment and storage medium
Technical field
The present invention relates to audio play-back technology field more particularly to a kind of audio frequency playing method, device, electronic equipment and deposit Storage media.
Background technique
During streaming media playing, a kind of relatively common scene is the switching of audio code stream.As on many lines Film source, there are a variety of tracks, such as very fast, standard, high-quality etc., and there are also different audio decoding techniques, such as AAC to encode, Dolby coding etc..Corresponding with above-mentioned numerous formats is exactly a variety of audio source files.For audio, usually exist more The different situation of audio format in kind of code stream, audio player will accomplish the audio code stream of compatible different-format.
Specifically, if common quality code stream sample rate is 44.1KHZ, the sample rate of high-quality code stream is 48KHZ.? In playing process, audio, which plays object, will specify sample rate in creation, so switch when user does in two kinds of code streams, The variation of sample rate will cause the reconstruction that audio plays object, that is, the broadcasting object before deleting is created again with new sample rate Build broadcasting object.
Since human ear is very sensitive to sound broadcasting, when playing object reconstruction, sound interruption can be caused in a short time It plays, even if the break period only has a few tens of milliseconds, user still observantly can discover out, influence to play experience.
Summary of the invention
Of the existing technology in order to solve the problems, such as, at least one embodiment of the present invention provides a kind of audio broadcasting side Method, device, electronic equipment and storage medium.
In a first aspect, the embodiment of the invention provides a kind of audio frequency playing method, the audio frequency playing method includes:
When the audio using the first audio format plays object and plays the first audio, detect whether to receive track switching Operational order;
If receiving the instruction of track handover operation, the second audio corresponding with the track handover operation instruction is obtained;
Second audio is converted to the audio to be played of the first audio format;
Object is played using the audio, plays the audio to be played of first audio format.
Based on the above-mentioned technical proposal, the embodiment of the present invention can also make following improvement.
With reference to first aspect, described to detect whether to receive track switching behaviour in the first embodiment of first aspect It instructs, comprising:
It detects whether to receive the trigger action instruction to track control in broadcast interface;
If detection receives the trigger action instruction to the track control in broadcast interface, determines and receive track switching behaviour It instructs.
With reference to first aspect, described that second audio is converted to first in second of embodiment of first aspect Before the audio to be played of audio format, the audio frequency playing method further include:
Extract the second audio format of second audio;
Judge whether second audio format and the first audio format are identical;
If second audio format and the first audio format are identical, using second audio as the sound to be played Frequently;
Alternatively, second audio is converted to the first sound if second audio and the first audio format be not identical The audio to be played of frequency format.
Second of embodiment with reference to first aspect, in the third embodiment of first aspect, the judgement described the Whether two audio formats and the first audio format are identical, comprising:
Obtain the corresponding first pulse code modulation data block of first audio format;
Obtain the corresponding second pulse code modulation data block of second audio format;
Judge whether the first pulse code modulation data block and the second pulse code modulation data block are identical;
If the first pulse code modulation data block is identical as the second pulse code modulation data block, described second Audio format is identical with first audio format;
Alternatively, if the first pulse code modulation data block and the second pulse code modulation data block be not identical, Second audio format and first audio format be not identical.
With reference to first aspect, in the 4th kind of embodiment of first aspect, first audio format includes: audio sample Rate, channel number, audio sample format, audio sample precision and sound channel at least one of put in order.
With reference to first aspect or first, second, third or the 4th kind of embodiment of first aspect, the 5th of first aspect the In kind embodiment, the audio to be played that second audio is converted to the first audio format, comprising:
Obtain the second sound channel number of second audio;
Obtain the first channel number of first audio;
Compare the size of the second sound channel number Yu first channel number;
If the second sound channel number is greater than first channel number, by following calculation formula by second audio Second sound channel number is converted to the first channel number:
Wherein, S1、S2.......SnFor be converted to the first channel number the second audio channel data;A1、A2......Am For be not converted to the first channel number the second audio channel data, A1For preceding positive channel data, AmAttach most importance to subwoofer channel;k1、 k2......kmFor preset constant, n is the first channel number, and m is second sound channel number;
If the second sound channel number is less than first channel number, by following calculation formula by second audio Second sound channel number is converted to the first channel number:
Wherein, S1、S2.......SnFor be converted to the first channel number the second audio channel data;A1、A2......Am For be not converted to the first channel number the second audio channel data;N is the first channel number, and m is second sound channel number.
Second aspect, the embodiment of the invention provides a kind of audio playing apparatus, the audio playing apparatus includes:
Detection unit, for detecting whether to receive when the audio using the first audio format plays object and plays audio It is instructed to track handover operation;
First acquisition unit, if obtaining and being instructed with the track handover operation for receiving the instruction of track handover operation Corresponding second audio;
Converting unit, for second audio to be converted to the audio to be played of the first audio format;
Broadcast unit plays the sound to be played of first audio format for playing object using the audio Frequently.
In conjunction with second aspect, in the first embodiment of second aspect, the detection unit, specifically for detecting whether Receive the trigger action instruction to track control in broadcast interface;If detection is received to the track control in broadcast interface Trigger action instruction determines and receives the instruction of track handover operation.
In conjunction with second aspect, in second of embodiment of second aspect, the audio playing apparatus further include:
Second acquisition unit, for extracting the second audio format of second audio;
Judging unit, for judging whether second audio format and the first audio format are identical;
The converting unit, if being specifically used for second audio format and the first audio format is identical, by described the Two audios are as the audio to be played, if second audio format and the first audio format be not identical, by described second Audio is converted to the audio to be played of the first audio format.
In conjunction with second of embodiment of second aspect, in the third embodiment of second aspect, the judging unit, tool Body obtains the second audio format corresponding for obtaining the corresponding first pulse code modulation data block of first audio Two pulse code modulation data blocks;Judge the first pulse code modulation data block and second pulse code modulation data Whether block is identical, described if the first pulse code modulation data block is identical as the second pulse code modulation data block Second audio format is identical with first audio format, if the first pulse code modulation data block and second pulse Coding modulation data block is not identical, and second audio format and first audio format be not identical.
In conjunction with second aspect or first, second or third kind of embodiment of second aspect, in the 4th kind of reality of second aspect It applies in example, the converting unit is specifically used for,
Obtain the second sound channel number of second audio;
Obtain the first channel number of first audio;
Compare the size of the second sound channel number Yu first channel number;
If the second sound channel number is greater than first channel number, by following calculation formula by second audio Second sound channel number is converted to the first channel number:
Wherein, S1、S2.......SnFor be converted to the first channel number the second audio channel data;A1、A2......Am For be not converted to the first channel number the second audio channel data, A1For preceding positive channel data, AmAttach most importance to subwoofer channel;k1、 k2......kmFor preset constant, n is the first channel number, and m is second sound channel number;
If the second sound channel number is less than first channel number, by following calculation formula by second audio Second sound channel number is converted to the first channel number:
Wherein, S1、S2.......SnFor be converted to the first channel number the second audio channel data;A1、A2......Am For be not converted to the first channel number the second audio channel data;N is the first channel number, and m is second sound channel number.
The third aspect, the embodiment of the invention provides a kind of electronic equipment, including processor, communication interface, memory and Communication bus, wherein processor, communication interface, memory complete mutual communication by communication bus;
Memory, for storing computer program;
Processor when for executing the program stored on memory, is realized in first aspect described in any embodiment Audio frequency playing method.
Fourth aspect, the embodiment of the invention provides a kind of computer can storage medium, the computer can storage medium It is stored with one or more program, one or more of programs can be executed by one or more processor, to realize Audio frequency playing method described in any embodiment in first aspect.
Above-mentioned technical proposal of the invention has the advantages that the embodiment of the present invention is played in audio compared with prior art When object plays audio, if receiving the instruction of track handover operation, obtains track handover operation and instruct corresponding second audio, and The audio format of second audio is converted into audio and plays receptible first audio format of object institute, finally with audio broadcasting Object continues to play the audio to be played that the second audio is converted, and this programme is not being established by converting the second audio New audio continues to play audio in the case where playing object, avoids audio and plays the time spent by object reconstruction process, Realize seamless switching track when audio plays.
Detailed description of the invention
Fig. 1 is a kind of schematic diagram for the terminal that each embodiment of the present invention provides;
Fig. 2 is a kind of audio frequency playing method flow diagram provided in an embodiment of the present invention;
Fig. 3 be another embodiment of the present invention provides a kind of audio frequency playing method flow diagram;
Fig. 4 is a kind of audio frequency playing method flow diagram one that further embodiment of this invention provides;
Fig. 5 be further embodiment of this invention provide a kind of audio frequency playing method flow diagram secondly;
Fig. 6 be further embodiment of this invention provide a kind of audio frequency playing method flow diagram thirdly;
Fig. 7 is a kind of audio playing apparatus structural schematic diagram that further embodiment of this invention provides;
Fig. 8 is a kind of electronic equipment structural schematic diagram that further embodiment of this invention provides.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is A part of the embodiments of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill people Member's every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
As shown in Figure 1, a kind of hardware structural diagram of its terminal of each embodiment to realize the present invention, including audio Decoder 111, audio play object generator 112, audio converter 113, processor 1110, communication interface 1120, memory 1130 and communication bus 1140, wherein processor 1110, communication interface 1120, memory 1130 are complete by communication bus 1140 At mutual communication, wherein terminal can be such as mobile phone, tablet computer, laptop, palm PC, individual digital Assistant (PersonalDigitalAssistant, PDA), portable media player (PortableMediaPlayer, PMP), The mobile terminals such as navigation device, wearable device, Intelligent bracelet, pedometer, and number TV, desktop computer etc. are fixed Terminal.
As shown in Fig. 2, a kind of audio frequency playing method provided in an embodiment of the present invention, audio frequency playing method include:
S11, object is played in the audio for playing the first audio format that object generator 112 generates using audio play the When one audio, processor 1110 detects whether to receive the instruction of track handover operation.
In the present embodiment, audio play object be the program that is created when being played out to the audio of specific audio frequency format into Journey, and when the audio format of the audio played changes, it needs to create new audio and plays object to adapt to new sound Frequency format, while original audio is played into object and is deleted, so the audio in the present embodiment plays the sound that object can play The audio format of frequency is the first audio format, detects whether that receiving track handover operation refers to by processor 1110 at this time It enables, the entity button that is arranged or virtual push button can receive the instruction of track handover operation in the equipment by playing audio, It can be Audio conversion operational order transmitted by the external equipment that the equipment for playing audio is received by wireless connection device.
It may is that specifically, processor 1110 detects whether to receive the instruction of track handover operation and detect whether to receive Trigger action instruction to track control in broadcast interface;If detection receives the behaviour of the triggering to the track control in broadcast interface It instructs, determines and receive the instruction of track handover operation.
If S12, processor 1110 receive the instruction of track handover operation, the control acquisition of audio decoder 111 is cut with track Change corresponding second audio of operational order.
In the present embodiment, switched to track is instructed to obtain the second sound that will be played according to track handover operation Frequently, wherein the first audio is that audio plays object audio being played on, and the second audio is terminal according to track handover operation Control obtains the audio that will play from memory 1130 or with from network-side.
For example, in the case where playing video, if when the clarity of user's Switch Video, since every set video is corresponding all There is corresponding audio, and the clarity of video is exactly to allow user to select optimal broadcasting side according to the performance of equipment of itself Formula, so the quality of audio at this time can also have corresponding variation, the track of the audio of certain two sets of videos is also likely to be one Sample, if if audio does not switch, then play system is needed to extract audio from first set video, from second after video switching Video is extracted in set video, is easy to appear the nonsynchronous situation of video tone in this way, so, in audio/video player system, if video Clarity changes, and since video source changes, audio-source be may also change accordingly.
In the case where in conjunction with above-mentioned broadcasting video, in a specific embodiment, the audio frequency playing method includes:
It is playing first video and is playing object broadcasting and first video using the audio of the first audio format When corresponding first audio, the clarity handover operation for getting first video is detected whether;
If getting the clarity handover operation, corresponding second video of the clarity handover operation and second are obtained Audio;
Second audio is converted to the audio to be played of the first audio format;
When playing second video, object is played using the audio and plays the to be played of first audio format Audio.
Second audio is converted to the audio to be played of the first audio format by S13, the audio converter 113.
In the present embodiment, the audio format of the second audio that will be played obtained in previous step is converted to first Audio format, for example, the audio sample rate of the second audio, channel number, audio sample format, audio sample precision, sound channel are arranged Column sequence, big small end format and sampling are packaged the audio formats such as format and are converted into audio identical with the first audio format, In, audio sample rate conversion can be realized by third party's open source software SoundTouch2.0.0, channel number, audio sample lattice Formula, audio sample precision, big small end format and sampling are packaged format conversion can be real by the 3rd side's open source software ffmpeg3.4 Existing, sound channel puts in order conversion can be after audio decoder, and the sequence for the pulse code modulation data block that decoding is obtained carries out Arrangement is realized.
S14, object is played using audio, plays the audio to be played of the first audio format.
In the present embodiment, object is played by above-mentioned audio and plays corresponding audio to be played, due to being not involved with Audio plays the reconstruction of object, so the case where audio playing process is not in interruption, simultaneously as the conversion of audio format All it is to be carried out among time domain, does not arrive the conversion of frequency domain, so the broadcasting of audio to be played meets the requirement of real-time, than Such as, in video broadcasting field, be not in the nonsynchronous situation of sound picture of embodiment, realize seamless switching when audio plays Track.
As shown in figure 3, the embodiment of the invention provides a kind of audio frequency playing method, audio frequency playing method includes:
S21, object is played in the audio for playing the first audio format that object generator 112 generates using audio play the When one audio, processor 1110 detects whether to receive the instruction of track handover operation.
Related step S21 can be found in the description in step S11 in detail, and details are not described herein for the present embodiment.
If S22, processor 1110 receive the instruction of track handover operation, audio decoder 111 is obtained to be grasped with track switching Make to instruct corresponding second audio.
Related step S22 can be found in the description in step S12 in detail, and details are not described herein for the present embodiment.
S23, processor 1110 extract the second audio format of the second audio.
In the present embodiment, processor 1110 extracts the audio format of the second audio as the second audio format, the second sound Data type in frequency format and the data type in the first audio format are completely the same, comprising: audio sample rate, channel number, Audio sample format, audio sample precision, sound channel put in order, big small end format and sampling are packaged the audio formats such as format.
S24, processor 1110 judge whether the second audio format and the first audio format are identical.
In the present embodiment, judge whether the second audio format and the first audio format are identical, it can be by successively comparing Audio sample rate, channel number, audio sample format, audio sample precision, sound channel in audio format put in order, big small end lattice Formula and sampling are packaged the numerical value of format to determine whether the second audio format and the first audio format are identical.
As shown in figure 4, judging the second audio format in the present embodiment and whether the first audio format is identical to pass through Following method is judged:
S31, processor 1110 obtain the corresponding first pulse code modulation data block of the first audio format.
In the present embodiment, after i.e. the first audio demodulation of the corresponding first pulse code modulation data block of the first audio format Obtained PCM data block, PCM (PulseCodeModulation, pulse code modulation), pulse code modulation is exactly one Time Continuous, the continuous analog signal of value are transformed into time discrete, transmit in the channel after the discrete digital signal of value, arteries and veins It rushes coded modulation exactly first to sample to analog signal, then to sample value amplitude quantizing, the process of coding.When player normal play When, audio, which plays thread, can constantly produce PCM data block, i.e., decoded original audio data.
S32, processor 1110 obtain the corresponding second pulse code modulation data block of the second audio format.
In the present embodiment, after i.e. the second audio demodulation of the corresponding second pulse code modulation data block of the second audio format Obtained PCM data block, pulse code modulation data block, pulse code modulation are exactly a Time Continuous, and value is continuous Analog signal is transformed into time discrete, transmits in the channel after the discrete digital signal of value.Pulse code modulation is exactly to mould Quasi- signal is first sampled, then to sample value amplitude quantizing, the process of coding.When player normal play, audio plays thread can not PCM data block is produced disconnectedly, i.e., decoded original audio data.
S33, processor 1110 judge whether are the first pulse code modulation data block and the second pulse code modulation data block It is identical.
When player normal play, audio, which plays thread, can constantly produce PCM data block, i.e., decoded original Audio data.Due to being the switching of track in this programme, if the first audio format and the second audio format are identical, respective audio It decodes the first obtained pulse code modulation data block and the second pulse code modulation data block also can be identical, so, this If when the first pulse code modulation data block it is identical as the second pulse code modulation data block, can confirm the first audio format and Second audio format is identical.
If S34a, the first pulse code modulation data block are identical as the second pulse code modulation data block, the second audio Format and the first audio format are identical.
S34b or, if the first pulse code modulation data block and the second pulse code modulation data block be not identical, Two audio formats and the first audio format be not identical.
If S25a, the second audio format and the first audio format are identical, using the second audio as audio to be played.
S25b or, if the second audio format and the first audio format be not identical, by audio converter 113 by the Two audios are converted to the audio to be played of the first audio format.
Related step S25b can be found in the description in step S13 in detail, and details are not described herein for the present embodiment.
S26, object is played using audio, plays the audio to be played of the first audio format.
Related step S26 can be found in the description in step S14 in detail, and details are not described herein for the present embodiment.
As shown in figure 5, the embodiment of the invention provides a kind of audio frequency playing method, audio frequency playing method includes:
S41, object is played in the audio for playing the first audio format that object generator 112 generates using audio play the When one audio, processor 1110 detects whether to receive the instruction of track handover operation.
Related step S41 can be found in the description in step S11 in detail, and details are not described herein for the present embodiment.
If S42, processor 1110 receive the instruction of track handover operation, audio decoder 111 is obtained to be grasped with track switching Make to instruct corresponding second audio.
Related step S42 can be found in the description in step S12 in detail, and details are not described herein for the present embodiment.
S43, the audio to be played that the second audio is converted to the first audio format by audio converter 113.
Related step S43 can be found in the description in step S13 in detail, and details are not described herein for the present embodiment.
As shown in fig. 6, in the present embodiment, for example, the channel number of the second audio is converted to the first audio format The method of audio to be played of channel number may is that
S51, audio converter 113 obtain the second sound channel number of the second audio.
S52, audio converter 113 obtain the first channel number of the first audio.
S53, audio converter 113 compare the size of second sound channel number and the first channel number.
In the present embodiment, it when second sound channel number is greater than the first channel number, is needed at this time by the channel number of the second audio It is reduced, for example, needing the relevant data of L channel in six sound channels being transformed into alliteration when being transformed into two sound channels from six sound channels L channel in road, the relevant data of right channel are transformed into the right channel in two-channel in six sound channels, and in six sound channels it is preceding just Sound channel and supper bass sound channel and L channel and right channel are associated channel, moreover, are converted to channel number phase by multichannel When to few sound channel, it is both needed to positive sound channel and supper bass sound channel before considering;When second sound channel number is less than the first channel number, need at this time The channel number of second audio is increased, for example be converted to six sound channels from two sound channels, since channel number is more by few change, due to source number According to fewer, the channel data expanded can be average duplication and obtain.
If S54a, second sound channel number are greater than the first channel number, audio converter 113 will by following first calculation formula The second sound channel number of second audio is converted to the first channel number:
Wherein, S1、S2.......SnFor be converted to the first channel number the second audio channel data;A1、A2......Am For be not converted to the first channel number the second audio channel data, A1For preceding positive channel data, AmAttach most importance to subwoofer channel;k1、 k2......kmFor preset constant, n is the first channel number, and m is second sound channel number.
In the present embodiment, six sound channels are converted to by two sound channels with reference in above-described embodiment, that is, the sound channel S after converting1Institute The channel number of reference is 4, for example, if S1For L channel, then sound channel, front left channel, a left side before referenced sound channel is positive respectively Sound channel, supper bass sound channel afterwards;Corresponding S2For right channel, sound behind sound channel, right front channels, the right side before referenced sound channel is positive respectively Road, supper bass sound channel.
In the present embodiment, k1、k2......kmValue can be configured by user, for example, at same group equal to 1 Being equal in formula, can also the progress reasonable layout of the specific gravity according to shared by each sound channel.
In the present embodiment, if in the present embodiment, Eight-channel is converted to by six sound channels, is based on above-mentioned formula, then, S1Joined The sound channel examined is A1、A7And A8, S2Referenced sound channel is A1、A2And A8, S3Referenced sound channel is A1、A3And A8, S4It is referenced Sound channel be A1、A4And A8, S5Referenced sound channel is A1、A5And A8, S6Referenced sound channel is A1、A6And A8
S54b or, if second sound channel number, less than the first channel number, audio converter 113 is calculated by following second The second sound channel number of second audio is converted to the first channel number by formula:
Wherein, S1、S2.......SnFor be converted to the first channel number the second audio channel data;A1、A2......Am For be not converted to the first channel number the second audio channel data;N is the first channel number, and m is second sound channel number.
In the present embodiment, if the channel number of the second audio is increased, by the channel number of sound channel each in the second audio According to being superimposed after being averaged, it is imparted in the sound channel newly increased respectively.
S54c or, if second sound channel number is equal to the first channel number, without being converted.
S44, object is played using audio, plays the audio to be played of the first audio format.
Related step S44 can be found in the description in step S14 in detail, and details are not described herein for the present embodiment.
As shown in fig. 7, audio playing apparatus includes: that detection is single the embodiment of the invention provides a kind of audio playing apparatus Member 11, first acquisition unit 12, converting unit 13 and broadcast unit 14.
In the present embodiment, detection unit 11 play audio for playing object in the audio using the first audio format When, it detects whether to receive the instruction of track handover operation;Wherein, detection unit 11, specifically for detecting whether to receive to broadcasting Put the trigger action instruction of track control in interface;The trigger action of track control in broadcast interface is referred to if detection receives It enables, determines and receive the instruction of track handover operation, specifically, the first audio format includes: audio sample rate, channel number, audio Sample format, audio sample precision, sound channel put in order, big small end format and sampling are packaged the audio formats such as format.
In the present embodiment, first acquisition unit 12, if for receiving the instruction of track handover operation, acquisition is cut with track Change corresponding second audio of operational order.
In the present embodiment, converting unit 13, for the second audio to be converted to the audio to be played of the first audio format.
In the present embodiment, broadcast unit 14 play the to be played of the first audio format for playing object using audio Audio.
In conjunction with audio playing apparatus as shown in Figure 7, in a specific embodiment, audio playing apparatus further include: the Two acquiring units and judging unit.
In the present embodiment, second acquisition unit, for extracting the second audio format of the second audio.
In the present embodiment, judging unit, for judging whether the second audio format and the first audio format are identical, In, judging unit is specifically used for obtaining the corresponding first pulse code modulation data block of the first audio, and obtains the second audio lattice The corresponding second pulse code modulation data block of formula;Judge the first pulse code modulation data block and the second pulse code modulation number It is whether identical according to block, if the first pulse code modulation data block is identical as the second pulse code modulation data block, the second audio lattice Formula is identical with the first audio format, if the first pulse code modulation data block and the second pulse code modulation data block be not identical, Second audio format and the first audio format be not identical.
It in the present embodiment, converting unit 13 will if identical specifically for the second audio format and the first audio format Second audio is converted to the second audio if the second audio format and the first audio format be not identical as audio to be played The audio to be played of first audio format.
In conjunction with audio playing apparatus as shown in Figure 7, in a specific embodiment, converting unit 13 is specifically used for,
Obtain the second sound channel number of the second audio;
Obtain the first channel number of the first audio;
Compare second sound channel number and the first channel number size;
If second sound channel number is greater than the first channel number, by following first calculation formula by the second sound channel of the second audio Number is converted to the first channel number:
Wherein, S1、S2.......SnFor be converted to the first channel number the second audio channel data;A1、A2......Am For be not converted to the first channel number the second audio channel data, A1For preceding positive channel data, AmAttach most importance to subwoofer channel;k1、 k2......kmFor preset constant, n is the first channel number, and m is second sound channel number;
If second sound channel number is less than the first channel number, by following second calculation formula by the second sound channel of the second audio Number is converted to the first channel number:
Wherein, S1、S2.......SnFor be converted to the first channel number the second audio channel data;A1、A2......Am For be not converted to the first channel number the second audio channel data;N is the first channel number, and m is second sound channel number.
As shown in figure 8, the embodiment of the invention provides a kind of electronic equipment, including processor 1110, communication interface 1120, Memory 1130 and communication bus 1140, wherein processor 1110, communication interface 1120, memory 1130 pass through communication bus 1140 complete mutual communication,
Memory 1130, for storing computer program;
Processor 1110 when for executing the program stored on memory 1130, realizes following steps:
When the audio using the first audio format plays object and plays audio, detect whether to receive track handover operation Instruction;
If receiving the instruction of track handover operation, the second audio corresponding with the instruction of track handover operation is obtained;
Second audio is converted to the audio to be played of the first audio format;
Object is played using audio, plays the audio to be played of the first audio format.
Electronic equipment provided in an embodiment of the present invention, processor 1110 is by executing the program stored on memory 1130 It realizes when playing audio, if detecting, track handover operation is instructed, and is obtained track handover operation and is instructed corresponding second sound Frequently, the audio to be played for and by the second audio being converted to the first audio format, by the former audio for playing audio play object after The audio to be played of the first audio format is put in continued broadcasting, in the case where not creating new audio broadcasting object, continues to play audio, Realize the function of seamless switching track when audio plays.
The communication bus 1140 that above-mentioned electronic equipment is mentioned can be Peripheral Component Interconnect standard (PeripheralComponentInterconnect, abbreviation PCI) bus or expanding the industrial standard structure (ExtendedIndu StryStandardArchitecture, abbreviation EISA) bus etc..The communication bus 1140 can be divided into address bus, data Bus, control bus etc..Only to be indicated with a thick line in Fig. 8, it is not intended that an only bus or one kind convenient for indicating The bus of type.
Communication interface 1120 is for the communication between above-mentioned electronic equipment and other equipment.
Memory 1130 may include random access memory 1130 (RandomAccessMemory, abbreviation RAM), can also To include nonvolatile memory 1130 (non-volatilememory), a for example, at least magnetic disk storage 1130.It is optional , memory 1130 can also be that at least one is located remotely from the storage device of aforementioned processor 1110.
Above-mentioned processor 1110 can be general processor 1110, including central processing unit 1110 (CentralProcessingUnit, abbreviation CPU), network processing unit 1110 (NetworkProcessor, abbreviation NP) etc.;Also It can be digital signal processor 1110 (DigitalSignalProcessing, abbreviation DSP), specific integrated circuit (Appli CationSpecificIntegratedCircuit, abbreviation ASIC), field programmable gate array (Field- ProgrammableGateArray, abbreviation FPGA) either other programmable logic device, discrete gate or transistor logic device Part, discrete hardware components.
The embodiment of the invention also provides a kind of computer can storage medium, computer can storage medium be stored with one or The multiple programs of person, one or more of programs can be executed by one or more processor 1110, any of the above-described to realize Audio frequency playing method described in embodiment.
In the above-described embodiments, can come wholly or partly by software, hardware, firmware or any combination thereof real It is existing.When implemented in software, it can entirely or partly realize in the form of a computer program product.Computer program product Including one or more computer instructions.When loading on computers and executing computer program instructions, all or part of real estate Raw process or function according to the embodiment of the present invention.Computer can be general purpose computer, special purpose computer, computer network, Or other programmable devices.Computer instruction may be stored in a computer readable storage medium, or from a computer Readable storage medium storing program for executing to another computer readable storage medium transmit, for example, computer instruction can from a web-site, Computer, server or data center by wired (such as coaxial cable, optical fiber, Digital Subscriber Line (DSL)) or wireless (such as Infrared, wireless, microwave etc.) mode transmitted to another web-site, computer, server or data center.Computer Readable storage medium storing program for executing can be any usable medium or include one or more usable medium collection that computer can access At the data storage devices such as server, data center.Usable medium can be magnetic medium, (for example, floppy disk, hard disk, magnetic Band), optical medium (for example, DVD) or semiconductor medium (such as solid state hard disk SolidStateDisk (SSD)) etc..
Finally, it should be noted that the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although Present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that: it still may be used To modify the technical solutions described in the foregoing embodiments or equivalent replacement of some of the technical features; And these are modified or replaceed, technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution spirit and Range.

Claims (13)

1. a kind of audio frequency playing method, which is characterized in that the audio frequency playing method includes:
When the audio using the first audio format plays object and plays the first audio, detect whether to receive track handover operation Instruction;
If receiving the instruction of track handover operation, the second audio corresponding with the track handover operation instruction is obtained;
Second audio is converted to the audio to be played of the first audio format;
Object is played using the audio, plays the audio to be played of first audio format.
2. audio frequency playing method according to claim 1, which is characterized in that described to detect whether to receive track switching behaviour It instructs, comprising:
It detects whether to receive the trigger action instruction to track control in broadcast interface;
If detection receives the trigger action instruction to the track control in broadcast interface, determine that receiving track handover operation refers to It enables.
3. audio frequency playing method according to claim 1, which is characterized in that described that second audio is converted to first Before the audio to be played of audio format, the audio frequency playing method further include:
Extract the second audio format of second audio;
Judge whether second audio format and the first audio format are identical;
If second audio format and the first audio format are identical, using second audio as the audio to be played;
Alternatively, second audio is converted to the first audio lattice if second audio and the first audio format be not identical The audio to be played of formula.
4. audio frequency playing method according to claim 3, which is characterized in that the judgement second audio format and the Whether one audio format is identical, comprising:
Obtain the corresponding first pulse code modulation data block of first audio format;
Obtain the corresponding second pulse code modulation data block of second audio format;
Judge whether the first pulse code modulation data block and the second pulse code modulation data block are identical;
If the first pulse code modulation data block is identical as the second pulse code modulation data block, second audio Format is identical with first audio format;
If the first pulse code modulation data block and the second pulse code modulation data block be not identical, second sound Frequency format and first audio format be not identical.
5. audio frequency playing method according to claim 1, which is characterized in that first audio format includes: that audio is adopted Sample rate, channel number, audio sample format, audio sample precision and sound channel at least one of put in order.
6. any audio frequency playing method according to claim 1~5, which is characterized in that described by second audio Be converted to the audio to be played of the first audio format, comprising:
Obtain the second sound channel number of second audio;
Obtain the first channel number of first audio;
Compare the size of the second sound channel number Yu first channel number;
If the second sound channel number is greater than first channel number, by following calculation formula by the second of second audio Channel number is converted to the first channel number:
Wherein, S1、S2.......SnFor be converted to the first channel number the second audio channel data;A1、A2......AmFor not Be converted to the channel data of the second audio of the first channel number, A1For preceding positive channel data, AmAttach most importance to subwoofer channel;k1、 k2......kmFor preset constant, n is the first channel number, and m is second sound channel number;
If the second sound channel number is less than first channel number, by following calculation formula by the second of second audio Channel number is converted to the first channel number:
Wherein, S1、S2.......SnFor be converted to the first channel number the second audio channel data;A1、A2......AmFor not Be converted to the channel data of the second audio of the first channel number;N is the first channel number, and m is second sound channel number.
7. a kind of audio playing apparatus, which is characterized in that the audio playing apparatus includes:
Detection unit, for detecting whether to receive sound when the audio using the first audio format plays object and plays audio The instruction of rail handover operation;
First acquisition unit, if being obtained corresponding with the track handover operation instruction for receiving the instruction of track handover operation The second audio;
Converting unit, for second audio to be converted to the audio to be played of the first audio format;
Broadcast unit plays the audio to be played of first audio format for playing object using the audio.
8. audio playing apparatus according to claim 7, which is characterized in that the detection unit, specifically for detection be The no trigger action instruction received to track control in broadcast interface;If detection is received to the track control in broadcast interface Trigger action instruction, determine receive track handover operation instruction.
9. audio playing apparatus according to claim 7, which is characterized in that the audio playing apparatus further include:
Second acquisition unit, for extracting the second audio format of second audio;
Judging unit, for judging whether second audio format and the first audio format are identical;
The converting unit, if identical specifically for second audio format and the first audio format, by second sound Frequency is used as the audio to be played, if second audio format and the first audio format be not identical, by second audio Be converted to the audio to be played of the first audio format.
10. audio playing apparatus according to claim 9, which is characterized in that the judging unit is specifically used for obtaining institute The corresponding first pulse code modulation data block of the first audio is stated, and obtains the corresponding second pulse code tune of the second audio format Data block processed;Judge whether the first pulse code modulation data block and the second pulse code modulation data block are identical, If the first pulse code modulation data block is identical as the second pulse code modulation data block, second audio format It is identical with first audio format, if the first pulse code modulation data block and second pulse code modulation data Block is not identical, and second audio format and first audio format be not identical.
11. according to the audio playing apparatus any in claim 7~10, which is characterized in that the converting unit, specifically For,
Obtain the second sound channel number of second audio;
Obtain the first channel number of first audio;
Compare the size of the second sound channel number Yu first channel number;
If the second sound channel number is greater than first channel number, by following calculation formula by the second of second audio Channel number is converted to the first channel number:
Wherein, S1、S2.......SnFor be converted to the first channel number the second audio channel data;A1、A2......AmFor not Be converted to the channel data of the second audio of the first channel number, A1For preceding positive channel data, AmAttach most importance to subwoofer channel;k1、 k2......kmFor preset constant, n is the first channel number, and m is second sound channel number;
If the second sound channel number is less than first channel number, by following calculation formula by the second of second audio Channel number is converted to the first channel number:
Wherein, S1、S2.......SnFor be converted to the first channel number the second audio channel data;A1、A2......AmFor not Be converted to the channel data of the second audio of the first channel number;N is the first channel number, and m is second sound channel number.
12. a kind of electronic equipment, which is characterized in that including processor, communication interface, memory and communication bus, wherein processing Device, communication interface, memory complete mutual communication by communication bus;
Memory, for storing computer program;
Processor when for executing the program stored on memory, realizes that any audio of claim 1~6 plays Method.
13. a kind of computer can storage medium, which is characterized in that the computer can storage medium be stored with one or more Program, one or more of programs can be executed by one or more processor, any in claim 1~6 to realize The audio frequency playing method.
CN201910253068.3A 2019-03-29 2019-03-29 A kind of audio frequency playing method, device, electronic equipment and storage medium Pending CN110083328A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910253068.3A CN110083328A (en) 2019-03-29 2019-03-29 A kind of audio frequency playing method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910253068.3A CN110083328A (en) 2019-03-29 2019-03-29 A kind of audio frequency playing method, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN110083328A true CN110083328A (en) 2019-08-02

Family

ID=67414002

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910253068.3A Pending CN110083328A (en) 2019-03-29 2019-03-29 A kind of audio frequency playing method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110083328A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113810589A (en) * 2020-06-11 2021-12-17 华为技术有限公司 Electronic device, video shooting method and medium thereof
CN114006971A (en) * 2021-10-28 2022-02-01 努比亚技术有限公司 Screen projection window audio control method and device and computer readable storage medium
CN115086708A (en) * 2022-06-06 2022-09-20 北京奇艺世纪科技有限公司 Video playing method and device, electronic equipment and storage medium
CN116017035A (en) * 2022-12-19 2023-04-25 四川长虹电器股份有限公司 K song method and device of intelligent television

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1277532A (en) * 1999-06-10 2000-12-20 三星电子株式会社 Multiple-channel audio frequency replaying apparatus and method
US20040126085A1 (en) * 2002-08-07 2004-07-01 Mx Entertainment System for selecting video tracks during playback of a media production
CN103237259A (en) * 2013-03-29 2013-08-07 天脉聚源(北京)传媒科技有限公司 Audio-channel processing device and audio-channel processing method for video
CN103325402A (en) * 2013-06-25 2013-09-25 福州瑞芯微电子有限公司 Audio playing method and device in android system
US20140052454A1 (en) * 2012-08-14 2014-02-20 Mstar Semiconductor, Inc. Method for determining format of linear pulse-code modulation data
US20140372130A1 (en) * 2012-01-02 2014-12-18 Electronics And Telecommunications Research Institute Device and method for encoding and decoding multichannel signal
WO2015025858A1 (en) * 2013-08-19 2015-02-26 ヤマハ株式会社 Speaker device and audio signal processing method
JP2015186144A (en) * 2014-03-25 2015-10-22 日本放送協会 Channel number converter
US20160021401A1 (en) * 2014-07-16 2016-01-21 Crestron Electronics, Inc. Transmission of digital audio signals using an internet protocol

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1277532A (en) * 1999-06-10 2000-12-20 三星电子株式会社 Multiple-channel audio frequency replaying apparatus and method
US20040126085A1 (en) * 2002-08-07 2004-07-01 Mx Entertainment System for selecting video tracks during playback of a media production
US20140372130A1 (en) * 2012-01-02 2014-12-18 Electronics And Telecommunications Research Institute Device and method for encoding and decoding multichannel signal
US20140052454A1 (en) * 2012-08-14 2014-02-20 Mstar Semiconductor, Inc. Method for determining format of linear pulse-code modulation data
CN103237259A (en) * 2013-03-29 2013-08-07 天脉聚源(北京)传媒科技有限公司 Audio-channel processing device and audio-channel processing method for video
CN103325402A (en) * 2013-06-25 2013-09-25 福州瑞芯微电子有限公司 Audio playing method and device in android system
WO2015025858A1 (en) * 2013-08-19 2015-02-26 ヤマハ株式会社 Speaker device and audio signal processing method
JP2015186144A (en) * 2014-03-25 2015-10-22 日本放送協会 Channel number converter
US20160021401A1 (en) * 2014-07-16 2016-01-21 Crestron Electronics, Inc. Transmission of digital audio signals using an internet protocol

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113810589A (en) * 2020-06-11 2021-12-17 华为技术有限公司 Electronic device, video shooting method and medium thereof
CN114006971A (en) * 2021-10-28 2022-02-01 努比亚技术有限公司 Screen projection window audio control method and device and computer readable storage medium
CN114006971B (en) * 2021-10-28 2024-03-19 努比亚技术有限公司 Screen-throwing window audio control method, equipment and computer readable storage medium
CN115086708A (en) * 2022-06-06 2022-09-20 北京奇艺世纪科技有限公司 Video playing method and device, electronic equipment and storage medium
CN115086708B (en) * 2022-06-06 2024-03-08 北京奇艺世纪科技有限公司 Video playing method and device, electronic equipment and storage medium
CN116017035A (en) * 2022-12-19 2023-04-25 四川长虹电器股份有限公司 K song method and device of intelligent television

Similar Documents

Publication Publication Date Title
CN110083328A (en) A kind of audio frequency playing method, device, electronic equipment and storage medium
CN108616800B (en) Audio playing method and device, storage medium and electronic device
CN105979355A (en) Method and device for playing video
US11062716B2 (en) Determination of spatial audio parameter encoding and associated decoding
WO2014188231A1 (en) A shared audio scene apparatus
CN106303816B (en) Information control method and electronic equipment
AU2018282738B2 (en) Staggered key frame video encoding
JP2022087124A (en) Inter-channel phase difference parameter coding method and device
TW201438479A (en) Audio playback system and method used in handheld electronic device
CN113192523A (en) Audio coding and decoding method and audio coding and decoding equipment
CN111352605A (en) Audio playing and sending method and device
WO2014083380A1 (en) A shared audio scene apparatus
JP2023520570A (en) Volume automatic adjustment method, device, medium and equipment
US20150100324A1 (en) Audio encoder performance for miracast
CN109587600B (en) Multi-channel audio multiplexing device and electronic equipment
CN111190568A (en) Volume adjusting method and device
CN105100891B (en) Audio data acquisition methods and device
CN108461086B (en) Real-time audio switching method and device
CN106293607B (en) Method and system for automatically switching audio output modes
WO2015028715A1 (en) Directional audio apparatus
CN111355996A (en) Audio playing method and computing device
EP3707707A1 (en) Audio stream dependency information
CN112995541B (en) Method for eliminating video echo and computer storage medium
CN113261300B (en) Audio sending and playing method and smart television
WO2023051368A1 (en) Encoding and decoding method and apparatus, and device, storage medium and computer program product

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