Hello Sherwin,
Using the Bpod HiFi module, you'd create an instance of the BpodHiFi class:
H = BpodHiFi('COM3'); % Create an instance of BpodHiFi, connecting to the HiFi Module on COM3
Set the sampling rate:
H.SamplingRate = 96000; % Set the sampling rate to 96kHz
Then, write code to generate or load your waveform. The format is an array of samples in range [-1, 1]
myWaveform = GenerateSineWave(96000, 1000, 1); % Generate a 1-second waveform (could be any)
Next, load it to the device and play it:
H.load(2, myWaveform); % Load myWaveform to the HiFi module at position 2
H.push; % Add all newly loaded waveforms to the current sound set
H.play(2); % Play waveform 2
Please let me know if this works for you.
Thanks,
-Josh