spotify / pedalboard

🎛 🔊 A Python library for audio.
https://spotify.github.io/pedalboard
GNU General Public License v3.0
5.23k stars 262 forks source link

Input device names truncated, along with stuttery audio #274

Open pl4sma2389 opened 1 year ago

pl4sma2389 commented 1 year ago

I know this looks like it should be two separate issues, but bear with me...

On my system (Win11), the following code outputs some unexpected results:

from pedalboard.io import AudioStream

print("Inputs:", AudioStream.input_device_names, "\nOutputs:", AudioStream.output_device_names)

...outputs:

Inputs: ['Primary Sound Capture Driver', 'Mic in at rear panel (Pink) (Re', 'Microphone (NVIDIA Broadcast)', 'Microphone (Steam Streaming Mic', 'CABLE Output (VB-Audio Virtual'] 
Outputs: ['Primary Sound Driver', 'CABLE Input (VB-Audio Virtual Cable)', 'Speakers (Steam Streaming Speakers)', 'Speakers (Steam Streaming Microphone)', 'KW272U (NVIDIA High Definition Audio)', 'Speakers (NVIDIA Broadcast)', 'Speakers (Realtek(R) Audio)']

This output is unexpected in that the names of some devices are truncated (e.g. what should be "CABLE Output (VB-Audio Virtual Cable)" has become "CABLE Output (VB-Audio Virtual"). There are also two extraneous devices listed: 'Primary Sound Capture Driver' and 'Primary Sound Driver'.

What's strange about this is that this issue started seemingly at random during my investigation of my other issue #268. I noticed it after making no changes to my code, re-running the code errored out with an error message ValueError: No such device: CABLE Output (VB-Audio Virtual Cable). Changing my code to reference the new, shortened name restored audio, but the audio was very stuttery; sharp pops could be heard very frequently, a similar effect to if you turned the sample buffer time down too low on your DAW and played some sounds.

My uneducated guess would be that Pedalboard/JUCE started using the wrong sound device driver to handle the audio, such as WASAPI instead of DirectSound, or some other combination (I don't know what Pedalboard is supposed to be using, and I don't know what it is using now on my system.) That might explain all issues here: the shortened audio device names, the extraneous devices, and the stuttery audio.

This error has persisted across restarts and across different Python versions (3.10 and 3.12 are what I have tested).

PaxGriefs commented 11 months ago

I have the exact same issue did you find a solution?

pl4sma2389 commented 11 months ago

I have the exact same issue did you find a solution?

This isn't Reddit. If an issue is open, that means the problem still exists. Additionally, if an issue is closed, it doesn't necessarily mean a solution was found.