Computing desk | ||
---|---|---|
< December 2 | << Nov | December | Jan >> | December 4 > |
Welcome to the Wikipedia Computing Reference Desk Archives |
---|
The page you are currently viewing is a transcluded archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages. |
How can I change the distance units with which the Uber app shows how far away my driver is? Mine used to be kilometres, here in Kyiv, but now they are in miles. I think this changed when I visited Canada and did not revert when I returned to Ukraine, but that might not be accurate.
(A year ago I asked why Uber drivers don't seem to see where I am, even when the app shows me the accurate blue dot. That question is still unresolved.)
Hayttom ( talk) 07:17, 3 December 2021 (UTC)
Hello wonderful Wikipedians! So I've been playing around with audio visualization in Javascript. I have code that looks like this.
let audioElement = document.getElementById('source');
let audioCtx = new AudioContext();
let analyser = audioCtx.createAnalyser();
analyser.fftSize = 2048;
let source = audioCtx.createMediaElementSource(audioElement);
source.connect(analyser);
source.connect(audioCtx.destination);
var data = new Uint8Array(analyser.frequencyBinCount);
Then I can run
analyser.getByteFrequencyData(data);
Which, while the audio is playing, will populate the variable "data" with an array representing frequency data of the audio for the current "frame", so to speak. What I want to be able to do is create an array of such data for every "frame". Or, alternatively, to select data arbitrarily based on timestamp. (In milliseconds, say.)
Currently I can do something like this:
let final_data=[];
let captureFunction=function() {
analyser.getByteFrequencyData(data);
final_data.push([...data]);
}
if(!audio_ended) {
window.requestAnimationFrame(captureFunction);
}
};
window.requestAnimationFrame(captureFunction);
This works reasonably well, but I can't technically guarantee the frequency or reliability of requestAnimationFrame firing. How might I accomplish what I'm trying to do? TheRiseOfSkittlez ( talk) 12:22, 3 December 2021 (UTC)
Computing desk | ||
---|---|---|
< December 2 | << Nov | December | Jan >> | December 4 > |
Welcome to the Wikipedia Computing Reference Desk Archives |
---|
The page you are currently viewing is a transcluded archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages. |
How can I change the distance units with which the Uber app shows how far away my driver is? Mine used to be kilometres, here in Kyiv, but now they are in miles. I think this changed when I visited Canada and did not revert when I returned to Ukraine, but that might not be accurate.
(A year ago I asked why Uber drivers don't seem to see where I am, even when the app shows me the accurate blue dot. That question is still unresolved.)
Hayttom ( talk) 07:17, 3 December 2021 (UTC)
Hello wonderful Wikipedians! So I've been playing around with audio visualization in Javascript. I have code that looks like this.
let audioElement = document.getElementById('source');
let audioCtx = new AudioContext();
let analyser = audioCtx.createAnalyser();
analyser.fftSize = 2048;
let source = audioCtx.createMediaElementSource(audioElement);
source.connect(analyser);
source.connect(audioCtx.destination);
var data = new Uint8Array(analyser.frequencyBinCount);
Then I can run
analyser.getByteFrequencyData(data);
Which, while the audio is playing, will populate the variable "data" with an array representing frequency data of the audio for the current "frame", so to speak. What I want to be able to do is create an array of such data for every "frame". Or, alternatively, to select data arbitrarily based on timestamp. (In milliseconds, say.)
Currently I can do something like this:
let final_data=[];
let captureFunction=function() {
analyser.getByteFrequencyData(data);
final_data.push([...data]);
}
if(!audio_ended) {
window.requestAnimationFrame(captureFunction);
}
};
window.requestAnimationFrame(captureFunction);
This works reasonably well, but I can't technically guarantee the frequency or reliability of requestAnimationFrame firing. How might I accomplish what I'm trying to do? TheRiseOfSkittlez ( talk) 12:22, 3 December 2021 (UTC)