Skip to content
← Back to Community
How to add sound
Profile icon
h
has Hacker Plan
RiZeFrostbite

When I try to go to sites that use sound it does not work. Why and how do you fix it?

Voters
Profile icon
itswlu21
Profile icon
RiZeFrostbite
Comments
hotnewtop
Profile icon
JuanMata6

it dosent work when i open it

Profile icon
mshaallaatyby

100

Profile icon
mshaallaatyby

1000

Profile icon
[deleted]
const audio = require('@replit/audio'); (async () => { const source = await audio.playFile({filePath: './audio.wav'}); let volume = 1; let loops = 0; console.log('type "up" or "down" to change volume'); console.log('type "loop" increase loops'); console.log('press enter to play/pause'); while(true) { console.log( 'volume is at', volume*100, 'with', await source.getRemainingLoops(), 'loops remaining' ); const input = prompt(''); if (input === 'up') { volume += .25 await source.setVolume(volume); } else if (input === 'down') { volume -= .25 await source.setVolume(volume); } else if (input === 'loop') { loops++; await source.setLoop(loops) } else { await source.togglePlaying(); } } })();
Profile icon
Coder100
Profile icon
RiZeFrostbite
Profile icon
[deleted]

@Coder100
image

Profile icon
[deleted]

@Coder100 xD sorry