CN103928037B - A kind of audio switching method and terminal device - Google Patents

A kind of audio switching method and terminal device Download PDF

Info

Publication number
CN103928037B
CN103928037B CN201310009908.4A CN201310009908A CN103928037B CN 103928037 B CN103928037 B CN 103928037B CN 201310009908 A CN201310009908 A CN 201310009908A CN 103928037 B CN103928037 B CN 103928037B
Authority
CN
China
Prior art keywords
audio
beat
time
perception
background
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
CN201310009908.4A
Other languages
Chinese (zh)
Other versions
CN103928037A (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.)
Pioneer Technology Shanghai Co Ltd
Original Assignee
Pioneer Technology Shanghai 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 Pioneer Technology Shanghai Co Ltd filed Critical Pioneer Technology Shanghai Co Ltd
Priority to CN201310009908.4A priority Critical patent/CN103928037B/en
Publication of CN103928037A publication Critical patent/CN103928037A/en
Application granted granted Critical
Publication of CN103928037B publication Critical patent/CN103928037B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The present invention relates to Audiotechnica field, more particularly to a kind of audio switching method and terminal device.The described method includes:Obtain the first tempo of the first audio being in perception prospect and the second tempo of the second audio of perception prospect to be entered;The beat for making to accelerate tempo to the audio possessed compared with slow-beat speed is handled;Second audio is sequentially entered the aware background and perception prospect, and first audio is sequentially entered the aware background and is exited the aware background.The equipment includes:For obtaining the acquiring unit of tempo, for making audio accelerate tempo beat processing unit and audio switching unit.The present invention is close with the tempo of the second audio by the first audio that beat processing makes to switch over, and alleviates and produces because tempo is different and play the problems such as lofty, rhythm is mixed and disorderly, improves the fluency of device plays.

Description

Audio switching method and terminal equipment
Technical Field
The present invention relates to the field of audio technologies, and in particular, to an audio switching method and a terminal device.
Background
With the rapid development of electronic technology and the continuous reduction of manufacturing cost, terminal devices for playing music tracks have become popular. The terminal equipment continuously pursues user experience, and has the characteristics of single playing function and various small or large-scale functional machines; examples of such terminal devices include music players, wireless mobile devices, mobile computers, onboard computers used in automobiles, boats, and aircraft, and other devices that can deliver audio (the term "audio" is used herein to refer to a variety of audio signals including music, voice, etc.) to a user.
In many cases, a user needs to switch and play different audio frequencies of the terminal device, which are transmitted to the user, however, in the process of switching audio frequencies with two different Beat speeds (Beat Per Minute, the number of beats Per Minute, also called accent), the sound effect played during the switching period is not smooth due to the inconsistency of the two Beat speeds.
Chinese patent application publication No. CN101584197A discloses patent text entitled "user-selectable audio mixing" on 11/18/2009, which describes an audio mixing technique that allows a user to select between two different audios to output a combined output in a perceptual foreground. As an example, the two different signals may include music audio and phone call audio. In this case, the music audio and phone call audio may be initially combined such that the phone call is delivered in the perceptual foreground and the music audio is delivered in a perceptual background. However, the user is able to switch the music to the foreground and the phone call to the background by actuating a user input device, in this way, after accepting a phone call, if the user wants to move the phone call into a perceptual background in favor of the music in the foreground, the user is able to do so, for example, by pressing a button. However, the above technical solution does not consider the problem of poor playing effect during the switching of two different audios.
Disclosure of Invention
The technical problem solved by the technical scheme of the invention is as follows: how to improve the fluency of playback during device switching audio.
In order to solve the above technical problem, the technical solution of the present invention provides an audio switching method, including:
acquiring a first beat speed of a first audio frequency in a perception foreground and a second beat speed of a second audio frequency to enter the perception foreground;
performing beat processing for accelerating the beat speed on the audio with smaller beat speed;
and enabling the second audio to enter the perception background and the perception foreground in sequence, and enabling the first audio to enter the perception background and exit the perception background in sequence.
Optionally, the audio in the perceptual foreground and the perceptual background is mixed and inserted from a first time when the second audio enters the perceptual background to a second time when the first audio exits the perceptual background.
Optionally, volume of the audio in the perceptual foreground and the perceptual background is adjusted from a third time when the second audio enters the perceptual background to a fourth time when the first audio exits the perceptual background.
Optionally, obtaining the tempo of the audio includes:
searching for a beat point on the audio;
the number of beat points experienced per unit time is calculated and taken as the tempo of the audio.
Optionally, the beat processing includes:
sampling audio data of the audio with the smaller beat speed;
and discarding the audio data on each beat of the audio from the beat point of the audio, wherein the audio data is discarded at least once on each beat of the audio.
Optionally, the number of times of discarding the audio data per beat of the audio is in a range of 2 to 4 times.
Alternatively, the number of times audio data is discarded per beat of audio is 4.
Optionally, when the first tempo is less than the second tempo, gradually increasing the amount of audio data discarded from the first audio each time in a first time history before the first time when the second audio enters the perceptual background;
and when the second tempo is less than the first tempo, gradually reducing the amount of the audio data discarded from the second audio every time in a second time course after the second moment after the first audio exits the perceptual background.
Optionally, the amount of audio data discarded from the audio each time is:
wherein S is the amount of audio data discarded once, F is the number of times of audio data sampling for audio in unit time, T is the time history counted with unit time as the reference, and BPM 1 For the first tempo, BPM 2 Setting the second tempo as delta BPM, wherein delta BPM is the difference value between the first tempo and the second tempo; n is the number of times audio data is discarded per beat of audio.
Optionally, the audio switching method further includes: and when the second beat speed is greater than the first beat speed, restoring the beat speed of the second audio at a second moment after the first audio exits the perception background.
Optionally, the audio switching method further includes: and when the second beat speed is less than the first beat speed, restoring the beat speed of the second audio at a fifth moment when the second time history is finished.
In order to solve the above technical problem, the technical solution of the present invention further provides a terminal device, which can implement audio switching, and includes:
the acquisition unit is used for acquiring a first tempo of a first audio in the perception foreground and a second tempo of a second audio to enter the perception foreground;
a beat processing unit for performing beat processing for accelerating the beat speed of the audio having a smaller beat speed;
and the audio switching unit is used for enabling the second audio to sequentially enter the perception background and the perception foreground and enabling the first audio to sequentially enter the perception background and exit the perception background.
The technical scheme of the invention at least has the following technical effects:
the beat processing enables the beat speeds of the first audio and the second audio to be similar, so that the problems of abrupt playing, disordered rhythm and the like caused by different beat speeds are solved, and the playing fluency of the equipment is improved;
in the preferred scheme, when the beat processing is carried out on the audio, the frequency range of discarding the audio data on each beat of the audio is 2-4 times, the equipment can adapt to the process of the beat processing under the condition of small-capacity cache, and the overall performance of the equipment can be improved; and, in a further preferable aspect, the number of times of discarding audio data per beat when performing beat processing on audio is 4: since the larger the number of times audio data is discarded for each beat, the smoother the audio played, but the more burdened the processor; if the frequency of discarding the audio data in each beat is small, the requirement on the buffer capacity is high, the requirement on the low-capacity buffer is not easily met, the frequency of discarding the audio data in each beat is preferably 4, the audio played by the equipment has high smoothness and simultaneously meets the requirement on the low buffer capacity of the equipment, and the efficiency occupation of the processor of the equipment is relatively proper;
in other preferred schemes, a transition effect of the beat processing is added before or after the audio beat processing, so that the playing effect of the device in the process of switching the audio is further improved.
Drawings
Fig. 1 is a schematic flowchart of an audio switching method according to embodiment 1 of the present invention;
fig. 2 is a control diagram of an audio switching process according to embodiment 1 of the present invention;
FIG. 3 is a flowchart illustrating an audio switching method according to embodiment 2 of the present invention;
fig. 4 is a control diagram of an audio handover process according to embodiment 2 of the present invention;
fig. 5 is a flowchart illustrating an audio switching method according to embodiment 3 of the present invention;
fig. 6 is a schematic structural diagram of a terminal device according to embodiment 4 of the present invention.
Detailed Description
The technical scheme of the invention is based on the following technical principles:
for audio switching of a playback device, user experience is usually used as a measure. However, after the user experience is technically analyzed, the inventor thinks that the problem of poor playing effect in the existing audio switching process is caused by the fact that the tempo of two audios is often inconsistent.
The prior art has at least the following means for improving the smoothness of the audio switching process:
MIX (MIX, which is a short for MIX Effect) processing is to insert mixed sound into audio to achieve the purpose of smooth switching when the device switches audio, and the MIX sound is inserted into the switching period of front and rear audio to eliminate the disordered rhythm caused by inconsistent beat speeds of the two audios;
cross Fade processing is the overlapping playing of the front and back audio for a period of time when the device switches the audio, so as to ensure the gradual exit of the previous tune, i.e. the gradual exit effect when the audio exits or enters playing.
The two processing modes do not substantially solve the problem of inconsistent audio tempo, and the intrinsic tempo is covered by operations such as sound mixing and repeated playing from the actual auditory perception of the user, so that the auditory perception is relatively smooth.
The inventors believe that none of the above approaches addresses the essential problem of not streaming during audio switching. The inventor analyzes that the beat speed between audios is actually regulated and controlled by the density degree between beat points, for an audio file, the beat points are fixed, the beat points are also called strong sounds, and the strong sounds are the most important data parts with audibility for the audio file; the audio file has the most important strong sound (beat point) and relatively secondary data parts with weak audibility, the sensitivity of human ears is not high for the data parts on the relatively secondary audio file, and the complete playing of the audio file cannot be influenced for the relatively secondary audio data even if the data parts are discarded, but the beat speed among audios can be consistent, and the effect of smoothly switching the playing can be well achieved.
Based on the above principle, the following detailed description of the embodiments of the present invention will be made with reference to the accompanying drawings.
Example 1
An audio switching method as shown in fig. 1, comprising:
step S1a: and acquiring a first beat speed of a first audio in the perception foreground and a second beat speed of a second audio to enter the perception foreground.
The difference is that the audio in the perception foreground is the main audio, the audio in the perception background is the secondary audio, and the playing volume of the audio in the perception foreground is greater than that of the audio in the perception background.
The following steps may be specifically adopted to obtain the first audio tempo:
step S101a: searching for a beat point on the first audio;
step S102a: the number of beat points experienced by the audio in a unit time is calculated and taken as the first beat speed of the first audio.
The second tempo of the second audio is acquired in the same manner as steps S101a to S102 a.
The measurement standard of the Beat rate is, in this embodiment, the number of beats in unit time is taken as a standard, specifically, the number of beats in one Minute is taken as the Beat rate, that is, BPM (Beat Per Minute, a unit for calculating the number of beats Per Minute) is used to measure the Beat rate according to the technical scheme of the present invention.
Step S2a: judging the sizes of the first beat speed and the second beat speed; in this embodiment, the first tempo is smaller than the second tempo, for example, in this embodiment, the first tempo is 60 (the number of beats in one minute of the first audio is 60), and the second tempo is 63 (the number of beats in one minute of the second audio is 63) are obtained.
Step S3a: performing beat processing for increasing the beat speed on the audio with smaller beat speed;
since the first tempo is lower than the second tempo in step S2a, the first audio needs to be processed to increase the tempo. With reference to fig. 2, the time when the beat processing is started on the first audio is set to be Ts, and the first time T1, the second time T2, the third time T3, and the fourth time T4 are further included.
The specific steps of the beat processing process are as follows:
step S301a: sampling audio data for a first audio; the sampling times per second are 44.1k/s generally;
step S302a: and discarding the audio data on each beat of the audio from the beat point of the audio, wherein the audio data is discarded at least once on each beat of the audio. Normally, the audio data of the beat point is not discarded.
Theoretically, the larger the number of times of discarding audio data for each beat of audio, the higher the smoothness of playing during audio switching, but if the number is infinite, the burden on the processor will be increased; however, if the number of times of discarding audio data per beat is small (for example, 1 time), the requirement for the buffer capacity of the device is large because a large number of data are to be processed at one time, and the device with a small buffer capacity is not easily satisfied. Therefore, the technical scheme of the invention sets the frequency range of discarding the audio data on each beat of the audio to be 2-4 times. In this embodiment, the number of times of discarding the audio data in each beat is selected to be 4, so that the audio played by the device has high smoothness and simultaneously meets the requirement of small buffer capacity of the device, and the efficiency occupation of the processor of the device is relatively appropriate.
Step S302a further includes:
step S321a: the amount of audio data discarded from the audio each time during a first time history before a first time instant before the second audio enters the perceptual background is gradually increased.
When the first tempo is less than the second tempo, performing tempo processing on the first audio in a first time history before a first time when the second audio enters the perceptual background, wherein the difference from the step S322a is that the amount of audio data discarded from the audio at each time gradually increases;
in fig. 2, the time history between the time Ts and the first time T1 is the first time history, and the beat processing in this time history is a transition that the amount of discarded audio data increases slowly, that is, the amount of audio data discarded from the audio each time is:
in the formula (1), S 1 (y) is the amount of the x-th discarded audio data in the first time history, F is the number of audio data samples per unit time (F is the number of samples per second, 44.1k/s in this embodiment), T is the time history counted based on the unit time (T is 60s, i.e., one minute in this embodiment), BPM 1 Is the first tempo (BPM) 1 60 in this embodiment), BPM 2 Is the second beat rate (BPM) 2 63) in this embodiment, y is a relative value which increases with the increase of the number of times of accumulating the discarded audio data volume in the first time history, and is in a range of 1 to Δ BPM, the value of y in the first discarding can be 1, the value of y in the last discarding in the first time history can be Δ BPM, the discarding in the period can be strictly increased by an equal ratio function or not, and y is in a direct ratio with x; Δ BPM is the difference between the first tempo and the second tempo; n is the number of times audio data is discarded per beat of audio; as can be seen from equation (1), the ratio of the time history (T) counted based on the unit time to the tempo is the time history (abbreviated as one beat) experienced by each audio beat.
Step S322a: and from the first time T1 to the fourth time T2, performing the beat processing on the first audio, wherein the discarded audio data amount from the audio every time is equal.
In step S322a, the amount of audio data discarded from the audio at a time is:
in the formula (2), S is the amount of audio data discarded at a time, F is the number of times of audio data sampling for audio in unit time, T is a time history counted with unit time as a reference, and BPM 1 Is the first sectionBeat rate, BPM 2 Setting the second tempo as delta BPM, wherein delta BPM is the difference value between the first tempo and the second tempo; n is the number of times audio data is discarded per beat of the audio; the ratio of the time history counted on the basis of the unit time to the beat speed is the time history experienced by each audio beat. The above physical quantities are further defined by the same formula (1).
Step S401a: and enabling the second audio to enter the perception background and the perception foreground in sequence, and enabling the first audio to enter the perception background and exit the perception background in sequence.
In the process of performing step S401a, the following process may also be performed:
step S402a: and performing audio mixing insertion on the audio in the perception foreground and the perception background from a first time T1 before the second audio enters the perception background to a second time T2 after the first audio exits the perception background.
In the process of performing the audio mixing insertion processing on the audio existing in the perceptual foreground and the perceptual background from the first time T1 to the second time T2, the audio is further subjected to the volume adjustment processing from the third time T3 to the fourth time T4, that is, step S403a: and adjusting the volume of the audio in the perception foreground and the perception background from the third moment T3 when the second audio enters the perception background to the fourth moment T4 when the first audio exits the perception background:
when the second audio is in the perception background, turning on the volume of the second audio, wherein the volume is smaller than the volume of the first audio;
when the second audio is in the perceptual foreground and the first audio is in the perceptual background, making a volume of the second audio greater than a volume of the first audio;
turning off the volume of the first audio when the first audio exits the perceptual background.
Steps S402a to S403a are to optimize the playing effect during audio switching, where the playing effect of audio switching is smoother and more coherent due to the insertion of audio mixing, and the transition effect of audio switching is more smooth and natural due to the volume adjustment.
Fig. 2 is a schematic diagram illustrating a process of performing beat processing on the first audio A1, and performing mixing insertion and volume adjustment processing on the first audio A1 and the second audio A2 in embodiment 1. In fig. 2, a time Ts is a start time of the beat processing on the first audio A1; the time T1 is the first time before the second audio A2 enters the perception background, and the time when the second audio A2 enters the perception background is the time T3 (the third time), and T3 is greater than T1; the time history from the time Ts to the time T1 is the first time history, when the beat processing is performed on the first audio A1 in the time history, the discarded audio data amount is gradually increased, and the area 101 shows the processing procedure of slowly and incrementally discarding the audio data of the first audio A1.
The time T1 is also the time when the audio mixing insertion processing is started on the first audio A1, and the audio mixing insertion processing is continuously performed on the first audio A1 until the time T4 (fourth time) when the first audio A1 exits from the perceptual background;
the time T3 is a third time when the second audio A2 enters the perceptual background, and is also a start time when the volume adjustment processing is performed on the second audio A2 and the first audio A1;
the time T4 is a fourth time when the first audio A1 exits the perceptual background, and is also a time when the volume adjustment processing is finished for the second audio A2 and the first audio A1;
the time T2 is a second time after the first audio A1 exits from the perceptual background, and since the time when the first audio A1 exits from the perceptual background is a fourth time T4, T4< T2, and the time T2 is also a time when the audio mixing and inserting of the second audio A2 are finished.
When the first audio A1 is subjected to beat processing in the time course from the time T1 to the time T4, the amount of audio data discarded at each time is equal, that is, equal to the amount of audio data discarded at the time T1 (S), and the area 102 shows the processing for discarding the audio data of the first audio A1 by the same amount.
The audio mixing and inserting processing is carried out on the first audio A1 and the second audio A2 in the time course from the time T1 to the time T2, and comprises the steps of carrying out audio mixing and inserting processing on the first audio A1 in the time course from the time T1 to the time T4 and carrying out audio mixing and inserting processing on the second audio A3 in the time course from the time T3 to the time T2. The area 103 shows the process of performing the mixing insertion process on the first audio A1 and the second audio A2.
Performing volume adjustment processing on the first audio A1 and the second audio A2 within a time history from a time T3 to a time T4, where fig. 2 illustrates the time T0, and taking the time T0 as a boundary time when the first audio A1 and the second audio A2 switch playing scenes (the playing scenes include a perception foreground and a perception background), that is, before the time T0, the first audio A1 is in the perception foreground, the first audio A1 is in the perception background between the time T0 and the time T4, and after the time T4, the first audio A1 exits from the playing scenes; for the second audio A2, before the time T3, the second audio A2 does not enter the playing scene, that is, is in the state of waiting to enter the perception foreground, the second audio A2 enters the perception background between the time T3 and the time T0, and the second audio A2 enters the perception foreground between the time T0 and the time T4 and is continuously in the perception foreground. The volume adjustment processing is to adjust and control the audio volume in the above process, and even if the volumes of the audio in the sensing background and the audio in the sensing foreground are respectively adjusted, the first audio A1 and the second audio A2 are played in an overlapping manner between the time T3 and the time T4, so as to ensure that the first audio A1 gradually exits and generate a gradual exit effect when the audio exits or enters the playing. The area 104 shows the process of performing volume adjustment processing on the first audio A1 and the second audio A2.
Example 2
An audio switching method as shown in fig. 3, comprising:
step S1b to step S2b: steps S1a to S2a similar to example 1.
In this embodiment, the second tempo is smaller than the first tempo, for example, in this embodiment, the first tempo is 63 (the number of beats in one minute of the first audio is 63), and the second tempo is 60 (the number of beats in one minute of the second audio is 60) are obtained.
Step S3b: performing a beat process for increasing the beat rate of the audio with a smaller beat rate;
since the second tempo is lower than the first tempo in step S2a, the second audio needs to be processed to increase the tempo. With reference to fig. 4, the time when the beat processing on the second audio is finished is Te, and the time further includes a first time T1, a second time T2, a third time T3, and a fourth time T4.
The specific steps of the beat processing procedure of step S3b are as follows:
step S301b: sampling audio data for the second audio; the sampling times per second are 44.1k/s generally;
step S302b: the audio data on each beat of the audio is discarded from the beat point of the audio, wherein the number of times the audio data is discarded on each beat of the audio is 4.
Step S302b further includes:
step S321b: from the third time T3 to the second time T2, the second audio is subjected to the beat processing (4 times of audio data are discarded per beat), and the amount of audio data discarded from the audio every time is equal.
In step S321b, the amount of audio data discarded from the audio at a time is:
equation (3) is the same as equation (2), wherein the difference calculation of Δ BPM is the process of taking the absolute value.
Step S322b: the amount of audio data discarded from the audio each time during a second time history after the first audio exited the perceptual background at a second time instance gradually decreases.
When the second tempo is less than the first tempo, the second audio is further processed to be beat continuously in a second time history after the second time point after the first audio exits the perceptual background, but the difference from the step S321b is that the amount of audio data discarded from the audio each time is gradually reduced.
In fig. 4, the time history between the time T2 and the time Te is the second time history, and the beat processing in this time history is a transition in which the amount of discarded audio data gradually decreases, that is, the amount of audio data discarded from the audio each time is:
in the formula (4), S is similar to the formula (1) and the formula (2) 2 (z) is the amount of audio data discarded the xth time in the second time history, F is the number of times audio data is sampled for the audio in a unit time, T is the time history counted with a unit time as a reference, BPM 1 Is the first tempo (BPM) 1 63) in this embodiment), BPM 2 Is the second beat rate (BPM) 2 60 in the embodiment), z is a relative value which is reduced along with the increase of the times (x) of accumulating the discarded audio data volume in the second time history, and the range of z is delta BPM-1, the value of z can be delta BPM when the audio data volume is discarded for the first time, the value of y can be 1 when the audio data volume is discarded for the last time in the second time history, the discarding in the period can be strictly decreased according to an equal ratio function or not, and z and x are in inverse proportion; Δ BPM is the difference between the first tempo and the second tempo; n is the number of times audio data is discarded per beat of audio.
Step S322b may also be used instead of or in combination with: the number of times audio data is discarded per beat of audio is gradually reduced over a second time history, i.e. only 1 time audio data is discarded from 4 times per beat to the last beat.
Similarly, step S321a of example 1 may also be replaced by or used in combination with the following:
the number of times audio data is discarded per beat of audio is slowly increased over the first time history, i.e., 1 audio data is discarded from the first beat to 4 audio data are discarded from the last beat over the first time history.
Step S401b: and enabling the second audio to enter the perception background and the perception foreground in sequence, and enabling the first audio to enter the perception background and exit the perception background in sequence.
In the process of performing step S401b, the following process may also be performed:
step S402b: and performing audio mixing insertion on the audio in the perception foreground and the perception background from a first time T1 before the second audio enters the perception background to a second time T2 after the first audio exits the perception background.
At the first time T1 to the second time T2, audio existing in the perceptual foreground and the perceptual background is subjected to audio mixing insertion processing, and at the same time, audio is subjected to volume adjustment processing at the third time T3 to the fourth time T4, that is, step S403b: and at a third time T3 when the second audio enters the perception background to a fourth time T4 when the first audio exits the perception background, carrying out volume adjustment on the audio in the perception foreground and the perception background:
when the second audio frequency is in the perception background, the volume of the second audio frequency is started, and the volume is smaller than that of the first audio frequency;
when the second audio is in the perceptual foreground and the first audio is in the perceptual background, making a volume of the second audio greater than a volume of the first audio;
turning off the volume of the first audio when the first audio exits the perceptual background.
Fig. 4 is a schematic diagram illustrating a process of performing beat processing on the second audio B2, and performing mixing insertion and volume adjustment processing on the first audio B1 and the second audio B2 in embodiment 2.
The time T1 is a time when the audio mixing insertion processing is started for the first audio B1, and the audio mixing insertion processing is continued for the first audio B1 until a time T4 (fourth time) when the first audio B1 exits from the perceptual background;
the time T3 is a third time when the second audio B2 enters the perceptual background, and is also a start time when the volume adjustment processing is performed on the second audio B2 and the first audio B1; a start time of the beat processing on the second audio B2 at time T3;
the time T4 is a fourth time when the first audio B1 exits the perceptual background, and is also a time when the volume adjustment processing is finished for the second audio B2 and the first audio B1;
the time T2 is a second time after the first audio B1 exits from the perceptual background, and since the time when the first audio B1 exits from the perceptual background is the fourth time T4, T4< T2, and the time T2 is also a time when the audio mixing and inserting of the second audio B2 are finished.
When the second audio B2 is subjected to beat processing in the time course from the time T3 to the time T2, the amount of audio data discarded at each time is equal, that is, equal to the amount of audio data discarded at the time T2 (S), and the area 202 shows the processing for discarding the audio data of the second audio B2 by the same amount.
The audio mixing and inserting processing is carried out on the first audio B1 and the second audio B2 in the time history from the time T1 to the time T2, and comprises the steps of carrying out audio mixing and inserting processing on the first audio B1 in the time history from the time T1 to the time T4 and carrying out audio mixing and inserting processing on the second audio B3 in the time history from the time T3 to the time T2. The area 203 shows the process of performing the mixing insertion process on the first audio B1 and the second audio B2.
Performing volume adjustment processing on the first audio B1 and the second audio B2 within a time history from a time T3 to a time T4, where fig. 4 illustrates the time T0, and taking the time T0 as a boundary time of a switching playing scene (the playing scene includes a perception foreground and a perception background) of the first audio B1 and the second audio B2, that is, before the time T0, the first audio B1 is in the perception foreground, the first audio B1 is in the perception background between the time T0 and the time T4, and after the time T4, the first audio B1 exits from the playing scene; for the second audio B2, before the time T3, the second audio B2 does not enter the playing scene, that is, is in the state of waiting to enter the perception foreground, the second audio B2 enters the perception background between the time T3 and the time T0, and the second audio B2 enters the perception foreground between the time T0 and the time T4 and is continuously in the perception foreground. The volume adjustment process is an audio volume adjustment process for the above process, and the area 204 shows the process of performing the volume adjustment process on the first audio B1 and the second audio B2.
The time history elapsed from time T1 to time Te is the second time history, and when the beat processing is performed on the second audio B2 in the time history, the discarded audio data amount thereof is gradually reduced, and the area 201 shows the processing procedure of gradually discarding the audio data of the second audio B2 in a decreasing manner.
Since the second tempo is smaller than the first tempo in embodiment 2, the audio switching method further includes:
step S5b: and restoring the beat speed of the second audio at the fifth moment when the second time history is ended. Time Te in fig. 4 is the fifth time.
In other embodiments, step S321b may be directly executed in step S302b without step S322b (in embodiment 1, step S322a may also be directly executed in step 302a without step S321a, see embodiment 4 for details), in which case step S5b is: restoring the tempo of the second audio at a second time instant (T2) after the first audio exits the perceptual background.
Example 3
As shown in fig. 5, the audio switching method of the present embodiment is different from that of embodiment 1 and embodiment 2 in that the present embodiment does not include:
a process of slowly increasing audio data discarded on the first audio each time over a first time course when the first tempo is less than the second tempo;
when the second tempo is smaller than the first tempo, the process of gradually decreasing the audio data discarded on the second audio each time during the second time history.
The audio switching method of the embodiment comprises the following steps:
step S1c to step S2c: the same as steps S1a to S2a of example 1.
Step S3c: performing beat processing for increasing the beat speed on the audio with smaller beat speed;
the specific steps of the beat processing process are as follows:
step S301c: sampling audio data of audio with a smaller beat speed; the sampling times per second are 44.1k/s generally;
step S302c: discarding audio data on each beat of the audio from a beat point of the audio, wherein the number of times of discarding the audio data on each beat of the audio is at least one, and the amount of the audio data discarded from the audio each time is equal; in general practice, the number of times audio is discarded per beat is preferably 4. The audio data volume discarded from the audio each time is as follows:
equation (5) is similar to equations (2) and (3), wherein the difference between Δ BPM is calculated as an absolute value.
Step S401c: and enabling the second audio to enter the perception background and the perception foreground in sequence, and enabling the first audio to enter the perception background and exit the perception background in sequence.
In the process of performing step S401c, the following process may also be performed:
step S402c: and performing audio mixing insertion on the audios in the perception foreground and the perception background at a first moment before the second audio enters the perception background and a second moment after the first audio exits the perception background.
At the same time of performing the audio mixing insertion processing on the audio existing in the perceptual foreground and the perceptual background from the first time to the second time, the audio is also subjected to the volume adjustment processing from the third time to the fourth time, that is, step S403c: and adjusting the volume of the audio in the perception foreground and the perception background from the third moment when the second audio enters the perception background to the fourth moment when the first audio exits the perception background:
when the second audio is in the perception background, turning on the volume of the second audio, wherein the volume is smaller than the volume of the first audio;
when the second audio is in the perceptual foreground and the first audio is in the perceptual background, making a volume of the second audio greater than a volume of the first audio;
turning off the volume of the first audio when the first audio exits the perceptual background.
In embodiment 3, like the audio switching process of fig. 2 (the first tempo is smaller than the second tempo), the history of the beat processing for the first audio is only the time T1 to the time T4 (area 102), and the process of the beat processing that slowly increases the discarded audio data amount is not included (i.e., the beat processing process does not include the history of the time Ts to the time T1, i.e., the area 101). Likewise, like the audio switching process of fig. 4 (the second tempo is smaller than the first tempo), the course of the tempo processing for the second audio is only the time T3 to the time T2 (area 202), and the process of the tempo processing that gradually reduces the amount of discarded audio data (the course of the time T2 to the time Te, i.e., area 201) is not included. The other steps of example 3 can be similar to those of example 1 and example 2.
Example 4
Fig. 6 provides a terminal device capable of implementing audio switching, the terminal device includes a player 300 for implementing storage, decoding and playing of audio, and an apparatus capable of controlling the player 300, the apparatus includes:
an obtaining unit 301, configured to obtain a first tempo of a first audio in a perceptual foreground and a second tempo of a second audio to enter the perceptual foreground;
a determining unit 306, configured to determine magnitudes of the first tempo and the second tempo;
a beat processing unit 302, configured to perform beat processing for increasing the beat speed on the audio with a smaller beat speed according to the determination result;
an audio switching unit 303, configured to enable the second audio to enter the perceptual background and the perceptual foreground in sequence, and enable the first audio to enter the perceptual background and exit the perceptual background in sequence.
A mixing processing unit 304, configured to perform mixing insertion on the audio in the perceptual foreground and the perceptual background from a first time before the second audio enters the perceptual background to a second time after the first audio exits the perceptual background.
A volume adjusting unit 305, configured to adjust the volumes of the audios in the perceptual foreground and the perceptual background from a third time when the second audio enters the perceptual background to a fourth time when the first audio exits the perceptual background.
The obtaining unit 301 may further include:
a search unit 311 for searching for a beat point on audio;
a calculating unit 312, configured to obtain a tempo of the audio based on the acquired time history between the beat points.
The beat processing unit 302 may further include:
the sampling unit 321 is configured to sample audio data of audio with a smaller tempo.
A sub-processing unit 322, configured to discard the audio data in each beat of the audio from a beat point of the audio, where the number of times of discarding the audio data in each beat of the audio is at least one, a specific number of times ranges from 2 to 4, and in this embodiment, 4 times are preferred (the amount of the audio data discarded in each beat of the audio can be obtained by referring to equation (2));
and is also used for:
when the first beat speed is smaller than the second beat speed, gradually increasing the amount of audio data discarded from the first audio each time in a first time history before the second audio enters the perception background at a first moment; in this case, the amount of audio data discarded from the audio by the sub-processing unit 322 at a time can be obtained by referring to equation (1).
When the second tempo is less than the first tempo, gradually increasing or decreasing the amount of audio data discarded from the first audio each time in a second time course after the first audio exits from the perceptual background at a second moment; in this case, the amount of audio data discarded from the audio by the sub-processing unit 322 at a time can be obtained by referring to equation (4).
The beat processing unit 302 of the present embodiment further includes a restoring unit 323.
Corresponding to embodiment 2, the restoring unit 323 is configured to restore the tempo of the second audio at a fifth timing at which the second time history ends, when the second tempo is smaller than the first tempo.
Corresponding to embodiment 3, the restoring unit 323 is configured to restore the tempo of the second audio at a second moment after the first audio exits the perceptual background, when the second tempo is greater than the first tempo.
Although the present invention has been described with reference to the preferred embodiments, it is not intended to limit the present invention, and those skilled in the art can make possible variations and modifications of the present invention using the method and the technical contents disclosed above without departing from the spirit and scope of the present invention, and therefore, any simple modifications, equivalent changes and modifications made to the above embodiments according to the technical essence of the present invention are all within the scope of the present invention.

Claims (21)

1. An audio switching method, comprising:
acquiring a first beat speed of a first audio frequency in a perception foreground and a second beat speed of a second audio frequency to enter the perception foreground;
performing beat processing for accelerating the beat speed on the audio with smaller beat speed;
and enabling the second audio to enter the perception background and the perception foreground in sequence, and enabling the first audio to enter the perception background and exit the perception background in sequence.
2. The audio switching method of claim 1, wherein the audio in the perceptual foreground and the perceptual background is mixed and inserted from a first time before the second audio enters the perceptual background to a second time after the first audio exits the perceptual background.
3. The audio switching method of claim 1, wherein the volume of the audio in the perceptual foreground and the perceptual background is adjusted from a third time when the second audio enters the perceptual background to a fourth time when the first audio exits the perceptual background.
4. The audio switching method of claim 1, wherein obtaining a tempo of the audio comprises:
searching for a beat point on the audio;
the number of beat points experienced per unit time is calculated and taken as the tempo of the audio.
5. The audio switching method of claim 4, wherein the beat processing comprises:
sampling audio data of the audio with the smaller beat speed;
and discarding the audio data on each beat of the audio from the beat point of the audio, wherein the audio data is discarded at least once on each beat of the audio.
6. The audio switching method of claim 5, wherein the number of times the audio data is discarded per beat of audio ranges from 2 to 4 times.
7. The audio switching method of claim 6, wherein the number of times the audio data is discarded per beat of the audio is 4.
8. The audio switching method of claim 5,
when the first beat speed is less than the second beat speed, gradually increasing the amount of audio data discarded from the first audio each time in a first time course before the second audio enters the perceptual background;
and when the second beat speed is smaller than the first beat speed, gradually reducing the amount of audio data discarded from the second audio every time in a second time course after the first audio exits from the perception background and at a second moment.
9. The audio switching method of claim 5, wherein the amount of audio data dropped from the audio each time is:
wherein S is the amount of audio data discarded at a time, F is the number of times of sampling audio data in a unit time, T is a time history counted with the unit time as a reference, and BPM 1 For the first tempo, BPM 2 Setting the second tempo as delta BPM, wherein delta BPM is the difference value between the first tempo and the second tempo; n is the number of times audio data is discarded per beat of audio.
10. The audio switching method of claim 1, further comprising: and when the second beat speed is greater than the first beat speed, restoring the beat speed of the second audio at a second moment after the first audio exits the perception background.
11. The audio switching method of claim 8, further comprising: and when the second beat speed is less than the first beat speed, restoring the beat speed of the second audio at a fifth moment when the second time history is finished.
12. A terminal device capable of audio switching, comprising:
the device comprises an acquisition unit, a detection unit and a display unit, wherein the acquisition unit is used for acquiring a first beat speed of a first audio frequency in a perception foreground and a second beat speed of a second audio frequency to enter the perception foreground;
a beat processing unit for performing beat processing for accelerating the beat speed of the audio having a smaller beat speed;
and the audio switching unit is used for enabling the second audio to sequentially enter the perception background and the perception foreground and enabling the first audio to sequentially enter the perception background and exit the perception background.
13. The terminal device of claim 12, further comprising:
and the audio mixing processing unit is used for performing audio mixing insertion on the audio in the perception foreground and the perception background from the first moment before the second audio enters the perception background to the second moment after the first audio exits the perception background.
14. The terminal device of claim 12, further comprising:
and the volume adjusting unit is used for adjusting the volumes of the audios in the perception foreground and the perception background from the third moment when the second audio enters the perception background to the fourth moment when the first audio exits the perception background.
15. The terminal device according to claim 12, wherein the acquisition unit includes:
a search unit for searching for a beat point on an audio;
and a calculating unit for calculating the number of the beat points experienced in a unit time and taking the number as the tempo of the audio.
16. The terminal device according to claim 15, wherein the beat processing unit includes:
the sampling unit is used for sampling audio data of audio with smaller beat speed;
and the sub-processing unit is used for discarding the audio data on each beat of the audio from the beat point of the audio, wherein the frequency of discarding the audio data on each beat of the audio is at least one time.
17. The terminal device according to claim 16, wherein the number of times the audio data is discarded per beat of audio ranges from 2 to 4 times.
18. The terminal device of claim 16, wherein the sub-processing unit is further to:
when the first beat speed is smaller than the second beat speed, gradually increasing the amount of audio data discarded from the first audio each time in a first time history before the second audio enters the perception background at a first moment;
and when the second beat speed is smaller than the first beat speed, gradually reducing the amount of audio data discarded from the second audio every time in a second time course after the first audio exits from the perception background and at a second moment.
19. The terminal device of claim 16, wherein the amount of audio data that the sub-processing unit discards from audio at a time is based on the following equation:
wherein S is the amount of audio data discarded at a time, F is the number of times of sampling audio data in a unit time, T is a time history counted with the unit time as a reference, and BPM 1 For the first tempo, BPM 2 The second beat speed is obtained, and the delta BPM is the difference value of the first beat speed and the second beat speed; n is the number of times audio data is discarded per beat of audio.
20. The terminal device according to claim 12, wherein the beat processing unit further includes:
and the restoring unit is used for restoring the tempo of the second audio at a second moment after the first audio exits the perception background when the second tempo is greater than the first tempo.
21. The terminal device of claim 18, wherein the beat processing unit further comprises:
and the restoring unit is used for restoring the tempo of the second audio at the fifth moment when the second tempo is smaller than the first tempo and the second time history is over.
CN201310009908.4A 2013-01-10 2013-01-10 A kind of audio switching method and terminal device Active CN103928037B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310009908.4A CN103928037B (en) 2013-01-10 2013-01-10 A kind of audio switching method and terminal device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310009908.4A CN103928037B (en) 2013-01-10 2013-01-10 A kind of audio switching method and terminal device

Publications (2)

Publication Number Publication Date
CN103928037A CN103928037A (en) 2014-07-16
CN103928037B true CN103928037B (en) 2018-04-13

Family

ID=51146234

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310009908.4A Active CN103928037B (en) 2013-01-10 2013-01-10 A kind of audio switching method and terminal device

Country Status (1)

Country Link
CN (1) CN103928037B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105162427B (en) * 2015-08-27 2018-09-04 深圳Tcl数字技术有限公司 Play handling method when Audio conversion and device
DK179034B1 (en) 2016-06-12 2017-09-04 Apple Inc Devices, methods, and graphical user interfaces for dynamically adjusting presentation of audio outputs
CN108829325B (en) * 2016-06-12 2021-01-08 苹果公司 Apparatus, method and graphical user interface for dynamically adjusting presentation of audio output
CN108322816B (en) * 2018-01-22 2020-07-31 北京英夫美迪科技股份有限公司 Method and system for playing background music in broadcast program
CN108831425B (en) 2018-06-22 2022-01-04 广州酷狗计算机科技有限公司 Sound mixing method, device and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101322180A (en) * 2005-12-09 2008-12-10 索尼株式会社 Music edit device and music edit method
CN101640057A (en) * 2009-05-31 2010-02-03 北京中星微电子有限公司 Audio and video matching method and device therefor
CN101689392A (en) * 2007-06-25 2010-03-31 索尼爱立信移动通讯有限公司 System and method for automatically beat mixing a plurality of songs using an electronic equipment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009093779A (en) * 2007-09-19 2009-04-30 Sony Corp Content reproducing device and contents reproducing method
US8812014B2 (en) * 2010-08-30 2014-08-19 Qualcomm Incorporated Audio-based environment awareness

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101322180A (en) * 2005-12-09 2008-12-10 索尼株式会社 Music edit device and music edit method
CN101689392A (en) * 2007-06-25 2010-03-31 索尼爱立信移动通讯有限公司 System and method for automatically beat mixing a plurality of songs using an electronic equipment
CN101640057A (en) * 2009-05-31 2010-02-03 北京中星微电子有限公司 Audio and video matching method and device therefor

Also Published As

Publication number Publication date
CN103928037A (en) 2014-07-16

Similar Documents

Publication Publication Date Title
CN103928037B (en) A kind of audio switching method and terminal device
JP5266368B2 (en) Method, system and program product for music playback control
CN102577360B (en) Synchronized playback of media players
JP5318095B2 (en) System and method for automatically beat-mixing a plurality of songs using an electronic device
US20090047003A1 (en) Playback apparatus and method
CN101102564A (en) A method for controlling mobile phone to play music
US20230421852A1 (en) Methods, systems, and media for modifying the presentation of video content on a user device based on a consumption of the user device
WO2017088527A1 (en) Audio file re-recording method, device and storage medium
WO2018090603A1 (en) Method and system for controlling music playback of mobile terminal and mobile terminal
JP2009093779A (en) Content reproducing device and contents reproducing method
CN109654692A (en) A kind of control method of air-conditioning, device, storage medium and air-conditioning
CN105843580A (en) Adjustment method and device of vehicle-mounted player volume
CN106446152A (en) Audio file recommendation method and device
CN101466010A (en) Method for playing video on mobile terminal and mobile terminal
US10031720B2 (en) Controlling audio tempo based on a target heart rate
CN105786363B (en) A kind of control method for playing back of voice box group, device and intelligent sound box
US11895479B2 (en) Steering of binauralization of audio
US20230418551A1 (en) Audio device, control method for audio device, and program
CN106384603A (en) Music play method and music play device
CN108958637A (en) Progress adjusting method and device
JP2007236826A (en) Game machine with music tempo discriminating function
CN112133269B (en) Audio processing method, device, equipment and medium
JP7314414B2 (en) Method, system and medium for seamless audio mixing
JP2007157254A (en) Contents reproduction device, retrieval server, and contents selection and reproduction method
WO2018142684A1 (en) Track playback program, track playback device, and track playback method

Legal Events

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