Joa shared google doc he made for apex vj. There's really nothing much beyond what you see here atm. No paging support, no searching support, nothing. You can only query for additional info about these tracks, such as waveform or album cover. Joa said he will be changing this eventually.
Yeah, and seems their own page works like that, am thinking on making a similar interface to one they have on their page with this. Cool thing to base audio visualization experiments on :)
actually I was thinking that too :) I mean, to make an swf that loads tracks from a number of sources, like beatport/audiotool/soundcloud/hdd/whatever. then you load this swf into Loader, and use computeSpectrum. this way, you could update the code in every and all audioviz codes instantly.
Kind of thinking about such thing since December, kind of two layered system, player interface/skins/various sources to load sound data from in player class + interface that describes visualizers.
It does not work for microphone as far as I can say and ability to use microphone as input has lost of fun possibilities :) Like you can play guitar yourself in fort of the screen :)
Also have you seen how my musical atom and how it works?
I think it is a good idea to abstract source of date from visual analyzer so that if what SoundMixer does will not be enough at later stage. I could also provide more complex data input then just single wave/spectrum input. Like visualizer could ask to get a future data, not current SoundMixer one. Or ask for only some parts of frequencies divided to separate channels.
But I did not dig in to it that deep so far, mostly I want it to do so because Microphone input does not go trough SoundMixer and I want all possible data sources to look the same for visualizers.
Embed
/**
* Copyright makc3d ( http://wonderfl.net/user/makc3d )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/cK39
*/
// forked from makc3d's AudioTool test
// forked from makc3d's BeatPort player
package {
import flash.display.Sprite;
import flash.events.MouseEvent;
/**
* Audiotool Player v2,
* this time API-based.
*/
public class Audiotool extends Sprite {
private var player:AudioToolPlayer
public function Audiotool () {
AudioToolPlayer (player = new AudioToolPlayer).play ();
stage.addEventListener (MouseEvent.CLICK, nextTrack);
}
private function nextTrack (e:MouseEvent):void {
player.next ();
}
}
}
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.media.Sound;
import flash.media.SoundChannel;
import flash.media.SoundLoaderContext;
import flash.net.URLLoader;
import flash.net.URLLoaderDataFormat;
import flash.net.URLRequest;
class AudioToolPlayer {
public function next ():void {
if (channel) {
channel.stop ();
playNextTrack (new Event ("whatever"))
}
}
/**
* Plays audiotool tracks in listing order.
*/
public function play ():void {
loadTracks ();
}
protected function loadTracks ():void {
var loader:URLLoader = new URLLoader;
loader.dataFormat = URLLoaderDataFormat.BINARY;
subscribeLoader (loader, getTracksInPage, onIOFailure1);
loader.load (new URLRequest ("http://api.audiotool.com/documents/relevant"));
}
private function makeUrl (key:String):String {
return "http://api.audiotool.com/play/" + key + "/s3.mp3";
}
private var tracks:Array = [], sound:Sound, channel:SoundChannel;
private var context:SoundLoaderContext = new SoundLoaderContext (10, true);
private function getTracksInPage (e:Event):void {
var loader:URLLoader = URLLoader (e.target);
unsubscribeLoader (loader, getTracksInPage, onIOFailure1);
var result:XML = XML (loader.data);
for each (var key:XML in result.document.publicKey) {
tracks.push (makeUrl (key));
}
playNextTrack ();
}
private function playNextTrack (e:Event = null):void {
if (e != null) {
unsubscribeSoundStuff (); channel = null;
}
var url:String = tracks.pop ();
tracks.unshift (url);
trace ("playing:", url);
channel = Sound (sound = new Sound (
new URLRequest (url), context
)).play ();
subscribeSoundStuff ();
}
private function subscribeLoader (loader:URLLoader, onComplete:Function, onIOFailure:Function):void {
loader.addEventListener (Event.COMPLETE, onComplete);
loader.addEventListener (IOErrorEvent.IO_ERROR, onIOFailure);
}
private function unsubscribeLoader (loader:URLLoader, onComplete:Function, onIOFailure:Function):void {
loader.removeEventListener (Event.COMPLETE, onComplete);
loader.removeEventListener (IOErrorEvent.IO_ERROR, onIOFailure);
}
private function subscribeSoundStuff ():void {
sound.addEventListener (IOErrorEvent.IO_ERROR, onIOFailure3);
channel.addEventListener (Event.SOUND_COMPLETE, playNextTrack);
}
private function unsubscribeSoundStuff ():void {
sound.removeEventListener (IOErrorEvent.IO_ERROR, onIOFailure3);
channel.removeEventListener (Event.SOUND_COMPLETE, playNextTrack);
}
private function onIOFailure1 (e:IOErrorEvent):void {
unsubscribeLoader (URLLoader (e.target), getTracksInPage, onIOFailure1);
play ();
}
private function onIOFailure3 (e:IOErrorEvent):void {
// assumes sound's ioError comes before channel's soundComplete
unsubscribeSoundStuff ();
playNextTrack ();
}
}