資源簡介
java對音頻文件的頻譜分析,很好的東西 !

代碼片段和文件信息
/*
?*?Light?Development?Spectrum?Analyzer?Component
?*?Copyright?(C)?2003-2005?Ulrich?Hilger
?*
?*?This?program?is?free?software;?you?can?redistribute?it?and/or
?*?modify?it?under?the?terms?of?the?GNU?General?Public?License
?*?as?published?by?the?Free?Software?Foundation;?either?version?2
?*?of?the?License?or?(at?your?option)?any?later?version.
?*
?*?This?program?is?distributed?in?the?hope?that?it?will?be?useful
?*?but?WITHOUT?ANY?WARRANTY;?without?even?the?implied?warranty?of
?*?MERCHANTABILITY?or?FITNESS?FOR?A?PARTICULAR?PURPOSE.??See?the
?*?GNU?General?Public?License?for?more?details.
?*
?*?You?should?have?received?a?copy?of?the?GNU?General?Public?License
?*?along?with?this?program;?if?not?write?to?the?Free?Software
?*?Foundation?Inc.?59?Temple?Place?-?Suite?330?Boston?MA??02111-1307?USA.
?*/
package?com.lightdev.lib.audio.ui;
import?java.awt.Graphics2D;
import?java.awt.Color;
import?java.awt.image.BufferedImage;
/**
?*?a?user?interface?component?to?show?an?amplitude?value
?*
?*?@author?Ulrich?Hilger
?*?@author?Light?Development
?*?@author?http://www.lightdev.com
?*?@author?info@lightdev.com
?*?@author?published?under?the?terms?and?conditions?of?the
?*??????GNU?General?Public?License
?*??????for?details?see?file?license.txt?in?the?distribution
?*??????package?of?this?software
?*
?*?@version?1?January?20?2005
?*/
public?class?LevelMeter?{
??/**
???*?constructor
???*?@param?bi?BufferedImage??the?offscreen?image?to?use?for?painting
???*?@param?index?int??index?inside?a?group?of?level?meters
???*?@param?width?int??width?of?this?level?meter
???*?@param?height?int??height?of?this?level?meter
???*?@param?min?int??minimum?value?to?display?by?this?level?meter
???*?@param?max?int??maximum?value?to?display?by?this?level?meter
???*/
??public?LevelMeter(BufferedImage?bi?int?index?int?width?int?height?int?min
????????????????????int?max)?{
????this.bi?=?bi;
????this.index?=?index;
????setSize(width?height);
????this.min?=?min;
????this.max?=?max;
????sideMargin?=?barGap?/?2;
??}
??/**
???*?set?the?size?of?this?component
???*?@param?width?int??the?width
???*?@param?height?int??the?height
???*/
??public?void?setSize(int?width?int?height)?{
????if(width?>?0?&&?height?>?0)?{
??????this.outerWidth?=?width;
??????this.meterHeight?=?height;
??????meterWidth?=?outerWidth?-?barGap;
????}
??}
??/**
???*?repaint?this?component
???*?@param?value?double??the?decibel?value?to?display
???*/
??private?void?repaintMeter(double?value)?{
????if(value?>?min?&&?value???????double?oldValue?=?meterValue;
??????if?(oldValue?!=?value)?{
????????//paintValue?=?oldValue;
????????meterValue?=?value;
????????if(bi?!=?null)?{
??????????Graphics2D?g2?=?bi.createGraphics();
??????????if?(oldValue?????????????increaseMeter(g2?value);
??????????}
??????????else?{
????????????re
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????5428??2005-01-21?22:02??ldsa.jar
?????目錄???????????0??2005-01-22?09:47??doc\api\
?????文件?????????908??2005-01-22?09:46??doc\api\allclasses-fr
?????文件?????????868??2005-01-22?09:46??doc\api\allclasses-nofr
?????目錄???????????0??2005-01-22?09:47??doc\api\com\
?????目錄???????????0??2005-01-22?09:47??doc\api\com\lightdev\
?????目錄???????????0??2005-01-22?09:47??doc\api\com\lightdev\lib\
?????目錄???????????0??2005-01-22?09:47??doc\api\com\lightdev\lib\audio\
?????目錄???????????0??2005-01-22?09:47??doc\api\com\lightdev\lib\audio\ui\
?????文件???????16084??2005-01-22?09:46??doc\api\com\lightdev\lib\audio\ui\LevelMeter.html
?????文件????????1113??2005-01-22?09:46??doc\api\com\lightdev\lib\audio\ui\package-fr
?????文件????????6931??2005-01-22?09:46??doc\api\com\lightdev\lib\audio\ui\package-summary.html
?????文件????????6910??2005-01-22?09:46??doc\api\com\lightdev\lib\audio\ui\package-tree.html
?????文件???????66671??2005-01-22?09:46??doc\api\com\lightdev\lib\audio\ui\SpectrumAnalyzer.html
?????文件????????4979??2005-01-22?09:46??doc\api\constant-values.html
?????文件????????4915??2005-01-22?09:46??doc\api\deprecated-list.html
?????文件????????8802??2005-01-22?09:46??doc\api\help-doc.html
?????文件????????1274??2005-01-22?09:46??doc\api\index.html
?????文件???????11373??2005-01-22?09:46??doc\api\index-all.html
?????文件????????6669??2005-01-22?09:46??doc\api\overview-tree.html
?????文件??????????27??2005-01-22?09:46??doc\api\package-list
?????目錄???????????0??2005-01-22?09:47??doc\api\resources\
?????文件??????????57??2005-01-22?09:46??doc\api\resources\inherit.gif
?????文件????????8383??2005-01-22?09:46??doc\api\serialized-form.html
?????文件????????1231??2005-01-22?09:46??doc\api\st
?????目錄???????????0??2005-01-21?17:02??src\com\
?????目錄???????????0??2005-01-21?17:02??src\com\lightdev\
?????目錄???????????0??2005-01-21?17:02??src\com\lightdev\lib\
?????目錄???????????0??2005-01-21?17:02??src\com\lightdev\lib\audio\
?????目錄???????????0??2005-01-21?17:02??src\com\lightdev\lib\audio\ui\
?????文件????????6411??2005-01-20?16:46??src\com\lightdev\lib\audio\ui\LevelMeter.java
............此處省略6個文件信息
- 上一篇:java圖形化界面實現的個人通訊錄管理系統
- 下一篇:JSP期末考試試卷及參考答案
評論
共有 條評論