Convert the psychopy audio stimulus code snippet to psychoJS

I have a psychopy experiment that I need to convert to psychoJS (unfortunately I don’t have the psyexp file for it). In this experiment, there is an audio stimulus that needs to be used.
The audio simulus uses random stimulation frequency between 1 Hz and 15 Hz.

import numpy as np
audio_time = np.arange(0,3,1/48000)
audio_carrier_freq = 200
audio_carrier = np.sin(2np.piaudio_carrier_freq*audio_time)

audio_envelope_freq = np.random.uniform(1,15)
audio_envelope = np.sin(2np.piaudio_time*audio_envelope_freq)
audio_signal = (1+audio_envelope)audio_carrier0.5
audio_sound = sound.Sound(audio_signal,sampleRate=48000)

Here, audio_signal is an array of decimal.
However, I am not able to convert it to the sound class of psychoJS does not have capacity to introduce array . It either requires a number or a string.

How do I handle this scenario.
I am not sure how do I use tone.js and use it as a stimulus.
Any help is appreciated.

I use the sound component to create the sound object rather than code.

You can’t import numpy but you can create sounds using frequencies. Please look at my crib sheet for information about random (and sounds)

I have been able to convert the numpy component using numjs. Where can I find the cribsheet ? Sorry noob here.

Have a look at the pinned post in the online category