Home:ALL Converter>Web Audio API MediaElementSource node and SoundCloud not working with effects?

Web Audio API MediaElementSource node and SoundCloud not working with effects?

Ask Time:2013-08-14T01:19:39         Author:zya

Json Formatter

I am using a SoundCloud URL as audio.src . It is only playing the unprocessed version when i run it through the delay chain i have. Here is the fiddle: http://jsfiddle.net/ehsanziya/nwaH3/

    var context = new webkitAudioContext();
    var audio = new Audio(); //creates a HTML5 Audio Element

    url = 'http://api.soundcloud.com/tracks/33925813/stream' + '?client_id=c625af85886c1a833e8fe3d740af753c';
    //wraps the soundcloud stream to an audio element.
    audio.src = url;

    var source = context.createMediaElementSource(audio);
    var input = context.createGainNode();
    var output = context.createGainNode();
    var fb = context.createGainNode();
    fb.gain.value = 0.4;

    var delay = context.createDelayNode();
    delay.delayTime.value = 0.5;


    //dry
    source.connect(input);
    input.connect(output);

    //wet
    input.connect(delay);
    delay.connect(fb);
    fb.connect(delay);
    delay.connect(output);

   source.mediaElement.play();

The chain works with Oscillator node. What is the reason for it?

And is there any other way of processing a streaming sound from SoundCloud with Web Audio API?

Author:zya,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/18215349/web-audio-api-mediaelementsource-node-and-soundcloud-not-working-with-effects
yy