bunjilplace2021 / realness

0 stars 0 forks source link

Feature Request: particle system visual cue for audio buffer load. #49

Open wezzahd opened 3 years ago

wezzahd commented 3 years ago

On site, the volume from the outdoor screen is quite loud. It's hard to tell when you record audio on the device whether anything is happening to the sound recording as volume from the phone speakers is drowned out. I wonder if we should include some kind of visual cue when the audio buffer is loaded or changed so users know that the sound snippet they recorded has been activated/processed in the soundtrack. Maybe if the particle that was created during the mouse hold recording event flashes when the associated audio is loaded into the buffer.

Is there an UUID associated with each audio recording? Could we include the UUID of the recorded audio along with the particle data to firebase when the user performs a mouse hold event? I could then animate the particle if the UUID of the loaded buffer audio matches one of the active particles.

burstMembrane commented 3 years ago

Hi Wes, I've made PR #50 expose the user audio UUID to the window variable. Also added a window.customBuffer boolean that changes to true when a custom buffer is loaded.

example code

// IN PIXEL DRAW FUNCTION
if(window.customBuffer)
{
change colour/opacity/visual parameter of  most recent particle in system
}

Or you could track the audio UUID with the pixel data, in which case you could do something like this in your upload routine to firebase. EG in uploadpixel.js around line 141, that way the pixel data woudl be associated with a UUID

var data = {
    uuid: uuid,
    mouseX_loc: mouseX,
    mouseY_loc: mouseY,
    rand: rand_gen,
    colour_loc: colour,
    deviceWidth: width,
    deviceHeight: height,
    touchTime: touchtime,
  };
 window.audioUUID ? (data.audioUUID = window.audioUUID) : null;
wezzahd commented 3 years ago

Good work, thanks for that. Is there any way to get the UUID of the file that is currently playing? Once the sound library is loaded, it then downloads a previously recorded audio file from firebase. Is that right?

Ultimately I want users to be able to make a recording on their phone, and then be able to look at the outdoor screen and see if their file is currently loaded/playing on the big screen.

wezzahd commented 3 years ago

I also noticed that the audioUUID for the first mouse hold event is null. It seems the audioUUID gets associated with the next particle so it's one after.

wezzahd commented 3 years ago

@burstMembrane I've merged into your PR a particle animation using audioUUID. it's a bit rough - i'll keep working on it. At the moment the animations runs for the particles that have an audioUUID/mousehold attached to them. Still getting that weird bug where the audioUUID is null for the first mouse down event.

I also noticed that the audioUUID for the first mouse hold event is null. It seems the audioUUID gets associated with the next particle so it's one after.