CN109634701A - A method of it is shown based on audio frequency of mobile terminal - Google Patents

A method of it is shown based on audio frequency of mobile terminal Download PDF

Info

Publication number
CN109634701A
CN109634701A CN201811426776.4A CN201811426776A CN109634701A CN 109634701 A CN109634701 A CN 109634701A CN 201811426776 A CN201811426776 A CN 201811426776A CN 109634701 A CN109634701 A CN 109634701A
Authority
CN
China
Prior art keywords
audio
data
animation
rectangle
color
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201811426776.4A
Other languages
Chinese (zh)
Inventor
赵立奎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Wanpeng Education Technology Co Ltd
Original Assignee
Zhejiang Wanpeng Education 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 Zhejiang Wanpeng Education Technology Co Ltd filed Critical Zhejiang Wanpeng Education Technology Co Ltd
Priority to CN201811426776.4A priority Critical patent/CN109634701A/en
Publication of CN109634701A publication Critical patent/CN109634701A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Processing Or Creating Images (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention discloses a kind of methods shown based on audio frequency of mobile terminal.The present invention include the following steps: Step 1: call android audio frame provide base class AudioEffect derived class Visualizer, monitor and obtain the volume change data in current system data;Step 2: drawing animation by corresponding algorithm according to the audio display effect of desired realization, and provide the interface for receiving dynamic changing data;Step 3: the volume change data got in step 1 to be passed to the interface provided in step 2, carry out real-time rendering audio animation effect.The present invention passes through the Wave data of sampling system currently playing music, carry out real-time rendering animation, the dynamic melody of current music is shown by different color blocks, to user with visual grand banquet, the innervation and pleasant sensation of user's music are brought by the square of bounce, promote user experience.

Description

A method of it is shown based on audio frequency of mobile terminal
Technical field
The invention belongs to mobile terminal MultiMedia Fields, more particularly to by the dynamic data of device plays volume of music come real When draw audio animation display effect.
Background technique
With the rapid development of scientific information technology, multimedia technology has also been deep into huge numbers of families, people's lives Huge change has occurred, has also pushed the development of society.Incident mobile terminal is also almost that manpower has to the greatest extent, and movement is set Standby increase has brought people's great convenience, and people is also allowed to become increasingly conspicuous the demand of mobile terminal multimedia technology.At present Various softwares emerge one after another in the market, and many softwares all have the function of audio broadcasting, and people are very easily using While these functions, it has been not only to only require to hear sound that the effect requirements played to audio are also higher and higher, It prefers to it can be seen that the dynamic variation tendency of entire audio.For by traditional music, result of broadcast cannot Meet the user experience of people, so the audio based on mobile terminal now is played there is also the status that it is still necessary to improve, Invent a volume change data for present terminal system and what the Dynamically Announce effect that plays to audio was handled A kind of method, the more intuitive variation effect for reflecting entire audio in playing process in animated way, more intuitively The dynamic melody for showing current music, brings the better visual effect of user, promotes the visual experience of user.
Summary of the invention
The purpose of the present invention is, there is also the status that it is still necessary to improve, provide one for existing audio result of broadcast The processing method of the animation effect of the more intuitive reflection current volume amplitude variation of kind.Central principle is that current system is playing When audio, corresponding current fluctuation can be generated, the data that the system sound volume by monitoring and obtaining present terminal changes, foundation is thought The audio Dynamically Announce effect to be realized, writes the algorithm of a series of complex to draw out actual audio animation, reaching can The control of animation is carried out according to the actual conditions that audio plays, while providing a dynamic again and receiving the variation of current system audio The interface of data, to draw corresponding audio animation in real time.
The specific steps of the method for the present invention are as follows:
Step 1: android audio frame is called to provide the derived class Visualizer of base class AudioEffect, monitor And obtain the volume change data in current system data.
Data source can generate corresponding current fluctuation when system is playing audio in system, and system bottom will be electric Stream fluctuation is converted into byte (byte) data.
Firstly, it is necessary to register corresponding permission: " android.permission.MODIFY_AUDIO_ in android SETTINGS ",
Secondly, obtaining Visualizer example in the activity for needing to show audio animation;
Then, corresponding sampled value setCaptureSize, monitor setDataCaptureListener are set, set When setting monitor, need to select the interface of return parameters, the waveform sampling returned using onWaveFormDataCapture Byte arrays;
Finally, starting to sample setEnabled (true).
Step 2: drawing animation by corresponding algorithm, and provide reception according to the audio display effect of desired realization The interface of dynamic changing data.
Step 2 needs to be accomplished that a dynamic grid spectrogram, it is therefore desirable to the VIEW of a customized animation, The relevant parameter of paintbrush Paint and painting canvas canvas are determined first, the parameter of paintbrush Paint includes: thickness, color and style, Wherein brush color is made of 8 kinds of colors, and color sorts from top to bottom from shallow to deep;Thickness and style are specified one Kind;Painting canvas canvas relevant parameter includes long and wide.
Specific according to incoming volume change data dynamic select gradation of color: the longitudinal axis is for showing square Quantity, top-down color successively arrange from shallow to deep;
According to square columns fixed in the length of incoming volume change data, X direction, incoming volume change The content of data, calculates the square quantity on each column longitudinal axis, then using the fixed blocks quantity in the X direction of setting as Recurring number, circulation draw the square quantity on the longitudinal axis.
The square quantity calculating specifically calculated on each column longitudinal axis is accomplished by
Audio result of broadcast is indicated according to audio waveform data using the rectangle of color gradient, if the wave sequence obtained is S{w1,w2,……wp, wherein p indicates the number of data in sequence S, if the maximum value of element is Max in sequence S, Max is big In 0 natural number;Minimum value is-Max, if indicating that the rectangle of audio result of broadcast figure this moment is matrix Amn, wherein m and n are Natural number, m indicate that the maximum number of lines of setting, n indicate the maximum number of column of setting, rectangle aijFor matrix AmnElement, wherein i, j It is natural number, 0≤i < m, 0≤j < n, if the graduated colors sequence used is C { c0,c1,……,cq}
If rectangle aijThe rectangle number of column is Countj, then CountjFollowing calculation can be used to obtain
Work as wxWhen > 0, Countj=┌ m/2+ (Max-wx) * m/Max ┐ wherein x=┌ p/n*j ┐;
Work as wxWhen≤0, Countj=┌ m/2+ (- Max-wx) * m/Max ┐ wherein x=┌ p/n*j ┐;
So rectangle aijColor Vcolour obtained using following calculation
Work as m-i > Countj, Vcolour=0
As 0≤Countj- m+i < q, Vcolour=CCount-m+i
Work as Countj- m+i >=q, Vcolour=Cq
Wherein 0 expression color is consistent with background colour can not have to draw, using above-mentioned when changing wave sequence S Calculation calculating matrix AmnThe color of each rectangle, right in the rectangle number and each column rectangular set that middle each column should actually be drawn Rectangle AmnAgain it draws, can dynamically show audio result of broadcast figure.
Step 3: the volume change data got in step 1 to be passed to the interface provided in step 2, draw in real time Audio animation effect processed.
Step 3 needs to show the XML file of frequency spectrum animation, quotes customized animation VIEW in step 2, in XML text Monitoring in Activty belonging to part in setting steps one, and be passed to the volume change data got are monitored in step 1 The interface provided in step 2;Then music is played, the generation of continuous volume change data is had and incoming step 2 provides Interface, the display effect of the dynamic data real-time rendering audio animation by volume can be realized.
The present invention has the beneficial effect that:
The main object of the present invention is to show the fluctuation of current device music VF being played in animated way, is given User more intuitively shows the dynamic melody of current music, brings better visual effect, user experience to user.
This have the advantage that: by the Wave data of sampling system currently playing music, carry out real-time rendering animation, The dynamic melody of current music is shown by different color blocks, to user with visual grand banquet, passes through the square of bounce The innervation and pleasant sensation of user's music are brought, user experience is promoted.
Specific embodiment
The present invention is illustrated below with reference to embodiment.
When central principle of the present invention is that current system is playing audio, corresponding current fluctuation can be generated, passes through monitoring And the data for obtaining the system sound volume variation of present terminal are write a series of according to the audio Dynamically Announce effect for wanting to realize Complicated algorithm draws out actual audio animation, and the actual conditions that reaching can play according to audio carry out the control of animation System, while the interface that a dynamic receives current system audio delta data is provided again, to draw corresponding audio in real time Animation.
The specific steps of the method for the present invention are as follows:
Step 1: android audio frame is called to provide the derived class Visualizer of base class AudioEffect, monitor And obtain the volume change data in current system data.
Data source can generate corresponding current fluctuation when system is playing audio in system, and system bottom will be electric Stream fluctuation is converted into byte (byte) data.
Firstly, it is necessary to register corresponding permission: " android.permission.MODIFY_AUDIO_ in android SETTINGS ",
Secondly, obtaining Visualizer example in the activity for needing to show audio animation;
Then, corresponding sampled value setCaptureSize, monitor setDataCaptureListener are set, set When setting monitor, need to select the interface of return parameters, the waveform sampling returned using onWaveFormDataCapture Byte arrays;
Finally, starting to sample setEnabled (true).
Step 2: drawing animation by corresponding algorithm, and provide reception according to the audio display effect of desired realization The interface of dynamic changing data.
Step 2 needs to be accomplished that a dynamic grid spectrogram, it is therefore desirable to the VIEW of a customized animation, The relevant parameter of paintbrush Paint and painting canvas canvas are determined first, the parameter of paintbrush Paint includes: thickness, color and style, Wherein brush color is made of 8 kinds of colors, and color sorts from top to bottom from shallow to deep;Thickness and style are specified one Kind;Painting canvas canvas relevant parameter includes long and wide.
Specific according to incoming volume change data dynamic select gradation of color: the longitudinal axis is for showing square Quantity, top-down color successively arrange from shallow to deep;
According to square columns fixed in the length of incoming volume change data, X direction, incoming volume change The content of data, calculates the square quantity on each column longitudinal axis, then using the fixed blocks quantity in the X direction of setting as Recurring number, circulation draw the square quantity on the longitudinal axis.
The square quantity calculating specifically calculated on each column longitudinal axis is accomplished by
Audio result of broadcast is indicated according to audio waveform data using the rectangle of color gradient, if the wave sequence obtained is S{w1,w2,……wp, wherein p indicates the number of data in sequence S, if the maximum value of element is Max in sequence S, Max is big In 0 natural number;Minimum value is-Max, if indicating that the rectangle of audio result of broadcast figure this moment is matrix Amn, wherein m and n are Natural number, m indicate that the maximum number of lines of setting, n indicate the maximum number of column of setting, rectangle aijFor matrix AmnElement, wherein i, j It is natural number, 0≤i < m, 0≤j < n, if the graduated colors sequence used is C { c0,c1,……,cq}
If rectangle aijThe rectangle number of column is Countj, then CountjFollowing calculation can be used to obtain
Work as wxWhen > 0, Countj=┌ m/2+ (Max-wx) * m/Max ┐ wherein x=┌ p/n*j ┐;
Work as wxWhen≤0, Countj=┌ m/2+ (- Max-wx) * m/Max ┐ wherein x=┌ p/n*j ┐;
So rectangle aijColor Vcolour obtained using following calculation
Work as m-i > Countj, Vcolour=0
As 0≤Countj- m+i < q, Vcolour=CCount-m+i
Work as Countj- m+i >=q, Vcolour=Cq
Wherein 0 expression color is consistent with background colour can not have to draw, using above-mentioned when changing wave sequence S Calculation calculating matrix AmnThe color of each rectangle, right in the rectangle number and each column rectangular set that middle each column should actually be drawn Rectangle AmnAgain it draws, can dynamically show audio result of broadcast figure.
Step 3: the volume change data got in step 1 to be passed to the interface provided in step 2, draw in real time Audio animation effect processed.
Step 3 needs to show the XML file of frequency spectrum animation, quotes customized animation VIEW in step 2, in XML text Monitoring in Activty belonging to part in setting steps one, and be passed to the volume change data got are monitored in step 1 The interface provided in step 2;Then music is played, the generation of continuous volume change data is had and incoming step 2 provides Interface, the display effect of the dynamic data real-time rendering audio animation by volume can be realized.

Claims (4)

1. a kind of method shown based on audio frequency of mobile terminal, it is characterised in that include the following steps:
Step 1: android audio frame is called to provide the derived class Visualizer of base class AudioEffect, monitors and obtain Take the volume change data in current system data;
Step 2: drawing animation by corresponding algorithm according to the audio display effect of desired realization, and provide reception dynamic The interface of delta data;
Step 3: the volume change data got in step 1 to be passed to the interface provided in step 2, carry out real-time rendering sound Frequency animation effect;
Step 1 is implemented as follows:
Data source can generate corresponding current fluctuation when system is playing audio in system, and system bottom is by current wave Turn changes byte (byte) data into;
Firstly, it is necessary to register corresponding permission: " android.permission.MODIFY_AUDIO_ in android SETTINGS ",
Secondly, obtaining Visualizer example in the activity for needing to show audio animation;
Then, corresponding sampled value setCaptureSize, monitor setDataCaptureListener are set, supervised in setting When listening device, need to select the interface of return parameters, using the word of the onWaveFormDataCapture waveform sampling returned Joint number group;
Finally, starting to sample setEnabled (true).
2. a kind of method shown based on audio frequency of mobile terminal according to claim 1, it is characterised in that step 2 is specific It is accomplished by
Step 2 needs to be accomplished that a dynamic grid spectrogram, it is therefore desirable to the VIEW of a customized animation, first Determining the relevant parameter of paintbrush Paint and painting canvas canvas, the parameter of paintbrush Paint includes: thickness, color and style, wherein Brush color is made of 8 kinds of colors, and color sorts from top to bottom from shallow to deep;Thickness and style are specified one kind;It draws Cloth canvas relevant parameter includes long and wide;
It is specific according to incoming volume change data dynamic select gradation of color: the longitudinal axis for showing square quantity, Top-down color successively arranges from shallow to deep;
According to square columns fixed in the length of incoming volume change data, X direction, incoming volume change data Content, calculate the square quantity on each column longitudinal axis, then using the fixed blocks quantity in the X direction of setting as circulation Number, circulation draw the square quantity on each column longitudinal axis.
3. a kind of method shown based on audio frequency of mobile terminal according to claim 2, it is characterised in that specific each column Square quantity calculating on the longitudinal axis is accomplished by
Audio result of broadcast is indicated according to audio waveform data using the rectangle of color gradient, if the wave sequence obtained is S { w1, w2,……wp, wherein p indicates the number of data in sequence S, if the maximum value of element is Max in sequence S, Max is greater than 0 Natural number;Minimum value is-Max, if indicating that the rectangle of audio result of broadcast figure this moment is matrix Amn, wherein m and n is nature Number, m indicate that the maximum number of lines of setting, n indicate the maximum number of column of setting, rectangle aijFor matrix AmnElement, wherein i, j are Natural number, 0≤i < m, 0≤j < n, if the graduated colors sequence used is C { c0,c1,……,cq}
If rectangle aijThe rectangle number of column is Countj, then CountjFollowing calculation can be used to obtain
Work as wxWhen > 0, Countj=┌ m/2+ (Max-wx) * m/Max ┐ wherein x=┌ p/n*j ┐;
Work as wxWhen≤0, Countj=┌ m/2+ (- Max-wx) * m/Max ┐ wherein x=┌ p/n*j ┐;
So rectangle aijColor Vcolour obtained using following calculation
Work as m-i > Countj, Vcolour=0
As 0≤Countj- m+i < q, Vcolour=CCount-m+i
Work as Countj- m+i >=q, Vcolour=Cq
Wherein 0 expression color is consistent with background colour can not have to draw, and above-mentioned calculating is used when changing wave sequence S Mode calculating matrix AmnThe color of each rectangle in the rectangle number and each column rectangular set that middle each column should actually be drawn, to rectangle AmnAgain it draws, can dynamically show audio result of broadcast figure.
4. a kind of method shown based on audio frequency of mobile terminal according to claim 3, it is characterised in that step 3 is specific It is accomplished by
Step 3 needs to show the XML file of frequency spectrum animation, customized animation VIEW in step 2 is quoted, in XML file institute Monitoring in the Activty of category in setting steps one, and step is passed to by the volume change data got are monitored in step 1 The interface provided in two;Then music is played, the generation of continuous volume change data is had and what incoming step 2 provided connects Mouthful, the display effect of the dynamic data real-time rendering audio animation by volume can be realized.
CN201811426776.4A 2018-11-27 2018-11-27 A method of it is shown based on audio frequency of mobile terminal Pending CN109634701A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811426776.4A CN109634701A (en) 2018-11-27 2018-11-27 A method of it is shown based on audio frequency of mobile terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811426776.4A CN109634701A (en) 2018-11-27 2018-11-27 A method of it is shown based on audio frequency of mobile terminal

Publications (1)

Publication Number Publication Date
CN109634701A true CN109634701A (en) 2019-04-16

Family

ID=66069301

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811426776.4A Pending CN109634701A (en) 2018-11-27 2018-11-27 A method of it is shown based on audio frequency of mobile terminal

Country Status (1)

Country Link
CN (1) CN109634701A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110704016A (en) * 2019-10-15 2020-01-17 深圳品阔信息技术有限公司 Method, device and equipment for displaying volume adjustment in combination with volume fluctuation and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103117063A (en) * 2012-12-27 2013-05-22 安徽科大讯飞信息科技股份有限公司 Music content cut-frame detection method based on software implementation
CN104599681A (en) * 2014-12-31 2015-05-06 广州酷狗计算机科技有限公司 Method and device for processing audio file
CN107220047A (en) * 2017-05-19 2017-09-29 北京酷我科技有限公司 A kind of cardon of audible spectrum shows progress bar control implementation method
CN107221021A (en) * 2017-05-19 2017-09-29 北京酷我科技有限公司 A kind of rendering algorithm of audible spectrum animation
CN107894885A (en) * 2017-11-17 2018-04-10 北京酷我科技有限公司 A kind of square frequency spectrum generation method of audio

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103117063A (en) * 2012-12-27 2013-05-22 安徽科大讯飞信息科技股份有限公司 Music content cut-frame detection method based on software implementation
CN104599681A (en) * 2014-12-31 2015-05-06 广州酷狗计算机科技有限公司 Method and device for processing audio file
CN107220047A (en) * 2017-05-19 2017-09-29 北京酷我科技有限公司 A kind of cardon of audible spectrum shows progress bar control implementation method
CN107221021A (en) * 2017-05-19 2017-09-29 北京酷我科技有限公司 A kind of rendering algorithm of audible spectrum animation
CN107894885A (en) * 2017-11-17 2018-04-10 北京酷我科技有限公司 A kind of square frequency spectrum generation method of audio

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
AIYH0202: ""音频频谱图(自定义View——进阶篇2)"", 《HTTPS://BLOG.CSDN.NET/AIYH0202/ARTICLE/DETAILS/52848305》 *
KYLIN_MOUNTAIN: ""Android 音乐频谱实现"", 《HTTPS://BLOG.CSDN.NET/CARYEE89/ARTICLE/DETAILS/6935237》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110704016A (en) * 2019-10-15 2020-01-17 深圳品阔信息技术有限公司 Method, device and equipment for displaying volume adjustment in combination with volume fluctuation and storage medium

Similar Documents

Publication Publication Date Title
CN109348274B (en) Live broadcast interaction method and device and storage medium
CN107393569A (en) Audio frequency and video clipping method and device
CN100392722C (en) Apparatus for acoustically improving an environment
CN105847939A (en) Bullet screen play method, bullet screen play device and bullet screen play system
CN104123938A (en) Voice control system, electronic device and voice control method
CN106020765B (en) A kind of effect adjusting method and device
CN105824888A (en) Music playing control method and device based on brain waves
CN110599985B (en) Audio content generation method, server device and client device
CN106095384B (en) A kind of effect adjusting method and user terminal
CN102857732B (en) Menu control method, equipment and system in a kind of many pictures video conference
CN105404642B (en) A kind of audio frequency playing method and user terminal
CN106775568A (en) Sound effect adjusting method and device and mobile terminal
CN105554523A (en) Live channel-based information interaction method and server
CN104599702B (en) A kind of method for playing music
CN104038774B (en) Generate the method and device of ring signal file
CN107622101A (en) Play method and device, the electronic equipment of song
CN109634701A (en) A method of it is shown based on audio frequency of mobile terminal
CN103309670A (en) Implementation method and implementation device for skin of music player
CN104317479A (en) Method and device for displaying input interface
CN107562745A (en) A kind of generation method of audio playlist, system and a kind of audio frequency broadcast system
CN107438961A (en) Data are transmitted using audible harmony
CN108628450A (en) A kind of brain wave music method
CN105208439A (en) Audio file playing method and device
CN114546325A (en) Audio processing method, electronic device and readable storage medium
CN106529993A (en) Intelligent advertisement delivery method and device

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
CB02 Change of applicant information

Address after: 12 / F, building 8, No. 19, Jugong Road, Xixing street, Binjiang District, Hangzhou City, Zhejiang Province, 310051

Applicant after: ZHEJIANG WANPENG EDUCATION SCIENCE AND TECHNOLOGY STOCK CO.,LTD.

Address before: Room 1406, Hangzhou e-commerce building, 118 Wensan West Road, Xihu District, Hangzhou City, Zhejiang Province, 310013

Applicant before: ZHEJIANG WANPENG EDUCATION SCIENCE AND TECHNOLOGY STOCK CO.,LTD.

CB02 Change of applicant information
RJ01 Rejection of invention patent application after publication

Application publication date: 20190416

RJ01 Rejection of invention patent application after publication