Comments (11)
Do you have pulseaudio installed? What version?
from soundcard.
Yeah, pulseaudio version 10.0.
from soundcard.
Can you please state exactly what code you are trying to run?
from soundcard.
The second block of code under the tutorial section of the main page.
from soundcard.
The second block alone is not executable. This can not be true.
Please state exactly what code you are trying to run, as a complete Python script, so I can reproduce your error on my end. Help me help you.
What does soundcard report as your default_mic
and default_speaker
?
from soundcard.
This is the script I tried to run. I cannot reproduce the error anymore so I think this issue can be marked as solved. The default mic is <Microphone Built-in Audio Analog Mono (2 channels)>
and the default speaker is <Speaker FFT based equalizer on Built-in Audio Analog Stereo (2 channels)>
.
Thanks for the help!
from soundcard.
I'm seeing same error
Traceback (most recent call last):
File "record.py", line 12, in <module>
f.writeframes(rcdr.record(44100))
File "/home/chakradarraju/.virtualenvs/py3/lib/python3.6/site-packages/soundcard/pulseaudio.py", line 588, in record
chunk = self._record_chunk()
File "/home/chakradarraju/.virtualenvs/py3/lib/python3.6/site-packages/soundcard/pulseaudio.py", line 528, in _record_chunk
readable_bytes = self._pulse._pa_stream_readable_size(self.stream)
AttributeError: '_Recorder' object has no attribute '_pulse'
code:
import soundcard as sc
import wave
lb = sc.all_microphones(include_loopback=True)[0]
rcdr = lb.recorder(44100)
with wave.open('recorded.wav', 'wb') as f:
f.writeframes(rcdr.record(44100))
I'm on ubuntu 18.04 with pulseaudio 11.1
from soundcard.
I'll have a look.
from soundcard.
Hello,
I'm facing the exact same issue with this code
import soundcard as sc
import wave
lb = sc.all_microphones(include_loopback=True)[0]
rcdr = lb.recorder(44100)
with wave.open('recorded.wav', 'wb') as f:
f.writeframes(rcdr.record(44100))
pulseaudio 11.1
Python 3.6.7
Ubuntu 18.04
from soundcard.
Sorry about that. This has been resolve. This was an error on my part. Thanks!
from soundcard.
I'm seeing same error
Traceback (most recent call last): File "record.py", line 12, in <module> f.writeframes(rcdr.record(44100)) File "/home/chakradarraju/.virtualenvs/py3/lib/python3.6/site-packages/soundcard/pulseaudio.py", line 588, in record chunk = self._record_chunk() File "/home/chakradarraju/.virtualenvs/py3/lib/python3.6/site-packages/soundcard/pulseaudio.py", line 528, in _record_chunk readable_bytes = self._pulse._pa_stream_readable_size(self.stream) AttributeError: '_Recorder' object has no attribute '_pulse'
code:
import soundcard as sc import wave lb = sc.all_microphones(include_loopback=True)[0] rcdr = lb.recorder(44100) with wave.open('recorded.wav', 'wb') as f: f.writeframes(rcdr.record(44100))
I'm on ubuntu 18.04 with pulseaudio 11.1
The recorder is a context manager. You'll have to use it with with
.
from soundcard.
Related Issues (20)
- Support acoustic echo cancellation (AEC) for windows HOT 1
- Problems with the "fuzzy matcher" in get_microphone() HOT 1
- Watch for moved streams? HOT 1
- Decode error in _CoreAudio.CFString_to_str HOT 2
- feature request - ability to add virtual audio channels. HOT 1
- Why won't it save my audio when I use this with SoundFile? HOT 4
- OSError: ctypes.util.find_library() did not manage to locate a library called 'harfbuzz' please help in windows HOT 2
- Does anyone know how to make this work? HOT 1
- Wav file is empty after recording is saved to file HOT 5
- how to end playback in advance? HOT 2
- Need help with settings HOT 6
- MacOS: Empty result for all_speakers/all_microphones HOT 28
- Record audio unlimited HOT 6
- get mac audio output level HOT 1
- Queation: Is that possible to record based on a button click? HOT 1
- Data loss while recording HOT 4
- Cannot record sound with loopback if silence at start HOT 10
- loopback record audio from speaker return zero array HOT 5
- Problem with the player HOT 1
- how to get non numpy "raw" mono data from the record() method HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from soundcard.