Pyaudio library issue in Lightning AI Studios

@awaelchli1
Hi,
I have implemented below code in lightning AI Studio (CPU based studio):

import pyaudio

p = pyaudio.PyAudio()

for i in range(p.get_device_count()):
    info = p.get_device_info_by_index(i)
    print(f"Device {i}: {info['name']}, Input: {info['maxInputChannels']}, Output: {info['maxOutputChannels']}")

p.terminate()


# ******************* #
p = pyaudio.PyAudio()

# Replace 'device_index' with the index of your desired output device
output_device_index = 0  # Change this to the appropriate index
stream = p.open(format=pyaudio.paInt16, channels=1, rate=44100, output=True, output_device_index=output_device_index)

# Your audio processing code here

stream.stop_stream()
stream.close()
p.terminate()

But I got below error:

OSError: [Errno -9996] Invalid output device (no default output device)

Would you please help me to address this issue?
Thanks