SPAS 3.0 VSound Project

What is the VSound API?
The VSound project is an Open Source API that has been designed to reduce the CPU usage when the Flash Player performs compute spectrum operations.
Moreover, one of the purposes of the VSound project is to provide a very tiny API to let Flash developers include their own AS3 sound spectrum experiments and be easy-to-use.
The VSound API is a very light-weight set of classes that can be used independently of the SPAS 3.0 API, with both Flash and Flex environments.
This project is shared under GNU-GPL3 License. For more information about the GNU GPL License, see: GPLv3.
Experiment the VSound API
The following sample application loads a MP3 file and creates a new VSoundSequencer instance. Click the scene to start or stop the effect rendering.
(Song: Popular, performed by NADA SURF.)
Download the VSound API
Current version: Version: 1.1, 06/12/10
Download
VSound API on-line documentation
Last update: 01/12/10.
Project logos
The project logos will be available soon are available at the Press Section of the SPAS 3.0 Website.
VSound quick start
Using VSound with Flash
The following code shows how to add a VSound object to the display list and start a sound spectrum rendering, from the Flash IDE main timeline:
import org.flashapi.vsound.*; var vsound:VSound = new VSound(); this.addChild(vsound); vsound.play();
According to the preceding one, the code below shows the minimal implementation to render a sound spectrum effect from a loaded sound:
import org.flashapi.vsound.*;
var sound:Sound = new Sound();
var file:URLRequest = new URLRequest("mySong.mp3");
sound.load(file);
sound.play();
var vsound:VSound = new VSound();
this.addChild(vsound);
vsound.play();
The process to use a VSoundSequencer object is virtually the same:
import org.flashapi.vsound.*; var sequencer:VSoundSequencer = new VSoundSequencer(); this.addChild(sequencer); sequencer.play();
Using VSound with Flex
The following mxml applications shows the basics on how to use a VSound objects with Flex or FlashBuilder:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:vsound="org.flashapi.vsound.*"
creationComplete="completeHandler();">
<vsound:VSound id="vs"/>
<mx:UIComponent id="spriteWrapper" initialize="spriteWrapper.addChild(vs)" />
<mx:Script>
<![CDATA[
import flash.media.SoundChannel;
import mx.core.SoundAsset;
[Embed(source="mySong.mp3")]
public var soundCls:Class;
private function completeHandler():void {
var mySound:SoundAsset = new soundCls() as SoundAsset;
var sndChannel:SoundChannel = mySound.play();
vs.play();
}
]]>
</mx:Script>
</mx:Application>
Extending the API
You can participate in the project by extending the effect library or improving the core API.
To participate, please contact us by using the form on the SPAS 3.0 contact section.
Change History
The following list reflects changes made to the VSound Project distribution:
-
Version: 1.1, 07/12/2010
Addition of theSequencerEventclass. -
Version: 1.0, 02/12/2010
Addition of 2 newSpectrumRendererlibraries. -
Version: 1.0, 01/12/2010
Initial version.
Share this article:
Comments:
There are no comments yet for this article.

![Validate my RSS feed [Valid RSS]](http://validator.w3.org/feed/images/valid-rss-rogers.png)