RelativPerspektiv
RelativPerspektiv
RReactiflux
Created by RelativPerspektiv on 10/5/2022 in #help-js
✅ – BIOLOGY SCIENCE – 14-32 Oct 5
cool, it works @rubberduckies thanks 🙂
9 replies
RReactiflux
Created by RelativPerspektiv on 10/5/2022 in #help-js
✅ – BIOLOGY SCIENCE – 14-32 Oct 5
lemme try
9 replies
RReactiflux
Created by RelativPerspektiv on 10/5/2022 in #help-js
✅ – BIOLOGY SCIENCE – 14-32 Oct 5
oh ok
9 replies
RReactiflux
Created by RelativPerspektiv on 10/5/2022 in #help-js
✅ – BIOLOGY SCIENCE – 14-32 Oct 5
function start()
{
const audio = new Audio();

const
audioContext = new AudioContext(),
audioAnalyser = new AnalyserNode(audioContext);

audioContext.createMediaElementSource(audio).connect(audioAnalyser); // this line

audio.src = 'E:/Music/Fighter.mp3';

audio.play();
};

start();
function start()
{
const audio = new Audio();

const
audioContext = new AudioContext(),
audioAnalyser = new AnalyserNode(audioContext);

audioContext.createMediaElementSource(audio).connect(audioAnalyser); // this line

audio.src = 'E:/Music/Fighter.mp3';

audio.play();
};

start();
i just have this script inside the head of an html file (no other contents in the html) there is apparently no playback of the audio. but if i remove the marked line, the audio plays. and no errors in the console as well. any idea whats happening ? and a fix (without removing the marked line) ?
9 replies
RReactiflux
Created by RelativPerspektiv on 8/14/2022 in #help-js
BIOLOGY SCIENCE – 03-10 Aug 14
sorry for the late replies, i keep forgeting i asked a question here anyways
Keeping things in JS memory should be cheaper than keeping them in the DOM
i was looking for a answer smth like this
devtools and then make decision based on results
will do thanks 🙂
3 replies
RReactiflux
Created by RelativPerspektiv on 8/13/2022 in #help-js
BIOLOGY SCIENCE – 12-55 Aug 13
@ScriptyChris
6 replies
RReactiflux
Created by RelativPerspektiv on 8/13/2022 in #help-js
BIOLOGY SCIENCE – 12-55 Aug 13
when a user clicks a button, a set of data is represent as html elements, the next time the button is clicked a new set of data is represented (this new data replaces the old set of data in the context of html elements) if the user wishes to look back the previous data is it better to store those html elements in a txt file and insert it to the DOM when the user requests for the previous data or keep the html elements in the DOM itself, but just hide the elements when not in use, and make then appear when the user asks for the previous data
6 replies
RReactiflux
Created by RelativPerspektiv on 8/9/2022 in #help-js
✅ – BIOLOGY SCIENCE – 12-59 Aug 9
ill prolly ask this in the electron server as well
53 replies
RReactiflux
Created by RelativPerspektiv on 8/9/2022 in #help-js
✅ – BIOLOGY SCIENCE – 12-59 Aug 9
okay sure, thanks for your help
53 replies
RReactiflux
Created by RelativPerspektiv on 8/9/2022 in #help-js
✅ – BIOLOGY SCIENCE – 12-59 Aug 9
so does electron ?
53 replies
RReactiflux
Created by RelativPerspektiv on 8/9/2022 in #help-js
✅ – BIOLOGY SCIENCE – 12-59 Aug 9
oh firefox works
53 replies
RReactiflux
Created by RelativPerspektiv on 8/9/2022 in #help-js
✅ – BIOLOGY SCIENCE – 12-59 Aug 9
current code
if (req.url.endsWith('/')) {
const data = fs.readFileSync('index.html');

res.writeHead(200, {'Content-Type' : 'text/html'});

res.write(data);
}

else if (req.url.endsWith('flac')) {
res.writeHead(200, {'Content-Type': 'audio/flac'});
res.write(fs.readFileSync('Shape Of You.flac'))
}

res.end();
if (req.url.endsWith('/')) {
const data = fs.readFileSync('index.html');

res.writeHead(200, {'Content-Type' : 'text/html'});

res.write(data);
}

else if (req.url.endsWith('flac')) {
res.writeHead(200, {'Content-Type': 'audio/flac'});
res.write(fs.readFileSync('Shape Of You.flac'))
}

res.end();
53 replies
RReactiflux
Created by RelativPerspektiv on 8/9/2022 in #help-js
✅ – BIOLOGY SCIENCE – 12-59 Aug 9
still doesn't play
53 replies
RReactiflux
Created by RelativPerspektiv on 8/9/2022 in #help-js
✅ – BIOLOGY SCIENCE – 12-59 Aug 9
PS E:\Code\Common\web> node app.js
3000
req.url: /
req.url: /Shape%20Of%20You.flac
req.url: /favicon.ico
PS E:\Code\Common\web> node app.js
3000
req.url: /
req.url: /Shape%20Of%20You.flac
req.url: /favicon.ico
53 replies
RReactiflux
Created by RelativPerspektiv on 8/9/2022 in #help-js
✅ – BIOLOGY SCIENCE – 12-59 Aug 9
and the error is GET http://localhost:3000/Shape%20Of%20You.flac net::ERR_INVALID_CHUNKED_ENCODING 200 (OK)
53 replies
RReactiflux
Created by RelativPerspektiv on 8/9/2022 in #help-js
✅ – BIOLOGY SCIENCE – 12-59 Aug 9
// if (req.url.endsWith('html')) {
const data = fs.readFileSync('index.html');

res.writeHead(200, {'Content-Type' : 'text/html'});

res.write(data);

if (req.url.endsWith('flac')) {
res.writeHead(200, {'Content-Type': 'audio/flac'});
res.write(fs.readFileSync('Shape Of You.flac'))
}

res.end();
// if (req.url.endsWith('html')) {
const data = fs.readFileSync('index.html');

res.writeHead(200, {'Content-Type' : 'text/html'});

res.write(data);

if (req.url.endsWith('flac')) {
res.writeHead(200, {'Content-Type': 'audio/flac'});
res.write(fs.readFileSync('Shape Of You.flac'))
}

res.end();
53 replies
RReactiflux
Created by RelativPerspektiv on 8/9/2022 in #help-js
✅ – BIOLOGY SCIENCE – 12-59 Aug 9
i have this code rn, it loads atleast
53 replies