How to add sound
When I try to go to sites that use sound it does not work. Why and how do you fix it?
Voters
mshaallaatyby
1000
[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(); } } })();
Coder100
use replit audio
https://docs.repl.it/repls/audio
RiZeFrostbite
@Coder100 But it wont support this: https://replit.com/@RiZeFrostbite/Chromeium?embed=1&output=1#main.py
[deleted]
[deleted]
@Coder100 xD sorry
it dosent work when i open it