Create the noise sound

An example showing how to create the noise sound using Tizen 2.3.
var context = new webkitAudioContext();

// Create buffer with two channels
var buffer = context.createBuffer(2, 44100, 44100);

var data = buffer.getChannelData(0);
for (i = 0; i < data.length; i++) {
    data[i] = (Math.random() - 0.5) * 2; // Noise
}

var source = context.createBufferSource();
source.loop = true; // Make sure that sound will repeat over and over again
source.buffer = buffer; // Assign our buffer to the source node buffer
 
// Connect to the destination and play
source.connect(context.destination);
source.noteOn(0);

Responses

0 Replies