在Flash中實現Winamp均衡器頻譜效果

來源:互聯網
上載者:User
  首先看這個,音樂隨便找了一個,不是很好聽的


[全屏欣賞]

  這個的製作需要擷取音訊波譜,把音訊波譜轉化為資料,這個東東需要一個軟體叫FLASHAMP這個軟體很小,而且不需要安裝,直接使用,等會兒把這個軟體放在下面,送給愛好者(它的使用非常簡單,順便也說說它的使用方法)

  得到音樂的資料後,把這些資料作為數組中的元素,然後通過建立函數來調用,同時把這些值賦給MC的y座標的縮放。

  具體地說:

  一、用FlashAmp擷取音頻資料

  二、開啟flash,開始製作

  1、做作4個mc元件,上面的4個圖形,注意只畫4個就是了,上面的mc的運動是AS命令的
  2、做一個空的MC,用來寫語句,其實也可以不做,寫在楨上也可
  3、將4個MC分別拖到情境,命案例名分別為a1 a2 a3 a4
  4、將空mc拖到情境,命案例名為cont

  三、開始寫AS

  1、在楨上初始設定變數_root.cont.i = 0;
  2、把以下語句寫在cont 這個MC上

onClipEvent (load) {
shuju = new Array(25, 29, 35, 39, 38, 36, 36, 36, 34, 33, 35, 36, 36, 36, 36, 35, 35, 34, 33, 34, 36, 36, 34, 32, 30, 29, 30, 32, 31, 30, 29, 30, 32, 33, 31, 29, 28, 30, 32, 31, 30, 33, 39, 42, 44, 40, 31, 27, 30, 35, 37, 35, 35, 35, 34, 33, 33, 34, 36, 39, 39, 37, 37, 39, 40, 42, 47, 52, 63, 67, 61, 58, 56, 66, 71, 66, 66, 61, 54, 53, 59, 58, 65, 70, 56, 58, 62, 57, 53, 54, 65, 63, 71, 78, 71, 71, 67, 60, 57, 65, 65, 65, 80, 75, 64, 62, 66, 71, 62, 58, 54, 62, 74, 69, 67, 64, 57, 55, 53, 54, 54, 67, 73, 57, 58, 63, 61, 55, 56, 67, 66, 71, 77, 70, 64, 58, 58, 60, 63, 62, 66, 71, 62, 61, 62, 63, 64, 58, 55, 54, 66, 70, 63, 69, 68, 61, 64, 71, 69, 57, 65, 68, 61, 65, 63, 56, 52, 64, 71, 65, 76, 77, 67, 67, 65, 64, 62, 65, 65, 67, 70, 60, 59, 60, 61, 62, 56, 49, 46, 61, 71, 69, 69, 60, 55, 53, 56, 56, 61, 72, 64, 61, 63, 58, 55, 51, 55, 58, 67, 70, 60, 66, 69, 73, 72, 64, 63, 56, 65, 80, 83, 78, 76, 84, 81, 61, 46, 47, 63, 70, 65, 61, 58, 58, 54, 53, 60, 60, 64, 59, 62, 70, 69, 60, 40, 40, 45, 55, 67, 54, 53, 55, 46, 43, 38, 46, 51, 59, 66, 58, 57, 56, 64, 80, 89, 86, 76, 80, 87, 77, 68, 67, 67, 66, 64, 59, 58, 70, 69, 68, 76, 70, 61, 52, 56, 67, 74, 69, 48, 51, 59, 52, 47, 40, 45, 41, 51, 65, 53, 42, 42, 63, 81, 84, 88, 90, 93, 93, 79, 65, 54, 49, 60, 70, 66, 71, 82, 76, 69, 64, 63, 61, 50, 55, 67, 75, 72, 55, 52, 56, 62, 70, 73, 65, 57, 72, 73, 58, 61, 69, 72, 65, 55, 56, 63, 78, 76, 61, 53, 45, 42, 44, 50, 49, 58, 63, 40, 43, 54, 48, 39, 38, 51, 53, 61, 60, 55, 58, 48, 45, 43, 45, 45, 53, 75, 69, 60, 65, 58, 65, 75, 69, 58, 66, 86, 84, 83, 80, 65, 57, 52, 55, 61, 67, 71, 56, 56, 64, 62, 58, 51, 60, 68, 73, 69, 55, 57, 56, 48, 43, 46, 47, 62, 87, 74, 59, 62, 59, 64, 61, 55, 49, 57, 83, 77, 72, 76, 66, 61, 54, 65, 73, 69, 62, 42, 45, 59, 58, 48, 56, 73, 70, 70, 63, 56, 57, 47, 43, 39, 47, 50, 57, 76, 68, 56, 46, 54, 79, 78, 64, 53, 63, 78, 71, 67, 65, 61, 62, 60, 62, 68, 77, 72, 64, 67, 62, 56, 49, 55, 63, 60, 68, 62, 56, 68, 64, 58, 62, 74, 78, 80, 83, 72, 66, 61, 65, 77, 67, 57, 56, 69, 81, 74, 72, 70, 68, 69, 78, 83, 79, 84, 70, 48, 50, 54, 56, 54, 52, 53, 64, 72, 58, 58, 61, 66, 80, 80, 70, 59, 64, 74, 74, 67, 56, 63, 75, 74, 65, 51, 60, 73, 64, 64, 62, 58, 59, 60, 66, 59, 64, 70, 73, 77, 67, 62, 55, 58, 61, 69, 86, 70, 56, 53, 43, 39, 36, 50, 57, 65, 73, 53, 47, 51, 58, 69, 67, 60, 46, 55, 76, 70, 68, 61, 54, 61, 58, 57, 61, 69, 65, 60, 68, 64, 58, 49, 54, 63, 67, 80, 70, 60, 58, 46, 45, 43, 46, 47, 58, 75, 62, 48, 39, 46, 63, 62, 56, 44, 56, 82, 86, 79, 60, 56, 66, 66, 64, 59, 69, 74, 71, 71, 64, 61, 53, 62, 76, 82, 79, 60, 49, 49, 52, 61, 62, 60, 62, 71, 77, 65, 60, 59, 67, 73, 64, 56, 54, 68, 76, 77, 78, 72, 68, 63, 65, 66, 73, 78, 55, 49, 56, 65, 85, 73, 60, 55, 63, 81, 69, 41, 20, 18, 24, 27, 22, 14, 16, 24, 31, 41, 45, 61, 79, 76, 62, 50, 65, 84, 81, 74, 63, 62, 62, 58, 61, 61, 72, 65, 56, 68, 69, 60, 51, 55, 56, 66, 74, 55, 51, 56, 49, 46, 44, 51, 52, 58, 63, 47, 45, 48, 62, 83, 83, 74, 53, 58, 76, 70, 61, 50, 55, 63, 73, 80, 83, 81, 56, 51, 63, 61, 52, 43, 56, 71, 73, 67, 46, 46, 52, 48, 46, 47, 52, 42, 51, 64, 53, 51, 46, 51, 63, 63, 56, 59, 78, 76, 72, 74, 57, 57, 65, 65, 69, 80, 80, 54, 50, 64, 64, 61, 59, 71, 68, 69, 70, 67, 80, 79, 74, 72, 72, 66, 54, 65, 78, 69, 58, 52, 63, 63, 50, 49, 61, 79, 78, 78, 80, 71, 69, 68, 77, 80, 77, 76, 57, 48, 51, 66, 70, 59, 59, 54, 54, 45, 53, 70, 60, 70, 75, 62, 59, 70, 80, 86, 93, 95, 81, 66, 61, 57, 48, 40, 51, 50, 45, 50, 59, 64, 63, 63, 67, 73, 68, 56, 58, 66, 65, 65, 65, 65, 53, 34, 21, 12, 7, 5, 4, 3, 2, 2, 2, 2, 2, 12, 22, 47, 81, 88, 84, 81, 81, 78, 71, 70, 74, 81, 82, 71, 72, 83, 89, 76, 61, 68, 75, 81, 81, 72, 69, 68, 73, 76, 69, 68, 72, 77, 77, 76, 84, 91, 85, 69, 61, 62, 71, 84, 86, 82, 66, 66, 81, 79, 72, 70, 76, 86, 88, 86, 83, 82, 78, 74, 83, 91, 89, 88, 89, 87, 71, 64, 63, 54, 54, 61, 69, 69, 63, 61, 62, 73, 72, 68, 69, 61, 71, 82, 76, 80, 89, 84, 73, 79, 85, 86, 89, 79, 70, 73, 79, 80, 74, 77, 76, 79, 88, 81, 70, 70, 82, 82, 74, 74, 79, 89, 91, 92, 95, 96, 95, 92, 88, 89, 91, 89, 93, 89, 74, 75, 86, 78, 73, 75, 78, 84, 79, 77, 78, 85, 83, 71, 72, 79, 83, 86, 86, 88, 78, 66, 63, 61, 60, 57, 65, 66, 64, 70, 70, 74, 70, 61, 60, 67, 77, 77, 76, 77, 82, 79, 69, 78, 84, 85, 82, 74, 76, 80, 84, 81, 71, 75, 73, 74, 80, 75, 72, 65, 73, 81, 77, 84, 88, 88, 82, 79, 90, 94, 87, 73, 67, 64, 74, 89, 93, 90, 75, 75, 91, 82, 68, 63, 68, 80, 78, 68, 63, 73, 81, 71, 74, 87, 92, 93, 93, 91, 75, 69, 67, 54, 52, 68, 81, 71, 65, 63, 73, 78, 65, 67, 71, 78, 86, 74, 66, 69, 80, 85, 76, 75, 75, 81, 86, 74, 63, 57, 67, 71, 68, 70, 68, 79, 90, 88, 82, 74, 69, 63, 72, 91, 95, 93, 86, 81, 77, 80, 92, 91, 68, 41, 40, 65, 74, 65, 62, 67, 77, 75, 68, 62, 57, 58, 55, 51, 51, 66, 69, 60, 60, 58, 54, 49, 63, 75, 72, 80, 73, 65, 66, 66, 77, 82, 80, 79, 78, 72, 61, 68, 83, 89, 87, 88, 93, 91, 92, 97, 96, 86, 72, 61, 54, 56, 58, 70, 87, 76, 63, 62, 60, 56, 52, 60, 62, 70, 76, 64, 71, 77, 79, 88, 87, 80, 74, 79, 77, 67, 68, 77, 89, 93, 94, 92, 84, 87, 92, 93, 90, 74, 62, 59, 59, 58, 70, 80, 66, 61, 66, 59, 51, 53, 59, 60, 68, 72, 69, 74, 71, 76, 86, 79, 67, 63, 73, 72, 59, 58, 73, 88, 94, 91, 88, 90, 93, 94, 92, 86, 70, 59, 56, 57, 57, 69, 76, 63, 58, 58, 65, 78, 80, 83, 79, 75, 71, 62, 63, 60, 69, 72, 76, 81, 82, 90, 85, 87, 92, 91, 82, 68, 63, 59, 58, 72, 77, 73, 67, 60, 61, 58, 56, 55, 68, 88, 77, 64, 64, 60, 54, 48, 55, 57, 66, 77, 64, 65, 69, 59, 57, 60, 68, 65, 70, 80, 72, 64, 55, 61, 68, 62, 58, 69, 85, 74, 65, 67, 62, 57, 52, 55, 57, 69, 76, 63, 59, 63, 59, 54, 53, 63, 64, 68, 68, 67, 71, 60, 54, 55, 69, 73, 74, 89, 83, 65, 67, 79, 81, 77, 73, 64, 57, 70, 78, 72, 65, 57, 57, 57, 56, 56, 65, 69, 55, 52, 53, 47, 42, 41, 44, 47, 53, 53, 48, 48, 44, 40, 37, 40, 39, 39, 50, 47, 40, 37, 34, 31, 28, 27, 27, 32, 34, 28, 26, 26, 21, 17, 19, 22, 21, 22, 21, 16, 14, 13, 13, 11, 10, 11, 11, 12, 10, 8, 7, 5, 4, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
function go() {
_root.a1._yscale = sndnow;
_root.a2._yscale = sndnow;
_root.a3._yscale = sndnow;
_root.a4._yscale = sndnow;
i++;
}
}
onClipEvent (enterFrame) {
sndnow = 100+shuju[i]*4;
go();
}

  那麼多的資料是什嗎?就是用flashAmp擷取的該音樂的資料,由於只說一下這個方法,所以懶得解釋AS了,下面上傳軟體和介紹使用方法。

  開啟此軟體,如此圖


  點擊問號出現下圖


  選擇一個你需要的音效檔,單擊開啟,進入下圖


  又與第一個圖相同,多次單擊方向,圈著的,進入下圖


  在紅圈著處輸入你的FLASH的楨頻,注意一定要一樣,你的楨12,它也應當12,它的預設值是15,單擊方向進入下圖

  多次單擊進入這個圖


  點紅線圈著的開始讀取資料,這裡需要等待一下,然後進入最後一個圖



  這時表示已經讀取完資料,需要你儲存了,儲存的結果是一個記事本,開啟記事本,就會看到很多的資料,於是把這些資料做為數組中的元素就可以了

   點擊下載源檔案

相關文章

Beyond APAC's No.1 Cloud

19.6% IaaS Market Share in Asia Pacific - Gartner IT Service report, 2018

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。