I work with p5.sound.js. You must save the .wav file to the server, or simply output the recorded audio signal through the audio tag. Instead, the file is simply downloaded via the browser.
var mic, recorder, soundFile; var state = 0; // mousePress will increment from Record, to Stop, to Play var mic, recorder, soundFile; var state = 0; // mousePress will increment from Record, to Stop, to Play function setup() { createCanvas(400,400); background(200); fill(0); text('Enable mic and click the mouse to begin recording', 20, 20); mic = new p5.AudioIn(); mic.start(); recorder = new p5.SoundRecorder(); recorder.setInput(mic); soundFile = new p5.SoundFile(); } function mousePressed() { if (state === 0 && mic.enabled) { recorder.record(soundFile); background(255,0,0); text('Recording now! Click to stop.', 20, 20); state++; } else if (state === 1) { recorder.stop(); // stop recorder, and send the result to soundFile background(0,255,0); text('Recording stopped. Click to play & save', 20, 20); state++; } else if (state === 2) { soundFile.play(); // play the result! saveSound(soundFile, 'mySound.wav'); // save file state++; } }