Code Monkey home page Code Monkey logo

Comments (16)

kynan avatar kynan commented on September 26, 2024 1

It works fine with the Debian package, which makes me suspects it could be an artifact of how the conda package is built.

FWIW, here's the ldd output of the portaudio shared library for the conda package:

$ ldd ~/miniconda/lib/python3.6/site-packages/_portaudio.cpython-36m-x86_64-linux-gnu.so 
	linux-vdso.so.1 (0x00007ffd07bcd000)
	libportaudio.so.2 => ~/miniconda//lib/python3.6/site-packages/../../libportaudio.so.2 (0x00007feda02ad000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fed9fea7000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fed9fb08000)
	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fed9f900000)
	libasound.so.2 => ~/miniconda/lib/python3.6/site-packages/../.././libasound.so.2 (0x00007feda018e000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fed9f5fc000)
	/lib64/ld-linux-x86-64.so.2 (0x00007feda00c4000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fed9f3f8000)

and for the system package:

$ ldd /usr/lib/python3/dist-packages/_portaudio.cpython-36m-x86_64-linux-gnu.so 
	linux-vdso.so.1 (0x00007ffc263d3000)
	libportaudio.so.2 => /usr/lib/x86_64-linux-gnu/libportaudio.so.2 (0x00007f14116b6000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f1411499000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f14110fa000)
	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f1410ef2000)
	libasound.so.2 => /usr/lib/x86_64-linux-gnu/libasound.so.2 (0x00007f1410bf4000)
	libjack.so.0 => /usr/lib/x86_64-linux-gnu/libjack.so.0 (0x00007f14109ad000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f14106a9000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f1411aee000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f14104a5000)
	libopus.so.0 => /usr/lib/x86_64-linux-gnu/libopus.so.0 (0x00007f1410255000)
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f140fed0000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f140fcb8000)

from pyaudio-feedstock.

NikhilPeri avatar NikhilPeri commented on September 26, 2024 1

Fix for Windows Subsystem for Linux (WSL)

  • I was encountering this issue only when using WSL then I learned by default WSL does not connect to audio devices even if they are available on the host machine
  • To resolve this you must install pulseaudio
sudo apt-get install pulseaudio

from pyaudio-feedstock.

scopatz avatar scopatz commented on September 26, 2024

I used to see this, but I haven't in a while.

from pyaudio-feedstock.

scopatz avatar scopatz commented on September 26, 2024

Maybe report it upstream?

from pyaudio-feedstock.

scopatz avatar scopatz commented on September 26, 2024

Hmm yeah, libjack isn't linked in

from pyaudio-feedstock.

ambarmendez avatar ambarmendez commented on September 26, 2024

Hello! Yes, I got the same error but thanks to @kynan comment:

It works fine when installing pyaudio via the system package manager

I was able to get rid of it. Just by executing: pip3 install PyAudio

System information:

My system is Linux version 4.19.0-4-amd64

My Python version is Python 3.7.3rc1

My Pip version is pip 18.1 from /usr/lib/python3/dist-packages/pip (python 3.7)

My PyAudio library version is 0.2.11

from pyaudio-feedstock.

scopatz avatar scopatz commented on September 26, 2024

hmmm pip installing on top of a conda install package is probably going to lead to some weird issues, especially if you are using the system's pip.

from pyaudio-feedstock.

ambarmendez avatar ambarmendez commented on September 26, 2024

Oh no! Sorry for the misunderstanding. I did it without anaconda.
When I read @kynan comment, I tried it using python and pip from the Debian and not via conda commands

from pyaudio-feedstock.

scopatz avatar scopatz commented on September 26, 2024

Ahh ok!

from pyaudio-feedstock.

Dino-Burger avatar Dino-Burger commented on September 26, 2024

Hi All! I have the same problem as @kynan: print(pa.get_default_input_device_info()) works in my system python, but not in my anaconda. Any ideas how to fix that? (I did not rewrite all the details as it seems to be exactly the same problem as for @kynan ) Thanks

from pyaudio-feedstock.

z-a-y-a-n avatar z-a-y-a-n commented on September 26, 2024

@i am windows please help

from pyaudio-feedstock.

LenBen avatar LenBen commented on September 26, 2024

Have there been any solutions to this problem?

from pyaudio-feedstock.

rshrc avatar rshrc commented on September 26, 2024

Anybody found any solution? @kynan

from pyaudio-feedstock.

kynan avatar kynan commented on September 26, 2024

Nope, sorry. I've also not looked at this in years :)

from pyaudio-feedstock.

z-a-y-a-n avatar z-a-y-a-n commented on September 26, 2024

The error message "No Default Input Device Available" typically indicates that your computer cannot detect an input device, such as a keyboard or mouse, that is connected and ready to use. This can happen for various reasons, such as a faulty or disconnected device, outdated drivers, or system conflicts.

To troubleshoot this issue, follow these steps:

  1. Check the physical connection:

Ensure your input device is properly plugged into the correct port on your computer.
Try connecting the device to a different port if available.
Verify that the cable connecting the device to your computer is not damaged.
If you're using a wireless device, make sure it's properly paired with your computer and has sufficient battery power.
2. Update device drivers:

Outdated or corrupted device drivers can cause input device issues.
Access Device Manager on your computer.
Expand the "Keyboards" or "Mice and other pointing devices" category.
Right-click on your input device and select "Update driver."
Choose "Search automatically for updated driver software."
3. Restart your computer:

A simple restart can often resolve temporary software glitches that might be causing the error.
Save your work and close all open programs.
Click the Start button and select "Restart."
4. Check for system conflicts:

Sometimes, third-party software or hardware can interfere with input device functionality.
Temporarily disable any recently installed or updated software.
Disconnect any recently connected hardware devices.
Check for any known compatibility issues between your input device and your computer's operating system.
If the issue persists after trying these steps, you may need to contact the manufacturer of your input device or consult a computer technician for further assistance.

Yes, there are a few known issues with using pyaudio installed through conda. One common issue is that the conda installation does not properly set up the default input device. This can cause errors like the one you're seeing, where get_default_input_device_info() fails with OSError: No Default Input Device Available.

There are a few potential workarounds for this issue:

  1. Try using the system-installed pyaudio instead of the conda version:

If you have pyaudio installed through your system's package manager (e.g., sudo apt-get install python3-pyaudio), try using that version instead of the conda version. You can switch between conda environments or create a virtual environment that uses the system-installed pyaudio.

  1. Manually set the default input device:

If you're stuck with the conda version of pyaudio, you can try manually setting the default input device using the PortAudio API. This involves using the pa.set_default_input_device(device_index) method to specify the index of the input device you want to use.

  1. Use a different audio library:

If you're having trouble with pyaudio, you can try using a different audio library, such as SoundDevice or AudioLab. These libraries may have their own quirks, but they might work better in your environment.

Here's an example of how to manually set the default input device using the PortAudio API:

Python
import pyaudio

pa = pyaudio.PyAudio()

Get the device index of the desired input device

device_index = 2 # Replace with the actual index of your input device

Set the default input device

pa.set_default_input_device(device_index)

If you have multiple input devices, you can list them using pa.get_device_count() and pa.get_device_info_by_index(i) to find the correct index for your desired device.

Thank You And Happy Coding 💻 🔥

from pyaudio-feedstock.

np-n avatar np-n commented on September 26, 2024

I am stuck with the similar issue. Has anyone fixed it? I have tried to read the audio using pyaudio first and then also tried sounddevice and speechrecognition but the ended with the same exception:Exception ocurred: No Default Input Device Available. I have installed pyaudio using pip package manager.

from pyaudio-feedstock.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.