You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My audio files have a sampling rate of 16000 Hz, but when I use the jsPsych.pluginAPI.getAudioBuffer() to get the raw audio data, the data are accessed with a sampling rate of 48000 Hz. I want to get the data at the original 16000 Hz sampling rate. How can I do this?
This is the code I used:
currentAudio=jsPsych.timelineVariable('sound');console.log(currentAudio);jsPsych.pluginAPI.getAudioBuffer(currentAudio).then(function(buffer){speechData=buffer.getChannelData(0);mix_speech(speechData);}).catch(function(err){console.error(`Failed to load audio file "${currentAudio}". Try checking the file path. We recommend using the preload plugin to load audio files.`)console.error(err)});```
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
My audio files have a sampling rate of 16000 Hz, but when I use the jsPsych.pluginAPI.getAudioBuffer() to get the raw audio data, the data are accessed with a sampling rate of 48000 Hz. I want to get the data at the original 16000 Hz sampling rate. How can I do this?
This is the code I used:
Beta Was this translation helpful? Give feedback.
All reactions