dennisppaul / wellen

wellen is a framework for exploring and teaching generative music making and algorithmic compositions.
GNU General Public License v3.0
22 stars 2 forks source link

Error using wellen in processing #21

Open TomasNebot opened 1 year ago

TomasNebot commented 1 year ago

Hi @dennisppaul , Im trying to use the wellen library in processing but when I try to run one of your examples I get the following error: "No line matching interface SourceDataLine supporting format PCM_SIGNED 48000.0 Hz, 24 bit, mono, 3 bytes/frame, little-endian is supported." Im trying it on windows. Do you know what it means?

Thanks in advance

dennisppaul commented 1 year ago

i am sorry to hear this. can you tell me what system you are on?

dennisppaul commented 1 year ago

can you please also try to add the following two lines to setup. preferably in the very beginning:

public void setup() {
    Wellen.dumpAudioInputAndOutputDevices(true);
    Tone.start("internal", 44100, Wellen.DEFAULT_AUDIO_DEVICE, 2);
}

Wellen.dumpAudioInputAndOutputDevices(true); will print all available audio output devices including their format capabilities. try to find your default audio output device ( usually the one that s been selected in system preferences ) in the list and see what sampling rate it can run at.

Tone.start("internal", 44100, Wellen.DEFAULT_AUDIO_DEVICE, 2); starts the tone enginge with the default audio output device selected with 2 output channels and a sampling rate of 44100. you might need to change the sampling rate and the output channels to match you audio output device.

TomasNebot commented 1 year ago

Thankyou for the quick response @dennisppaul! Im on Windows 11

I ran those lines on the setup and got the same error message as before but with the printed message with all the audio output devices. I have as default the Realtek Audio with 16 bit and a sampling rate of 48000 Hz. I tried changing it back to 48 kHz but I still get the error. Finally I changed the output channels and curiosuly when I input 0 channels I dont get the error and I can run the example, but obviously with no sound.

Hope we can fix this so I can start using your library as soon as posible. It is an amazing tool to create music in processing :)

+-------------------------------------------------------+
+ AUDIO DEVICES ( Audio System )                         
+-------------------------------------------------------+
+ ID #2  : ( INPUT:0 / OUTPUT:2 ) : "Controlador primario de sonido"
+     OUTPUT FORMATS:
+     - 8-bits, 1 channel
+     - 16-bits, 1 channel
+     - 8-bits, 2 channels
+     - 16-bits, 2 channels
+ ID #3  : ( INPUT:0 / OUTPUT:2 ) : "Altavoces (Realtek(R) Audio)"
+     OUTPUT FORMATS:
+     - 8-bits, 1 channel
+     - 16-bits, 1 channel
+     - 8-bits, 2 channels
+     - 16-bits, 2 channels
+ ID #4  : ( INPUT:2 / OUTPUT:0 ) : "Controlador primario de captura de sonido"
+     INPUT FORMATS:
+     - 8-bits, 1 channel
+     - 16-bits, 1 channel
+     - 8-bits, 2 channels
+     - 16-bits, 2 channels
+ ID #5  : ( INPUT:2 / OUTPUT:0 ) : "Micrófono (Realtek(R) Audio)"
+     INPUT FORMATS:
+     - 8-bits, 1 channel
+     - 16-bits, 1 channel
+     - 8-bits, 2 channels
+     - 16-bits, 2 channels
+-------------------------------------------------------+
dennisppaul commented 1 year ago

thank you for sharing this information. puuuh, this is strange. your out shows no sampling rate. on MacOS i get this:

+-------------------------------------------------------+
+ AUDIO DEVICES ( Audio System )                         
+-------------------------------------------------------+
+ ID #5  : ( INPUT:1 / OUTPUT:2 ) : "Default Audio Device"
+     INPUT FORMATS:
+     - 8-bits, 1 channel
+     - 16-bits, 1 channel
+     - 24-bits, 1 channel
+     - 16-bits, 1 channel, 48000Hz
+     OUTPUT FORMATS:
+     - 8-bits, 1 channel
+     - 16-bits, 1 channel
+     - 24-bits, 1 channel
+     - 8-bits, 2 channels
+     - 16-bits, 2 channels
+     - 24-bits, 2 channels
+     - 16-bits, 2 channels, 48000Hz
+ ID #7  : ( INPUT:1 / OUTPUT:0 ) : "MacBook Pro Microphone"
+     INPUT FORMATS:
+     - 8-bits, 1 channel
+     - 16-bits, 1 channel
+     - 24-bits, 1 channel
+     - 16-bits, 1 channel, 48000Hz
+ ID #8  : ( INPUT:0 / OUTPUT:2 ) : "MacBook Pro Speakers"
+     OUTPUT FORMATS:
+     - 8-bits, 1 channel
+     - 16-bits, 1 channel
+     - 24-bits, 1 channel
+     - 8-bits, 2 channels
+     - 16-bits, 2 channels
+     - 24-bits, 2 channels
+     - 16-bits, 2 channels, 48000Hz
+-------------------------------------------------------+

as you can see the last entry shows a sampling rate of 48KHz. i unfortunately have not always access to a windows machine but will look into it as soon as possible.

have you ever successfully run another audio library on your setup e.g Minim or Sound?

TomasNebot commented 1 year ago

Yeah it's weird. I have checked the sample rate of my audio driver and its 48kHz so i dont get why it doesn't work. Strange that it doesn't print it on my pc.

I have used both libraries and they work perfectly. Is there any way I can see the sample rate of my audio devices with those libraries?

dennisppaul commented 5 months ago

it should work on windows now.