[go: up one dir, main page]

CN111627412B - Audio frequency speed changing method, device, electronic equipment and computer readable storage medium - Google Patents

Audio frequency speed changing method, device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN111627412B
CN111627412B CN202010373241.6A CN202010373241A CN111627412B CN 111627412 B CN111627412 B CN 111627412B CN 202010373241 A CN202010373241 A CN 202010373241A CN 111627412 B CN111627412 B CN 111627412B
Authority
CN
China
Prior art keywords
target
audio
beat frequency
original
speed
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.)
Expired - Fee Related
Application number
CN202010373241.6A
Other languages
Chinese (zh)
Other versions
CN111627412A (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.)
Oppo Chongqing Intelligent Technology Co Ltd
Original Assignee
Oppo Chongqing Intelligent 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 Oppo Chongqing Intelligent Technology Co Ltd filed Critical Oppo Chongqing Intelligent Technology Co Ltd
Priority to CN202010373241.6A priority Critical patent/CN111627412B/en
Publication of CN111627412A publication Critical patent/CN111627412A/en
Application granted granted Critical
Publication of CN111627412B publication Critical patent/CN111627412B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10HELECTROPHONIC MUSICAL INSTRUMENTS; INSTRUMENTS IN WHICH THE TONES ARE GENERATED BY ELECTROMECHANICAL MEANS OR ELECTRONIC GENERATORS, OR IN WHICH THE TONES ARE SYNTHESISED FROM A DATA STORE
    • G10H1/00Details of electrophonic musical instruments
    • G10H1/36Accompaniment arrangements
    • G10H1/40Rhythm
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L21/00Speech or voice signal processing techniques to produce another audible or non-audible signal, e.g. visual or tactile, in order to modify its quality or its intelligibility
    • G10L21/04Time compression or expansion
    • G10L21/043Time compression or expansion by changing speed
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10HELECTROPHONIC MUSICAL INSTRUMENTS; INSTRUMENTS IN WHICH THE TONES ARE GENERATED BY ELECTROMECHANICAL MEANS OR ELECTRONIC GENERATORS, OR IN WHICH THE TONES ARE SYNTHESISED FROM A DATA STORE
    • G10H2210/00Aspects or methods of musical processing having intrinsic musical character, i.e. involving musical theory or musical parameters or relying on musical knowledge, as applied in electrophonic musical tools or instruments
    • G10H2210/031Musical analysis, i.e. isolation, extraction or identification of musical elements or musical parameters from a raw acoustic signal or from an encoded audio signal
    • G10H2210/076Musical analysis, i.e. isolation, extraction or identification of musical elements or musical parameters from a raw acoustic signal or from an encoded audio signal for extraction of timing, tempo; Beat detection
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10HELECTROPHONIC MUSICAL INSTRUMENTS; INSTRUMENTS IN WHICH THE TONES ARE GENERATED BY ELECTROMECHANICAL MEANS OR ELECTRONIC GENERATORS, OR IN WHICH THE TONES ARE SYNTHESISED FROM A DATA STORE
    • G10H2210/00Aspects or methods of musical processing having intrinsic musical character, i.e. involving musical theory or musical parameters or relying on musical knowledge, as applied in electrophonic musical tools or instruments
    • G10H2210/375Tempo or beat alterations; Music timing control

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Acoustics & Sound (AREA)
  • Multimedia (AREA)
  • Computational Linguistics (AREA)
  • Quality & Reliability (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Human Computer Interaction (AREA)
  • Circuit For Audible Band Transducer (AREA)
  • Electrophonic Musical Instruments (AREA)

Abstract

The application relates to an audio frequency speed changing method and device, electronic equipment and a computer readable storage medium. The method comprises the steps of obtaining original audio; performing beat detection on the original audio to obtain the original beat frequency of the original audio; acquiring a beat frequency range and acquiring a target beat frequency; audio corresponding to beat frequencies in the beat frequency range is fidelity when played; determining a double-speed range of the original audio based on the beat frequency range and the original beat frequency; a target tempo of the original audio is determined within a tempo range based on the original tempo frequency and the target tempo frequency. The head gesture detection method and device, the electronic equipment and the computer readable storage medium can ensure that the sound is not distorted when the original audio is played at the target double speed.

Description

音频变速方法、装置、电子设备和计算机可读存储介质Audio speed changing method, device, electronic device and computer readable storage medium

技术领域technical field

本申请涉及音频处理技术领域,特别是涉及一种音频变速方法、装置、电子设备和计算机可读存储介质。The present application relates to the technical field of audio processing, in particular to an audio speed changing method, device, electronic equipment and computer-readable storage medium.

背景技术Background technique

随着电子产品的发展,越来越多的电子产品可以播放各种音频。用户在播放音频时可以对音频进行变速处理,即快进或者慢放。然而,在传统的音频变速方法中,存在变速之后使得播放音频失真的问题。With the development of electronic products, more and more electronic products can play various audio. When playing audio, the user can change the speed of the audio, that is, fast forward or slow down. However, in the traditional audio speed changing method, there is a problem that the playback audio is distorted after the speed is changed.

发明内容Contents of the invention

本申请实施例提供了一种音频变速方法、装置、电子设备、计算机可读存储介质,可以使得音频在变速之后,保证音频在播放时的准确性。Embodiments of the present application provide an audio speed changing method, device, electronic device, and computer-readable storage medium, which can ensure the accuracy of audio playback after the audio speed is changed.

一种音频变速方法,包括:An audio speed change method, comprising:

获取原始音频;get the original audio;

对所述原始音频进行节拍检测,得到所述原始音频的原始节拍频率;performing beat detection on the original audio to obtain the original beat frequency of the original audio;

获取节拍频率范围,以及获取目标节拍频率;所述节拍频率范围内的节拍频率对应的音频在播放时保真;Acquiring the beat frequency range, and acquiring the target beat frequency; the audio corresponding to the beat frequency within the beat frequency range is fidelity during playback;

基于所述节拍频率范围和所述原始节拍频率,确定所述原始音频的倍速范围;Based on the beat frequency range and the original beat frequency, determine the double speed range of the original audio;

基于所述原始节拍频率和所述目标节拍频率,在所述倍速范围内确定所述原始音频的目标倍速。Based on the original beat frequency and the target beat frequency, a target multiple speed of the original audio is determined within the multiple speed range.

一种音频变速装置,包括:An audio speed changer, comprising:

原始音频获取模块,用于获取原始音频;The original audio acquisition module is used to obtain the original audio;

节拍检测模块,用于对所述原始音频进行节拍检测,得到所述原始音频的原始节拍频率;A beat detection module, configured to perform beat detection on the original audio to obtain the original beat frequency of the original audio;

目标节拍频率获取模块,用于获取节拍频率范围,以及获取目标节拍频率;所述节拍频率范围内的节拍频率对应的音频在播放时保真;The target beat frequency acquisition module is used to acquire the beat frequency range and the target beat frequency; the audio corresponding to the beat frequency in the beat frequency range is fidelity during playback;

倍速范围确定模块,用于基于所述节拍频率范围和所述原始节拍频率,确定所述原始音频的倍速范围;A double speed range determination module, configured to determine the double speed range of the original audio based on the beat frequency range and the original beat frequency;

目标倍速确定模块,用于基于所述原始节拍频率和所述目标节拍频率,在所述倍速范围内确定所述原始音频的目标倍速。A target multiple speed determining module, configured to determine a target multiple speed of the original audio within the multiple speed range based on the original beat frequency and the target beat frequency.

一种电子设备,包括存储器及处理器,所述存储器中储存有计算机程序,所述计算机程序被所述处理器执行时,使得所述处理器执行如上述的音频变速方法的步骤。An electronic device includes a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor is made to execute the steps of the above audio speed changing method.

一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如上述的方法的步骤。A computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned method are realized.

上述音频变速方法、装置、电子设备和计算机可读存储介质,获取原始音频;对原始音频进行节拍检测,得到原始音频的原始节拍频率;获取节拍频率范围,以及获取目标节拍频率;基于节拍频率范围和原始节拍频率,确定原始音频的倍速范围;节拍频率范围内的节拍频率对应的音频在播放时保真,而倍速范围由该节拍频率范围所确定,则音频以该倍速范围内的倍速进行播放时也保真;基于原始节拍频率和目标节拍频率,在倍速范围内确定原始音频的目标倍速,可以保证该原始音频以目标倍速进行播放时声音不失真,也即保真。The above-mentioned audio speed changing method, device, electronic equipment and computer-readable storage medium obtain the original audio; perform beat detection on the original audio to obtain the original beat frequency of the original audio; obtain the beat frequency range and obtain the target beat frequency; based on the beat frequency range and the original beat frequency, determine the double speed range of the original audio; the audio corresponding to the beat frequency within the beat frequency range is fidelity during playback, and the double speed range is determined by the beat frequency range, then the audio is played at the double speed within the double speed range The time is also fidelity; based on the original beat frequency and the target beat frequency, the target double speed of the original audio is determined within the double speed range, which can ensure that the sound is not distorted when the original audio is played at the target double speed, that is, fidelity.

附图说明Description of drawings

为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present application. Those skilled in the art can also obtain other drawings based on these drawings without creative work.

图1为一个实施例中音频变速方法的流程图;Fig. 1 is the flow chart of audio speed changing method in an embodiment;

图2为一个实施例中节拍检测方法的示意图;Fig. 2 is a schematic diagram of a beat detection method in an embodiment;

图3为一个实施例中步骤确定目标倍速的流程图;Fig. 3 is a flow chart of steps determining the target multiple speed in an embodiment;

图4为另一个实施例中步骤确定目标倍速的流程图;Fig. 4 is a flow chart of determining the target multiplied speed by steps in another embodiment;

图5为一个实施例中音频变速装置的结构框图;Fig. 5 is a structural block diagram of the audio transmission device in an embodiment;

图6为一个实施例中电子设备的内部结构示意图。Fig. 6 is a schematic diagram of the internal structure of an electronic device in one embodiment.

具体实施方式Detailed ways

为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solution and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present application, and are not intended to limit the present application.

图1为一个实施例中音频变速方法的流程图。如图1所示,音频变速方法包括步骤102至步骤110。Fig. 1 is a flowchart of an audio speed changing method in one embodiment. As shown in FIG. 1 , the audio speed changing method includes step 102 to step 110 .

步骤102,获取原始音频。Step 102, acquire original audio.

原始音频可以是一段音乐、一段录音、一段视频中所包括的音频等,不限于此。原始音频的长度也不限定,可以是10秒长的音频,也可以是1小时长的音频。The original audio may be a piece of music, a recording, audio included in a video, etc., but is not limited thereto. The length of the original audio is not limited either, and may be 10 seconds long or 1 hour long.

在一种实施方式中,还包括对原始音频进行预处理。预处理可以包括滤波处理、差值处理、傅里叶变换等,滤除原始音频中的噪声。In one embodiment, preprocessing the original audio is also included. Preprocessing may include filter processing, difference processing, Fourier transform, etc., to filter out noise in the original audio.

步骤104,对原始音频进行节拍检测,得到原始音频的原始节拍频率。Step 104, performing beat detection on the original audio to obtain the original beat frequency of the original audio.

原始节拍频率(Beat Per Minute)即原始音频中每分钟的节拍数。原始节拍频率越大,表示原始音频的节奏越快;原始节拍频率越小,表示原始音频的节奏越慢。The original beat frequency (Beat Per Minute) is the number of beats per minute in the original audio. The higher the original beat frequency, the faster the original audio rhythm; the smaller the original beat frequency, the slower the original audio rhythm.

在一个实施例中,如图2所示,电子设备获取原始音频信号,对原始音频信号进行预处理,得到预处理之后的音频信号。其中,预处理可以包括滤波处理、差值处理、傅里叶变换等,滤除原始音频中的噪声。电子设备对预处理之后的音频信号进行信号降低(Reduction),再采用检测功能对信号降低之后的音频信号进行检测,可以检测到音频信号中的各个峰值,执行峰值选取,并将选取的峰值进行定位,可以检测出原始音频信号中的各个节拍的位置,统计原始音频信号中的各个节拍,可以得到原始音频信号的原始节拍频率。In one embodiment, as shown in FIG. 2 , the electronic device acquires an original audio signal, performs preprocessing on the original audio signal, and obtains a preprocessed audio signal. Wherein, the preprocessing may include filter processing, difference processing, Fourier transform, etc., to filter out noise in the original audio. The electronic device performs signal reduction (Reduction) on the preprocessed audio signal, and then uses the detection function to detect the audio signal after the signal reduction. It can detect each peak value in the audio signal, perform peak selection, and perform the selected peak value. Positioning can detect the position of each beat in the original audio signal, count each beat in the original audio signal, and obtain the original beat frequency of the original audio signal.

步骤106,获取节拍频率范围,以及获取目标节拍频率;节拍频率范围内的节拍频率对应的音频在播放时保真。Step 106, acquiring the beat frequency range, and acquiring the target beat frequency; the audio corresponding to the beat frequency within the beat frequency range is played with fidelity.

可以理解的是,当音频的节拍频率过大或者过小,该音频在播放时会存在失真的问题。因此,获取节拍频率范围,该节拍频率范围内的节拍频率对应的音频在播放时保真。例如,节拍频率范围可以是[45,190],即音频的最小节拍频率为45,最大节拍频率为190;又如,节拍频率范围可以是[100,150],即音频的最小节拍频率为100,最大节拍频率为150。节拍频率范围可以根据用户需要进行设定。It can be understood that when the beat frequency of the audio is too high or too low, there will be a problem of distortion when the audio is played. Therefore, the beat frequency range is obtained, and the audio corresponding to the beat frequency within the beat frequency range is played with fidelity. For example, the beat frequency range can be [45,190], that is, the minimum beat frequency of the audio is 45, and the maximum beat frequency is 190; another example, the beat frequency range can be [100,150], that is, the minimum beat frequency of the audio is 100, and the maximum beat frequency is 190. for 150. The beat frequency range can be set according to user needs.

目标节拍频率为该原始音频变速之后的节拍频率。当目标节拍频率大于原始节拍频率时,表示对该原始音频进行快进;当目标节拍频率小于原始节拍频率时,表示对该原始音频进行慢放。The target beat frequency is the beat frequency after the speed change of the original audio. When the target beat frequency is greater than the original beat frequency, it means that the original audio is fast-forwarded; when the target beat frequency is smaller than the original beat frequency, it means that the original audio is slowed down.

在一个实施例中,从节拍频率范围内确定至少两个候选节拍频率;基于选取指令从至少两个候选节拍频率中确定目标节拍频率。In one embodiment, at least two candidate beat frequencies are determined from within the beat frequency range; and the target beat frequency is determined from the at least two candidate beat frequencies based on the selection instruction.

可以理解的是,音乐有固定的节拍频率,电子设备可以将这些固定的节拍频率设置为节拍频率范围内的候选节拍频率,如90,120,160。当用户从至少两个候选节拍频率中选择其中的一个时,生成选取指令,基于该选取指令将该选取的候选节拍频率作为目标节拍频率。It can be understood that music has fixed beat frequencies, and the electronic device can set these fixed beat frequencies as candidate beat frequencies within the beat frequency range, such as 90, 120, and 160. When the user selects one of the at least two candidate beat frequencies, a selection instruction is generated based on which the selected candidate beat frequency is used as the target beat frequency.

步骤108,基于节拍频率范围和原始节拍频率,确定原始音频的倍速范围。Step 108, based on the beat frequency range and the original beat frequency, determine the double speed range of the original audio.

具体地,节拍频率范围存在上限节拍频率和下限节拍频率,上限节拍频率即节拍频率范围的最大值,下限节拍频率即节拍频率范围的最小值。电子设备将上限节拍频率、下限节拍频率分别除以原始节拍频率,可以得到原始音频的倍速范围。Specifically, the beat frequency range has an upper limit beat frequency and a lower limit beat frequency, the upper limit beat frequency is the maximum value of the beat frequency range, and the lower limit beat frequency is the minimum value of the beat frequency range. The electronic device divides the upper limit beat frequency and the lower limit beat frequency by the original beat frequency respectively, and the double speed range of the original audio can be obtained.

可以理解的是,当确定节拍频率范围之后,原始音频的原始节拍频率越接近该节拍频率范围的最大值,则该原始音频的倍速范围中的最大倍速越小,即原始音频可以快进的空间越小,可以慢放的空间越大;相应地,原始音频的原始节拍频率越接近该节拍频率范围的最小值,则该原始音频的倍速范围中的最小倍速越大,即原始音频可以慢放的空间越小,可以快进的空间越大。It can be understood that after the beat frequency range is determined, the closer the original beat frequency of the original audio is to the maximum value of the beat frequency range, the smaller the maximum speed in the double speed range of the original audio, that is, the space in which the original audio can be fast forwarded The smaller the value, the larger the space that can be slowed down; correspondingly, the closer the original beat frequency of the original audio is to the minimum value of the beat frequency range, the greater the minimum multiple speed in the multiple speed range of the original audio, that is, the original audio can be slowed down The smaller the space, the more space you can fast forward.

例如,确定的节拍频率范围是[45,180],当原始音频的原始节拍频率是160时,则原始音频的倍速范围是[0.28125,1.125],则原始音频可以快进的空间为(1,1.125],可以慢放的空间为[0.28125,1);当原始音频的原始节拍频率是50时,则原始音频的倍速范围是[0.9,3.6],则原始音频可以快进的空间为(1,3.6],可以慢放的空间为[0.9,1)。For example, the determined beat frequency range is [45,180]. When the original beat frequency of the original audio is 160, the double speed range of the original audio is [0.28125, 1.125], and the space for the original audio to fast forward is (1,1.125] , the space that can be slowed down is [0.28125, 1); when the original beat frequency of the original audio is 50, the double speed range of the original audio is [0.9, 3.6], and the space that the original audio can be fast forwarded is (1,3.6 ], the space that can be slowed down is [0.9, 1).

步骤110,基于原始节拍频率和目标节拍频率,在倍速范围内确定原始音频的目标倍速。Step 110, based on the original beat frequency and the target beat frequency, determine the target multiple speed of the original audio within the multiple speed range.

目标倍速指的是原始音频变速之后的目标音频相对于原始音频的速率。当目标倍速大于1时,表示对原始音频进行快进。当目标倍速小于1时,表示对原始音频进行慢放。当目标倍速等于1时,表示原始音频速度不变,则不对原始音频进行处理。The target speed refers to the rate of the target audio after the speed change of the original audio relative to the original audio. When the target speed is greater than 1, it means that the original audio is fast forwarded. When the target speed is less than 1, it means slow down the original audio. When the target multiple speed is equal to 1, it means that the speed of the original audio remains unchanged, and the original audio is not processed.

电子设备获取到原始音频的原始节拍频率,以及目标节拍频率之后,将目标节拍频率除以原始节拍频率,即可得到原始音频的倍速。然而,为了使得原始音频变速之后的目标音频在播放时仍能保真,则从倍速范围内确定原始音频的目标倍速。After the electronic device obtains the original beat frequency of the original audio and the target beat frequency, the target beat frequency is divided by the original beat frequency to obtain the double speed of the original audio. However, in order to ensure that the target audio after the speed change of the original audio can still be played with fidelity, the target multiple speed of the original audio is determined from within the multiple speed range.

上述音频变速方法,获取原始音频;对原始音频进行节拍检测,得到原始音频的原始节拍频率;获取节拍频率范围,以及获取目标节拍频率;基于节拍频率范围和原始节拍频率,确定原始音频的倍速范围;节拍频率范围内的节拍频率对应的音频在播放时保真,而倍速范围由该节拍频率范围所确定,则音频以该倍速范围内的倍速进行播放时也保真;基于原始节拍频率和目标节拍频率,在倍速范围内确定原始音频的目标倍速,可以保证该原始音频以目标倍速进行播放时声音不失真,也即保真。The above audio speed change method obtains the original audio; performs beat detection on the original audio to obtain the original beat frequency of the original audio; obtains the beat frequency range and the target beat frequency; determines the double speed range of the original audio based on the beat frequency range and the original beat frequency ;The audio corresponding to the beat frequency within the beat frequency range has fidelity during playback, and the double speed range is determined by the beat frequency range, so the audio is also played with fidelity at the double speed within the double speed range; based on the original beat frequency and target The beat frequency determines the target multiple speed of the original audio within the multiple speed range, which can ensure that the sound is not distorted when the original audio is played at the target multiple speed, that is, fidelity.

并且,传统音频变速方法通常是用户手动拉动变速条进行调节,存在调节不准确的问题,而上述音频变速方法无需用户手动调节倍速,只需输入目标节拍频率即可,将音频变速从倍速的角度转变成节拍数的角度,避免了调节倍速时不够准确的问题,提高了音频变速的准确性。Moreover, the traditional audio speed change method usually requires the user to manually pull the speed change bar to adjust, which has the problem of inaccurate adjustment. However, the above audio speed change method does not require the user to manually adjust the double speed, and only needs to input the target beat frequency to change the audio speed from the perspective of double speed. The angle converted into the number of beats avoids the problem of inaccuracy when adjusting the double speed, and improves the accuracy of audio speed change.

在一个实施例中,节拍频率范围包括上限节拍频率至下限节拍频率之间的各个节拍频率;基于节拍频率范围和原始节拍频率,确定原始音频的倍速范围,包括:将上限节拍频率除以原始节拍频率,得到上限倍速;将下限节拍频率除以原始节拍频率,得到下限倍速;基于上限倍速和下限倍速生成原始音频的倍速范围。In one embodiment, the beat frequency range includes each beat frequency between the upper limit beat frequency and the lower limit beat frequency; based on the beat frequency range and the original beat frequency, determining the double speed range of the original audio includes: dividing the upper limit beat frequency by the original beat frequency to get the upper limit double speed; divide the lower limit beat frequency by the original beat frequency to get the lower limit double speed; generate the double speed range of the original audio based on the upper limit double speed and the lower limit double speed.

节拍频率范围存在上限节拍频率和下限节拍频率,上限节拍频率即节拍频率范围的最大值,下限节拍频率即节拍频率范围的最小值。The beat frequency range has an upper limit beat frequency and a lower limit beat frequency, the upper limit beat frequency is the maximum value of the beat frequency range, and the lower limit beat frequency is the minimum value of the beat frequency range.

电子设备将上限节拍频率除以原始节拍频率,可以得到上限倍速。电子设备将下限节拍频率除以原始节拍频率,可以得到下限倍速。上限倍速为倍速范围的最大值,下限倍速为倍速范围的最小值,倍速范围包括了上限倍速和下限倍速之间的各个倍速。The electronic device divides the upper limit beat frequency by the original beat frequency to obtain the upper limit double speed. The electronic device divides the lower limit beat frequency by the original beat frequency to obtain the lower limit double speed. The upper limit double speed is the maximum value of the double speed range, the lower limit double speed is the minimum value of the double speed range, and the double speed range includes each double speed between the upper limit double speed and the lower limit double speed.

在本实施例中,将上限节拍频率除以原始节拍频率,得到上限倍速;将下限节拍频率除以原始节拍频率,得到下限倍速;基于上限倍速和下限倍速可以准确生成原始音频的倍速范围。In this embodiment, the upper limit double speed is obtained by dividing the upper limit beat frequency by the original beat frequency; the lower limit double speed is obtained by dividing the lower limit beat frequency by the original beat frequency; the double speed range of the original audio can be accurately generated based on the upper limit double speed and the lower limit double speed.

在一个实施例中,如图3所示,基于原始节拍频率和目标节拍频率,在倍速范围内确定原始音频的目标倍速,包括:In one embodiment, as shown in FIG. 3 , based on the original beat frequency and the target beat frequency, the target double speed of the original audio is determined within the double speed range, including:

步骤302,将目标节拍频率除以原始节拍频率,得到参考倍速。Step 302, dividing the target beat frequency by the original beat frequency to obtain a reference double speed.

例如,目标节拍频率为150,原始节拍频率为100,则将目标节拍频率150除以原始节拍频率100,得到参考倍速为1.5。又如,目标节拍频率为50,原始节拍频率为100,则将目标节拍频率50除以原始节拍频率100,得到参考倍速为0.5。For example, if the target beat frequency is 150 and the original beat frequency is 100, divide the target beat frequency 150 by the original beat frequency 100 to obtain a reference multiplier speed of 1.5. For another example, if the target beat frequency is 50 and the original beat frequency is 100, then the target beat frequency 50 is divided by the original beat frequency 100 to obtain a reference multiplier speed of 0.5.

步骤304,将参考倍速与倍速范围进行匹配,得到匹配结果。Step 304, matching the reference multiple speed with the multiple speed range to obtain a matching result.

可以理解的是,电子设备将参考倍速与倍速范围进行匹配,则得到的匹配结果可以是参考倍速处于倍速范围内,也可以参考倍速超出该倍速范围。It can be understood that, when the electronic device matches the reference multiple speed with the multiple speed range, the obtained matching result may be that the reference multiple speed is within the multiple speed range, or the reference multiple speed may exceed the multiple speed range.

步骤306,基于匹配结果从倍速范围确定原始音频的目标倍速。Step 306: Determine the target multiple speed of the original audio from the multiple speed range based on the matching result.

基于匹配结果,从倍速范围内确定原始音频的目标倍速,则确定的目标倍速可以使得原始音频进行变速之后得到的目标音频,在播放时声音不失真,也即保真。Based on the matching result, the target multiple speed of the original audio is determined from within the multiple speed range, and the determined target multiple speed can make the target audio obtained after the original audio is changed in speed without distortion during playback, that is, fidelity.

在一个实施例中,倍速范围包括上限倍速至下限倍速之间的各个倍速。In one embodiment, the multiple speed range includes each multiple speed between the upper limit multiple speed and the lower limit multiple speed.

上限倍速为倍速范围的最大值,下限倍速为倍速范围的最小值,倍速范围包括了上限倍速和下限倍速之间的各个倍速。The upper limit double speed is the maximum value of the double speed range, the lower limit double speed is the minimum value of the double speed range, and the double speed range includes each double speed between the upper limit double speed and the lower limit double speed.

如图4所示,基于匹配结果从倍速范围确定原始音频的目标倍速,包括:As shown in Figure 4, the target speed of the original audio is determined from the speed range based on the matching result, including:

步骤402,当参考倍速处于倍速范围内时,将参考倍速作为原始音频的目标倍速。Step 402, when the reference speed is within the speed range, set the reference speed as the target speed of the original audio.

当参考倍速处于倍速范围内时,则原始音频以该参考倍速进行播放时声音不失真,则可以将该参考倍速作为原始音频的目标倍速。When the reference speed is within the speed range, the sound will not be distorted when the original audio is played at the reference speed, and the reference speed can be used as the target speed of the original audio.

步骤404,当参考倍速大于倍速范围的上限倍速时,将上限倍速作为原始音频的目标倍速。Step 404, when the reference speed is greater than the upper speed limit of the speed range, set the upper speed limit as the target speed of the original audio.

当参考倍速大于倍速范围的上限倍速时,表示该参考倍速过大,当原始音频以该参考倍速进行播放时声音失真。因此,电子设备可以将倍速范围的最大值,即上限倍速作为该原始音频的目标倍速。When the reference speed is greater than the upper limit of the speed range, it means that the reference speed is too high, and the sound is distorted when the original audio is played at the reference speed. Therefore, the electronic device may use the maximum value of the multiple speed range, that is, the upper limit multiple speed, as the target multiple speed of the original audio.

在另一种实施方式中,当参考倍速大于倍速范围的上限倍速时,还可以将倍速范围内的其他倍速作为原始音频的目标倍速。In another implementation manner, when the reference speed is greater than the upper speed limit of the speed range, other speeds within the speed range may also be used as target speeds of the original audio.

步骤406,当参考倍速小于倍速范围的下限倍速时,将下限倍速作为原始音频的目标倍速。Step 406, when the reference speed is lower than the lower limit speed of the speed range, use the lower limit speed as the target speed of the original audio.

当参考倍速小于倍速范围的下限倍速时,表示该参考倍速过小,当原始音频以该参考倍速进行播放时声音失真。因此,电子设备可以将倍速范围的最小值,即下限倍速作为该原始音频的目标倍速。When the reference speed is lower than the lower limit speed of the speed range, it means that the reference speed is too small, and the sound is distorted when the original audio is played at the reference speed. Therefore, the electronic device may use the minimum value of the multiple speed range, that is, the lower limit multiple speed, as the target multiple speed of the original audio.

在另一种实施方式中,当参考倍速小于倍速范围的下限倍速时,还可以将倍速范围内的其他倍速作为原始音频的目标倍速。In another embodiment, when the reference speed is lower than the lower limit speed of the speed range, other speeds within the speed range may also be used as target speeds of the original audio.

在本实施例中,不管参考倍速是否处于倍速范围内,均可以保证确定的原始音频的目标倍速处于倍速范围内,从而可以保证原始音频以目标倍速进行播放时声音保真。In this embodiment, regardless of whether the reference multiple speed is within the multiple speed range, it can be ensured that the determined target multiple speed of the original audio is within the multiple speed range, thereby ensuring sound fidelity when the original audio is played at the target multiple speed.

在一个实施例中,上述方法还包括:采用目标倍速对原始音频进行调整,得到目标音频;获取对目标音频的播放指令,根据播放指令播放目标音频。In one embodiment, the above method further includes: adjusting the original audio at a target multiple speed to obtain the target audio; acquiring a playback instruction for the target audio, and playing the target audio according to the playback instruction.

当目标倍速大于1时,表示对原始音频进行快进,则对原始音频进行删帧,得到目标音频。当目标倍速小于1时,表示对原始音频进行慢放,则对原始音频进行插帧,得到目标音频。当目标倍速等于1时,表示原始音频速度不变,则不对原始音频进行处理,目标音频即原始音频。When the target multiple speed is greater than 1, it means that the original audio is fast-forwarded, and the original audio is deleted to obtain the target audio. When the target multiple speed is less than 1, it means that the original audio is slowed down, and the original audio is interpolated to obtain the target audio. When the target multiple speed is equal to 1, it means that the speed of the original audio remains unchanged, and the original audio is not processed, and the target audio is the original audio.

电子设备先对原始音频进行划分基音周期(声带每开启一次和闭合一次的时间),之后采用重叠相加算法对基音周期进行插帧或删帧,从而达到音频快进或慢放的目的。The electronic equipment first divides the pitch period of the original audio (the time for each opening and closing of the vocal cords), and then uses the overlap-and-add algorithm to insert or delete frames for the pitch period, so as to achieve the purpose of fast forwarding or slowing down the audio.

在本实施例中,采用目标倍速对原始音频进行调整,得到目标音频,则目标音频在播放时声音不失真,也即保真。In this embodiment, the original audio is adjusted at the target multiple speed to obtain the target audio, and the target audio will not be distorted when played, that is, fidelity.

在一个实施例中,上述方法还包括:基于目标节拍频率,确定马达的目标振动频率;在播放目标音频时,控制马达采用目标振动频率进行振动。In one embodiment, the above method further includes: determining a target vibration frequency of the motor based on the target beat frequency; and controlling the motor to vibrate at the target vibration frequency when the target audio is played.

在一种实施方式中,马达的目标振动频率可以和目标节拍频率相同。在其他实施例中,马达的目标振动频率也可以和目标节拍频率不同,如马达的目标振动频率是目标节拍频率的一半,如马达的目标振动频率是目标节拍频率的两倍,等等。In one embodiment, the target vibration frequency of the motor may be the same as the target beat frequency. In other embodiments, the target vibration frequency of the motor may also be different from the target beat frequency, for example, the target vibration frequency of the motor is half of the target beat frequency, such as the target vibration frequency of the motor is twice the target beat frequency, and so on.

电子设备在播放目标音频时,控制马达采用目标振动频率进行振动,不仅可以从声音这一维度播放目标音频,还可以从触感这一维度体现目标音频在播放时的节奏,并且可以更好地提醒用户电子设备此时正处于播放目标音频的状态。When the electronic device is playing the target audio, the motor is controlled to vibrate at the target vibration frequency, which not only plays the target audio from the dimension of sound, but also reflects the rhythm of the target audio from the dimension of touch, and can better remind The user electronic device is currently in the state of playing the target audio.

例如,电子设备预先设置目标音频为来电铃声,当接收到来电呼叫时,电子设备播放该目标音频,并且同时控制马达采用目标振动频率进行振动,不仅可以从声音这一维度提醒用户接收到来电,还可以从触感这一维度提醒用户接受到来电。For example, the electronic device presets the target audio as the incoming ringtone. When an incoming call is received, the electronic device plays the target audio, and at the same time controls the motor to vibrate at the target vibration frequency, which not only reminds the user of the incoming call from the sound dimension, but also It can also remind the user to accept the incoming call from the dimension of touch.

在一个实施例中,上述方法还包括:当接收到呼叫请求时,播放目标音频,并执行在播放目标音频时,控制马达采用目标振动频率进行振动步骤;统计播放目标音频的时长;当时长达到时长阈值时,控制马达停止振动。In one embodiment, the above method further includes: when a call request is received, playing the target audio, and performing the step of controlling the motor to vibrate with the target vibration frequency when the target audio is played; counting the duration of playing the target audio; when the duration reaches When the duration threshold is reached, the motor is controlled to stop vibrating.

播放目标音频的时长,指的是从开始播放目标音频的时刻至当前时刻的之间的时长。时长阈值可以根据用户需要进行设定。The duration of playing the target audio refers to the duration from the moment when the target audio starts to be played to the current moment. The duration threshold can be set according to user needs.

电子设备接收到呼叫请求时,播放目标音频,并且同时控制马达采用目标振动频率进行振动。当电子设备统计播放目标音频的时长达到时长阈值时,表示电子设备播放该目标音频的时长较长,用户可能不在电子设备旁边,或者用户不方便进行接听等,则可以控制马达停止振动,可以节约电子设备的处理资源。When the electronic device receives the call request, it plays the target audio, and at the same time controls the motor to vibrate with the target vibration frequency. When the electronic device counts the duration of playing the target audio and reaches the duration threshold, it means that the electronic device plays the target audio for a long time, the user may not be next to the electronic device, or it is inconvenient for the user to answer the call, etc., the motor can be controlled to stop vibration, which can save Processing resources for electronic devices.

在一个实施例中,在播放目标音频时,控制马达采用目标振动频率进行振动,包括:在播放目标音频时,检测目标音频的声音强度;基于目标音频的声音强度确定马达的目标振动强度;马达的目标振动强度与目标音频的声音强度成负相关;控制马达采用目标振动频率以及目标振动强度进行振动。In one embodiment, when the target audio is played, controlling the motor to vibrate with the target vibration frequency includes: when the target audio is played, detecting the sound intensity of the target audio; determining the target vibration intensity of the motor based on the sound intensity of the target audio; The target vibration intensity of is negatively correlated with the sound intensity of the target audio; the control motor vibrates with the target vibration frequency and target vibration intensity.

目标音频的声音强度指的是目标音频在播放时的声音大小,可以用分贝进行表示,分贝越大,声音强度越强,目标音频在播放时声音越大。目标振动强度指的是马达振动的强度。目标振动强度越强,表示马达振动的越剧烈,则用户越容易感知到马达的振动。The sound intensity of the target audio refers to the sound level of the target audio when it is played, and can be expressed in decibels. The larger the decibel, the stronger the sound intensity, and the louder the sound of the target audio when it is played. The target vibration intensity refers to the intensity of motor vibration. The stronger the target vibration intensity, the more violent the motor vibration is, and the easier it is for the user to perceive the vibration of the motor.

可以理解的是,当目标音频的声音强度越强,则马达的目标振动强度越弱,可以节约电子设备的处理资源;当目标音频的声音强度越弱,则马达的目标振动强度越强,可以更好地提醒用户电子设备正处于播放目标音频的状态。也就是说,马达的目标振动强度与目标音频的声音强度成负相关。It can be understood that when the sound intensity of the target audio is stronger, the target vibration intensity of the motor is weaker, which can save processing resources of the electronic device; when the sound intensity of the target audio is weaker, the target vibration intensity of the motor is stronger, which can Better remind the user that the electronic device is in the state of playing the target audio. That is, the target vibration intensity of the motor is negatively correlated with the target audio sound intensity.

应该理解的是,虽然图1、图3和图4的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图1、图3和图4中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the various steps in the flowcharts of FIG. 1 , FIG. 3 and FIG. 4 are displayed sequentially as indicated by the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least some of the steps in Fig. 1, Fig. 3 and Fig. 4 may include multiple sub-steps or multiple stages, these sub-steps or stages are not necessarily executed at the same time, but may be executed at different moments, these The execution order of the sub-steps or stages is not necessarily performed sequentially, but may be executed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.

图5为一个实施例的音频变速装置的结构框图。如图5所示,提供了一种音频变速装置500,包括:原始音频获取模块502、节拍检测模块504、目标节拍频率获取模块506、倍速范围确定模块508和目标倍速确定模块510。其中:Fig. 5 is a structural block diagram of an audio transmission device of an embodiment. As shown in FIG. 5 , an audio speed change device 500 is provided, including: an original audio acquisition module 502 , a beat detection module 504 , a target beat frequency acquisition module 506 , a multiple speed range determination module 508 and a target multiple speed determination module 510 . in:

原始音频获取模块502,用于获取原始音频。The original audio acquisition module 502 is configured to acquire original audio.

节拍检测模块504,用于对所述原始音频进行节拍检测,得到所述原始音频的原始节拍频率。The beat detection module 504 is configured to perform beat detection on the original audio to obtain the original beat frequency of the original audio.

目标节拍频率获取模块506,用于获取节拍频率范围,以及获取目标节拍频率;节拍频率范围内的节拍频率对应的音频在播放时保真;。The target beat frequency acquisition module 506 is used to acquire the beat frequency range, and acquire the target beat frequency; the audio corresponding to the beat frequency within the beat frequency range is fidelity during playback;

倍速范围确定模块508,用于基于所述节拍频率范围和所述原始节拍频率,确定所述原始音频的倍速范围。The multiple speed range determination module 508 is configured to determine the multiple speed range of the original audio based on the beat frequency range and the original beat frequency.

目标倍速确定模块510,用于基于所述原始节拍频率和所述目标节拍频率,在所述倍速范围内确定所述原始音频的目标倍速。The target multiple speed determining module 510 is configured to determine the target multiple speed of the original audio within the multiple speed range based on the original beat frequency and the target beat frequency.

上述音频变速装置,获取原始音频;对原始音频进行节拍检测,得到原始音频的原始节拍频率;获取节拍频率范围,以及获取目标节拍频率;基于节拍频率范围和原始节拍频率,确定原始音频的倍速范围;节拍频率范围内的节拍频率对应的音频在播放时保真,而倍速范围由该节拍频率范围所确定,则音频以该倍速范围内的倍速进行播放时也保真;基于原始节拍频率和目标节拍频率,在倍速范围内确定原始音频的目标倍速,可以保证该原始音频以目标倍速进行播放时声音不失真,也即保真。The above-mentioned audio speed change device obtains the original audio; performs beat detection on the original audio to obtain the original beat frequency of the original audio; acquires the beat frequency range and obtains the target beat frequency; determines the double speed range of the original audio based on the beat frequency range and the original beat frequency ;The audio corresponding to the beat frequency within the beat frequency range has fidelity during playback, and the double speed range is determined by the beat frequency range, so the audio is also played with fidelity at the double speed within the double speed range; based on the original beat frequency and target The beat frequency determines the target multiple speed of the original audio within the multiple speed range, which can ensure that the sound is not distorted when the original audio is played at the target multiple speed, that is, fidelity.

在一个实施例中,节拍频率范围包括上限节拍频率至下限节拍频率之间的各个节拍频率;上述倍速范围确定模块508还用于将所述上限节拍频率除以所述原始节拍频率,得到上限倍速;将所述下限节拍频率除以所述原始节拍频率,得到下限倍速;基于所述上限倍速和所述下限倍速生成所述原始音频的倍速范围。In one embodiment, the beat frequency range includes each beat frequency between the upper limit beat frequency and the lower limit beat frequency; the above-mentioned double speed range determination module 508 is also used to divide the upper limit beat frequency by the original beat frequency to obtain the upper limit double speed ; dividing the lower limit beat frequency by the original beat frequency to obtain a lower limit double speed; generating the double speed range of the original audio based on the upper limit double speed and the lower limit double speed.

在一个实施例中,上述目标倍速确定模块510还用于将所述目标节拍频率除以所述原始节拍频率,得到参考倍速;将所述参考倍速与所述倍速范围进行匹配,得到匹配结果;基于所述匹配结果从所述倍速范围确定所述原始音频的目标倍速。In one embodiment, the target multiple speed determination module 510 is further configured to divide the target beat frequency by the original beat frequency to obtain a reference multiple speed; match the reference multiple speed with the multiple speed range to obtain a matching result; A target multiple speed of the original audio is determined from the multiple speed range based on the matching result.

在一个实施例中,倍速范围包括上限倍速至下限倍速之间的各个倍速;上述目标倍速确定模块510还用于当所述参考倍速处于所述倍速范围内时,将所述参考倍速作为所述原始音频的目标倍速;当所述参考倍速大于所述倍速范围的上限倍速时,将所述上限倍速作为所述原始音频的目标倍速;当所述参考倍速小于所述倍速范围的下限倍速时,将所述下限倍速作为所述原始音频的目标倍速。In one embodiment, the multiple speed range includes each multiple speed between the upper limit multiple speed and the lower limit multiple speed; the above-mentioned target multiple speed determination module 510 is also configured to use the reference multiple speed as the reference speed when the reference multiple speed is within the multiple speed range. The target multiple speed of the original audio; when the reference multiple speed is greater than the upper limit multiple speed of the multiple speed range, the upper limit multiple speed is used as the target multiple speed of the original audio; when the reference multiple speed is smaller than the lower limit multiple speed of the multiple speed range, The lower limit speed is used as the target speed of the original audio.

在一个实施例中,上述音频变速装置500还包括目标音频播放模块,用于采用所述目标倍速对所述原始音频进行调整,得到目标音频;获取对所述目标音频的播放指令,根据所述播放指令播放所述目标音频。In one embodiment, the above-mentioned audio speed change device 500 further includes a target audio playback module, configured to adjust the original audio by using the target multiple speed to obtain the target audio; obtain a playback instruction for the target audio, according to the The play instruction plays the target audio.

在一个实施例中,上述音频变速装置500还包括马达控制模块,用于基于所述目标节拍频率,确定马达的目标振动频率;在播放所述目标音频时,控制所述马达采用所述目标振动频率进行振动。In one embodiment, the above-mentioned audio speed changing device 500 further includes a motor control module, configured to determine the target vibration frequency of the motor based on the target beat frequency; when playing the target audio, control the motor to adopt the target vibration frequency to vibrate.

在一个实施例中,上述马达控制模块还用于当接收到呼叫请求时,播放所述目标音频,并执行在播放所述目标音频时,控制所述马达采用所述目标振动频率进行振动步骤;统计播放所述目标音频的时长;当所述时长达到时长阈值时,控制所述马达停止振动。In one embodiment, the motor control module is further configured to play the target audio when a call request is received, and perform the step of controlling the motor to vibrate at the target vibration frequency when the target audio is played; Count the duration of playing the target audio; when the duration reaches a duration threshold, control the motor to stop vibrating.

在一个实施例中,上述马达控制模块还用于在播放目标音频时,检测目标音频的声音强度;基于目标音频的声音强度确定马达的目标振动强度;马达的目标振动强度与目标音频的声音强度成负相关;控制马达采用目标振动频率以及目标振动强度进行振动。In one embodiment, the above-mentioned motor control module is also used to detect the sound intensity of the target audio when playing the target audio; determine the target vibration intensity of the motor based on the sound intensity of the target audio; the target vibration intensity of the motor and the sound intensity of the target audio into a negative correlation; the control motor vibrates with the target vibration frequency and target vibration intensity.

上述音频变速装置中各个模块的划分仅仅用于举例说明,在其他实施例中,可将音频变速装置按照需要划分为不同的模块,以完成上述音频变速装置的全部或部分功能。The division of each module in the above-mentioned audio speed changer is only for illustration. In other embodiments, the audio speed changer can be divided into different modules according to needs, so as to complete all or part of the functions of the above-mentioned audio speed changer.

关于音频变速装置的具体限定可以参见上文中对于音频变速方法的限定,在此不再赘述。上述音频变速装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For the specific limitations of the audio speed change device, please refer to the above-mentioned definition of the audio speed change method, which will not be repeated here. Each module in the above-mentioned audio transmission device can be fully or partially realized by software, hardware and combinations thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, and can also be stored in the memory of the computer device in the form of software, so that the processor can invoke and execute the corresponding operations of the above-mentioned modules.

图6为一个实施例中电子设备的内部结构示意图。如图6所示,该电子设备包括通过系统总线连接的处理器和存储器。其中,该处理器用于提供计算和控制能力,支撑整个电子设备的运行。存储器可包括非易失性存储介质及内存储器。非易失性存储介质存储有操作系统和计算机程序。该计算机程序可被处理器所执行,以用于实现以下各个实施例所提供的一种音频变速方法。内存储器为非易失性存储介质中的操作系统计算机程序提供高速缓存的运行环境。该电子设备可以是手机、平板电脑、PDA(Personal Digital Assistant,个人数字助理)、POS(Point of Sales,销售终端)、车载电脑、穿戴式设备等任意终端设备。Fig. 6 is a schematic diagram of the internal structure of an electronic device in one embodiment. As shown in FIG. 6, the electronic device includes a processor and a memory connected through a system bus. Among them, the processor is used to provide computing and control capabilities to support the operation of the entire electronic device. The memory may include non-volatile storage media and internal memory. Nonvolatile storage media store operating systems and computer programs. The computer program can be executed by a processor, so as to implement an audio speed changing method provided in the following embodiments. The internal memory provides a high-speed running environment for the operating system computer program in the non-volatile storage medium. The electronic device can be any terminal device such as mobile phone, tablet computer, PDA (Personal Digital Assistant, personal digital assistant), POS (Point of Sales, sales terminal), vehicle-mounted computer, wearable device, etc.

本申请实施例中提供的音频变速装置中的各个模块的实现可为计算机程序的形式。该计算机程序可在终端或服务器上运行。该计算机程序构成的程序模块可存储在电子设备的存储器上。该计算机程序被处理器执行时,实现本申请实施例中所描述方法的步骤。The implementation of each module in the audio speed change device provided in the embodiment of the present application may be in the form of a computer program. The computer program can run on a terminal or a server. The program modules constituted by the computer program can be stored in the memory of the electronic device. When the computer program is executed by the processor, the steps of the methods described in the embodiments of the present application are realized.

本申请实施例还提供了一种计算机可读存储介质。一个或多个包含计算机可执行指令的非易失性计算机可读存储介质,当所述计算机可执行指令被一个或多个处理器执行时,使得所述处理器执行音频变速方法的步骤。The embodiment of the present application also provides a computer-readable storage medium. One or more non-transitory computer-readable storage media containing computer-executable instructions that, when executed by one or more processors, cause the processors to perform the steps of the audio shifting method.

一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行音频变速方法。A computer program product comprising instructions which, when run on a computer, cause the computer to perform the audio speed shifting method.

本申请所使用的对存储器、存储、数据库或其它介质的任何引用可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM),它用作外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDR SDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)。Any reference to memory, storage, database, or other medium as used herein may include non-volatile and/or volatile memory. Nonvolatile memory can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM), which acts as external cache memory. By way of illustration and not limitation, RAM is available in many forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only express several implementation modes of the present application, and the description thereof is relatively specific and detailed, but should not be construed as limiting the patent scope of the present application. It should be noted that those skilled in the art can make several modifications and improvements without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the scope of protection of the patent application should be based on the appended claims.

Claims (10)

1. An audio shifting method, comprising:
acquiring original audio;
performing beat detection on the original audio to obtain an original beat frequency of the original audio; the original beat frequency is the number of beats per minute of the original audio;
acquiring a beat frequency range and acquiring a target beat frequency; audio corresponding to beat frequencies in the beat frequency range is fidelity when played;
determining a speed doubling range of the original audio based on the beat frequency range and the original beat frequency;
determining a target tempo of the original audio within the tempo range based on the original tempo frequency and the target tempo frequency;
adjusting the original audio by adopting the target speed to obtain target audio;
determining a target vibration frequency of the motor based on the target beat frequency;
detecting the sound intensity of the target audio when the target audio is played;
determining a target vibration intensity of the motor based on the sound intensity of the target audio; the target vibration intensity of the motor is inversely related to the sound intensity of the target audio;
and controlling the motor to vibrate with the target vibration frequency and the target vibration intensity.
2. The method of claim 1, wherein the beat frequency range includes respective beat frequencies between an upper limit beat frequency and a lower limit beat frequency;
the determining the multiple speed range of the original audio based on the beat frequency range and the original beat frequency comprises:
dividing the upper limit beat frequency by the original beat frequency to obtain an upper limit multiplier;
dividing the lower limit beat frequency by the original beat frequency to obtain a lower limit multiplier;
a range of multiplier speeds for the original audio is generated based on the upper multiplier speed and the lower multiplier speed.
3. The method of claim 1, wherein the determining a target tempo for the original audio within the tempo range based on the original tempo frequency and the target tempo frequency comprises:
dividing the target beat frequency by the original beat frequency to obtain a reference multiplier;
matching the reference double speed with the double speed range to obtain a matching result;
a target speed multiplier for the original audio is determined from the range of speeds based on the matching result.
4. A method according to claim 3, wherein the multiple speed range includes respective multiple speeds between an upper limit multiple speed and a lower limit multiple speed;
the determining a target speed of the original audio from the speed range based on the matching result includes:
when the reference double speed is in the double speed range, taking the reference double speed as a target double speed of the original audio;
when the reference double speed is greater than the upper limit double speed of the double speed range, taking the upper limit double speed as a target double speed of the original audio;
when the reference doubling speed is smaller than the lower limit doubling speed of the doubling speed range, the lower limit doubling speed is used as a target doubling speed of the original audio.
5. The method according to any one of claims 1 to 4, further comprising:
and acquiring a playing instruction of the target audio, and playing the target audio according to the playing instruction.
6. The method according to claim 1, wherein the method further comprises:
when a call request is received, playing the target audio, and executing a step of controlling the motor to vibrate by adopting the target vibration frequency and the target vibration intensity when playing the target audio;
counting the time length of playing the target audio;
and when the duration reaches a duration threshold, controlling the motor to stop vibrating.
7. An audio transmission, comprising:
the original audio acquisition module is used for acquiring original audio;
the beat detection module is used for detecting the beat of the original audio to obtain the original beat frequency of the original audio; the original beat frequency is the number of beats per minute of the original audio;
the target beat frequency acquisition module is used for acquiring a beat frequency range and a target beat frequency; audio corresponding to beat frequencies in the beat frequency range is fidelity when played;
the double-speed range determining module is used for determining the double-speed range of the original audio based on the beat frequency range and the original beat frequency;
a target tempo determination module for determining a target tempo of the original audio within the tempo range based on the original tempo frequency and the target tempo frequency;
the target audio playing module is used for adjusting the original audio by adopting the target speed to obtain target audio;
a motor control module for determining a target vibration frequency of the motor based on the target beat frequency; detecting the sound intensity of the target audio when the target audio is played; determining a target vibration intensity of the motor based on the sound intensity of the target audio; the target vibration intensity of the motor is inversely related to the sound intensity of the target audio; and controlling the motor to vibrate with the target vibration frequency and the target vibration intensity.
8. The apparatus of claim 7, wherein the beat frequency range comprises respective beat frequencies between an upper bound beat frequency and a lower bound beat frequency; the speed range determining module is further used for dividing the upper limit beat frequency by the original beat frequency to obtain an upper limit speed; dividing the lower limit beat frequency by the original beat frequency to obtain a lower limit multiplier; a range of multiplier speeds for the original audio is generated based on the upper multiplier speed and the lower multiplier speed.
9. An electronic device comprising a memory and a processor, the memory having stored therein a computer program which, when executed by the processor, causes the processor to perform the steps of the audio shifting method of any of claims 1-6.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method according to any one of claims 1 to 6.
CN202010373241.6A 2020-05-06 2020-05-06 Audio frequency speed changing method, device, electronic equipment and computer readable storage medium Expired - Fee Related CN111627412B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010373241.6A CN111627412B (en) 2020-05-06 2020-05-06 Audio frequency speed changing method, device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010373241.6A CN111627412B (en) 2020-05-06 2020-05-06 Audio frequency speed changing method, device, electronic equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN111627412A CN111627412A (en) 2020-09-04
CN111627412B true CN111627412B (en) 2023-05-05

Family

ID=72260041

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010373241.6A Expired - Fee Related CN111627412B (en) 2020-05-06 2020-05-06 Audio frequency speed changing method, device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN111627412B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114639375B (en) * 2022-05-09 2022-08-23 杭州海康威视数字技术股份有限公司 Intelligent voice recognition security defense method and device based on audio slice adjustment

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001184066A (en) * 1999-10-14 2001-07-06 Sony Computer Entertainment Inc Entertainment system, entertainment device, recording medium and program
CN101399035A (en) * 2007-09-27 2009-04-01 三星电子株式会社 Method and equipment for extracting beat from audio file
CN102024481A (en) * 2009-09-14 2011-04-20 展讯通信(上海)有限公司 Method and device for extracting vibration information from audio file and vibrating device
CN105118517A (en) * 2015-06-29 2015-12-02 努比亚技术有限公司 Device and method for adjusting music rhythm
CN105611038A (en) * 2015-07-31 2016-05-25 宇龙计算机通信科技(深圳)有限公司 Audio resource playing method, audio resource playing system and terminal
CN107464572A (en) * 2017-08-16 2017-12-12 重庆科技学院 Multimodal interaction Music perception system and its control method
CN108735194A (en) * 2018-03-27 2018-11-02 维沃移动通信有限公司 Prompt method and device for tempo
CN108777747A (en) * 2018-08-09 2018-11-09 瑞声科技(新加坡)有限公司 A kind of method for oscillating, mobile terminal and computer readable storage medium
CN109887528A (en) * 2019-02-15 2019-06-14 上海艾为电子技术股份有限公司 Motor is with the method and device of audio frequency vibration, storage medium and electronic equipment
CN110010151A (en) * 2018-12-31 2019-07-12 瑞声科技(新加坡)有限公司 A kind of acoustic signal processing method and equipment, storage medium
CN110198385A (en) * 2019-05-28 2019-09-03 Oppo广东移动通信有限公司 A kind of vibration frequency adjusting method, device, storage medium and electronic equipment

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000099097A (en) * 1998-09-24 2000-04-07 Sony Corp Signal reproducing device and method, voice signal reproducing device, and speed conversion method for voice signal
US8032360B2 (en) * 2004-05-13 2011-10-04 Broadcom Corporation System and method for high-quality variable speed playback of audio-visual media
JP2006302345A (en) * 2005-04-15 2006-11-02 Sony Corp Data processing device, data reproducing device, data processing method, and program
JP5058198B2 (en) * 2009-03-27 2012-10-24 株式会社デンソーアイティーラボラトリ Audio data reproducing apparatus and audio data reproducing method
US8657766B2 (en) * 2011-01-10 2014-02-25 Cleve R. Tuck Vibrator apparatus with audio and motor control features
CN105208426B (en) * 2015-09-24 2018-07-06 福州瑞芯微电子股份有限公司 A kind of method and system of audio-visual synchronization speed change
CN107731243B (en) * 2016-08-12 2020-08-07 电信科学技术研究院 Voice real-time variable-speed playing method and device

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001184066A (en) * 1999-10-14 2001-07-06 Sony Computer Entertainment Inc Entertainment system, entertainment device, recording medium and program
CN101399035A (en) * 2007-09-27 2009-04-01 三星电子株式会社 Method and equipment for extracting beat from audio file
CN102024481A (en) * 2009-09-14 2011-04-20 展讯通信(上海)有限公司 Method and device for extracting vibration information from audio file and vibrating device
CN105118517A (en) * 2015-06-29 2015-12-02 努比亚技术有限公司 Device and method for adjusting music rhythm
CN105611038A (en) * 2015-07-31 2016-05-25 宇龙计算机通信科技(深圳)有限公司 Audio resource playing method, audio resource playing system and terminal
CN107464572A (en) * 2017-08-16 2017-12-12 重庆科技学院 Multimodal interaction Music perception system and its control method
CN108735194A (en) * 2018-03-27 2018-11-02 维沃移动通信有限公司 Prompt method and device for tempo
CN108777747A (en) * 2018-08-09 2018-11-09 瑞声科技(新加坡)有限公司 A kind of method for oscillating, mobile terminal and computer readable storage medium
CN110010151A (en) * 2018-12-31 2019-07-12 瑞声科技(新加坡)有限公司 A kind of acoustic signal processing method and equipment, storage medium
CN109887528A (en) * 2019-02-15 2019-06-14 上海艾为电子技术股份有限公司 Motor is with the method and device of audio frequency vibration, storage medium and electronic equipment
CN110198385A (en) * 2019-05-28 2019-09-03 Oppo广东移动通信有限公司 A kind of vibration frequency adjusting method, device, storage medium and electronic equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
雷涛玮.基于音乐要素驱动的振动触觉研究及应用.《中国优秀硕士学位论文全文数据库(基础科学辑)》.2022,全文. *

Also Published As

Publication number Publication date
CN111627412A (en) 2020-09-04

Similar Documents

Publication Publication Date Title
US9947338B1 (en) Echo latency estimation
TWI582759B (en) Jitter buffer control, audio decoder, method and computer program
US10180981B2 (en) Synchronous audio playback method, apparatus and system
US11682412B2 (en) Information processing method, electronic equipment, and storage medium
US10461712B1 (en) Automatic volume leveling
US20180166073A1 (en) Speech Recognition Without Interrupting The Playback Audio
CN110491419B (en) A playback control method, system and terminal device
US9773510B1 (en) Correcting clock drift via embedded sine waves
KR20210024408A (en) Audio processing method, device and storage medium
CN108763901A (en) Ear print information acquisition method and device, terminal, earphone and readable storage medium
KR100806155B1 (en) Method and system to enable audio speed conversion
US9053710B1 (en) Audio content presentation using a presentation profile in a content header
CN111627412B (en) Audio frequency speed changing method, device, electronic equipment and computer readable storage medium
CN108597527B (en) Multi-channel audio processing method, device, computer-readable storage medium and terminal
CN115620735A (en) Audio processing method, device, electronic device and storage medium
CN107799138B (en) Audio recording method and device
WO2019200996A1 (en) Multi-voice channel audio processing method and device, and computer readable storage medium
CN112216302B (en) Audio signal processing method, device, electronic device and readable storage medium
CN113782050B (en) Sound tone changing method, electronic equipment and storage medium
CN110164481A (en) A kind of song recordings method, apparatus, equipment and storage medium
CN112802453B (en) Fast adaptive prediction voice fitting method, system, terminal and storage medium
CN112133269B (en) Audio processing method, device, equipment and medium
JP2024041104A (en) Performance data transmission control method, program, electronic equipment, and electronic musical instrument
CN114341854B (en) Method and device for identifying media
JPWO2011027437A1 (en) Audio playback apparatus and audio playback method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20230505