Need help for psychopy coder label, s = streams.getStream(sampleRate=self.sampleRate, TypeError: cannot unpack non-iterable NoneType object

when I run my code,it just show me like this error message:
####### Running: C:\Users\asus\OneDrive\桌面\Lab\psychopy\stimuli\test.py ########
pygame 2.1.0 (SDL 2.0.16, Python 3.8.10)
Hello from the pygame community. Contribute - pygame wiki
1.1071 WARNING We strongly recommend you activate the PTB sound engine in PsychoPy prefs as the preferred audio engine. Its timing is vastly superior. Your prefs are currently set to use [‘sounddevice’, ‘PTB’, ‘pyo’, ‘pygame’] (in that order).
Traceback (most recent call last):
File “C:\Users\asus\OneDrive\桌面\Lab\psychopy\stimuli\test.py”, line 33, in
sound_objects = [sound.Sound(value=freq, secs=0.1) for freq in random_freq_values]
File “C:\Users\asus\OneDrive\桌面\Lab\psychopy\stimuli\test.py”, line 33, in
sound_objects = [sound.Sound(value=freq, secs=0.1) for freq in random_freq_values]
File “C:\Users\asus\AppData\Roaming\psychopy3\packages\psychopy-sounddevice\psychopy_sounddevice\backend_sounddevice.py”, line 328, in init
self.setSound(value, secs=self.secs, octave=self.octave,
File “C:\Users\asus\AppData\Roaming\psychopy3\packages\psychopy-sounddevice\psychopy_sounddevice\backend_sounddevice.py”, line 382, in setSound
label, s = streams.getStream(sampleRate=self.sampleRate,
TypeError: cannot unpack non-iterable NoneType object
################ Experiment ended with exit code 1 [pid:14020] #################

I have no idea about how to fix this jam. Is there anything wrong?

here is my coding

import pandas as pd
from psychopy import core, sound, event
import random

read Excel file

df = pd.read_excel(‘C:\Users\asus\OneDrive\桌面\Lab\psychopy\stimuli\stimuli.xlsx’)

extract frequency and switch to list

frequency_column = df[‘Frequency(Hz)’] # setting frequency list name in ‘Frequency’
sound_stimuli = list(frequency_column)

product recurr and novel condition

recurr_values = [True] * 40 + [False] * 40
novel_values = [True] * 40 + [False] * 40

setting trial parameter

num_trials = 80
num_stimuli = 48

start_freq = 700
end_freq = 2500

def perform_mode_transition(sound_object):
# setting the sound mode to regular pattern
sound_object.setSound(seekable=True)
print(“Switched to regular mode”)
# for other mode switching

try:
for trial in range(num_trials):
random_freq_values = random.sample(sound_stimuli, num_stimuli)

    sound_objects = [sound.Sound(value=freq, secs=0.1) for freq in random_freq_values]

    for stim in sound_objects:
        stim.setVolume(0.2)

    clock = core.Clock()
    mode_transition = False

    for i, stim in enumerate(sound_objects):
        print(f"Playing sound {i + 1}: {random_freq_values[i]:.2f} Hz")
        stim.play()
        clock.reset()
        mode_transition = False

        while clock.getTime() < 4.8:
            keys = event.getKeys(keyList=['space'])  # testing space pressing
            if keys:
                # if detecting regular pattern at here
                print("Reaction to regular pattern")
                # add responding code

            if not mode_transition and clock.getTime() >= random.choice([1.6, 2.0, 2.4, 2.8, 3.2]):
                perform_mode_transition(stim)  # mode switching
                mode_transition = True

    # waiting 2secs then play next trial
    core.wait(2)

    # check if press esc to end the experiment
    keys = event.getKeys(keyList=['escape'], timeStamped=True)
    if keys:
        print("Experiment terminated by user.")
        break

except KeyboardInterrupt:
print(“Experiment terminated by user.”)
finally:
# Clean up or save data if needed
pass