Adobe Air & Adobe Flex & ActionScript & RIA & User Experience
flash.media.sound 在Flash Player version 10 及更高版本中,可以處理動態生成的聲音。這種情況下,Sound 對象將使用向 flash.events.SampleDataEvent 事件處理函數分配的函數來輪詢聲音數據。從用聲音數據填充的 ByteArray 對象檢索聲音的同時播放聲音。可以使用 Sound.extract() 從 Sound 對像中提取聲音數據,然後在將聲音數據寫回到流以進行播放之前可以對其進行操作。
因此按照例子寫了2種不同版本的改變聲音速度的例子,2個例子區別在于
SampleDataEvent 處理方式得不同。
一個是改變了音速(帶有“piapia”聲)
改變了音速(帶有“piapia”聲)的SampleDataEvent 處理方式
/** * mp3Real.SampleDataEvent.SAMPLE_DATA **/ private function onSampleData(e:SampleDataEvent):void { currentPosition = uint(_position); var currentTimeIntDiff_1:uint = uint(_position) / 44100; currentTime = toDoubleString(uint(currentTimeIntDiff_1 / 60)) + ":" + toDoubleString(currentTimeIntDiff_1 % 60); var bytes:ByteArray = new ByteArray(); mp3Proxy.extract(bytes, 4096, _position); bytes.position = 0; e.data.writeBytes(bytes); if(!isThumbPress) hs_time.value = _position / maxPosition; bytesSpeed = playbackSpeed * BYTES_PER_CALLBACK; _position += bytesSpeed; }
改變了音頻(像以前的磁帶)的SampleDataEvent 處理方式
/** * mp3Real.SampleDataEvent.SAMPLE_DATA **/ private function onSampleData(e:SampleDataEvent):void { var l:Number; var r:Number; var p:uint; var loadedSamples:ByteArray = new ByteArray(); currentPosition = uint(_phase); bytesSpeed = playbackSpeed * BYTES_PER_CALLBACK; var currentTimeIntDiff_2:uint = currentPosition / 44100; currentTime = toDoubleString(uint(currentTimeIntDiff_2 / 60)) + ":" + toDoubleString(currentTimeIntDiff_2 % 60); if (_isPlayingSound && currentTime == maxTime) { _isPlayingSound = false; } if(!isThumbPress) hs_time.value = _phase / maxPosition; mp3Proxy.extract(loadedSamples, BYTES_PER_CALLBACK * playbackSpeed, currentPosition); loadedSamples.position = 0; while (loadedSamples.bytesAvailable > 0) { p = uint(_phase - currentPosition) * 8; if (p < loadedSamples.length - 8 && e.data.length <= BYTES_PER_CALLBACK * 8) { loadedSamples.position = p; l = loadedSamples.readFloat(); r = loadedSamples.readFloat(); e.data.writeFloat(l); e.data.writeFloat(r); } else { loadedSamples.position = loadedSamples.length; } _phase += playbackSpeed; } }
不知道各位有沒有既能改變速度又不會調高音頻的辦法,請賜教。
在 Barcelona 的 Mobile World Congress 上,Adobe 聲明了 Adobe Air 將會支持 Android 的動作,對我來說并不是新聞,我在Mobile Application的未來中就已經提到了幾點,其實當時就已經收到了風聲。
不過 Adobe Air 還有很多事情需要去做,畢竟Mobile的性能和PC的性能是無法比的,在 Developer 做好優化的同時,Adobe 自己還有一大部分工作要做。
AIR on Android 的視頻例子:http://www.adobe.com/go/airmobile
GeekCook是最近發現的Taobao店,與其它廠商不同,他們采用了所謂的營銷2.0模式
當然,最讓我喜歡的是他設計的網絡衍生品,Twitter, Gmail,甚至404等,比起其它的賣家,他們不僅有Tee,也有衛衣,棒球帽,圍巾等。
而且我發現老板是一個非常會玩網絡的人,看看他們的聯系方式就知道。
Steve Jobs在Apple內部大會上抨擊Adobe太懶惰,有潛力去做有意義的事情卻沒有那樣去做,將來沒人會用flash,大家都改用HTML5了。
我個人很認同Steve Jobs關于Adobe太懶惰的觀點,至于Flash最終會被HTML5代替,這要看是什么領域啦,Chrome和Firefox已經開始支持HTML5了,已經走出了非常重要的一步,人們老是說HTML5還需要10年的努力,但比起Flash來,HTML5是趨勢,這是不爭的事實。
純屬個人想法,Adobe Fans不要噴我!
開發者Tobias Schneider在JavaScript中編寫了一個Flash解釋程式,名叫Gordon的開來源程式允許在支援SVG/HTML5的流覽器——iPhone內置了SVG支援——上播放Flash。 儘管程式開發還只是處於初始階段,但顯示它很有希望。開發者已在網站了公佈了一些演示。目前支持的流覽器包括:Chrome 3.0.195.38(能正常運行Demo),Chrome 4.0.298.0 Linux(會在滑鼠移動時出現崩潰),基於Web-Kit的Epiphany,Firefox 3.6,Safari 4;Demo無法在Opera 10.10和10.50上工作,未測試IE流覽器(因為不支援SVG)。
–來源于solidot.org
Flash is coming to the iPhone, but it’s no thanks to Adobe or Apple. It’s thanks to Gordon.
These are demos of Gordon – An open source Flash™ runtime written in pure JavaScript with SVG