Josh
Thank you , very much !!!
I have another question about HiFi module. I write the code as following, but I can't hear the sound, I don't know why it doesn't work.
sf = 192000; % Use max supported sampling rate
H.SamplingRate = sf;
GoSound = GenerateSineWave(sf, S.GUI.SinWaveFreqGo, S.GUI.SoundDuration)*.9;
H.HeadphoneAmpEnabled = true; H.HeadphoneAmpGain = 10; % Ignored if using HD version of the HiFi module
H.DigitalAttenuation_dB = 0; % Set a negative value here if necessary for digital volume control.
H.load(1, GoSound);
envelope = 1/(sf*0.001):1/(sf*0.001):1;
H.AMenvelope = envelope;
sma = AddState(sma,'Name','SessionStart', ...
'Timer', 5,...
'StateChangeConditions', {'Tup','SoundStimulus'},...
'OutputActions', {'HiFi1','*'});
sma = AddState(sma,'Name','SoundStimulus', ...
'Timer', S.GUI.SoundDuration,...
'StateChangeConditions', {'Tup','LickDelay'},...
'OutputActions', {'HiFi1', ['P' 0], 'BNCState', 1});