Comments (9)
I need help too. I have this same problem
from systematic-leds.
@RichusX Im solved it! Find microphone.py and change method def get_audio_devices() to
(im bolded important fragment)
def get_audio_devices():
#print( "get audio" )
global p
numdevices = p.get_device_count()
#for each audio device, determine if is an input or an output and add it to the appropriate list and dictionary
audio_options = 'Default'
for i in range (p.get_device_count()):
device_info = p.get_device_info_by_index(i)
if device_info.get('maxInputChannels')>0:
name = device_info.get('name')
audio_options += ',' + name
#print ( audio_options )
return audio_options
from systematic-leds.
I have next problem. Im solved it. Just use all my code from microphone.py
`import time
import numpy as np
import pyaudio
import lib.config as config
from lib.config import log
ext_gui = None
stream = None
p = pyaudio.PyAudio()
def get_audio_devices():
#print( "get audio" )
global p
numdevices = p.get_device_count()
#for each audio device, determine if is an input or an output and add it to the appropriate list and dictionary
audio_options = 'Default'
for i in range (p.get_device_count()):
device_info = p.get_device_info_by_index(i)
if device_info.get('maxInputChannels')>0:
name = device_info.get('name')
audio_options += ',' + name
#print ( audio_options )
return audio_options
def microphone_register_gui( gui ):
global ext_gui
ext_gui = gui
def reset_microphone_device():
global stream
if stream is not None:
stream.stop_stream()
stream.close()
stream = None
def start_stream(callback):
global stream, p, ext_gui
id = -1
while id == -1:
try:
id=p.get_default_input_device_info()['index']
except IOError:
log('Cannot find microphone.')
time.sleep( 5 )
frames_per_buffer = int(config.settings["configuration"]["MIC_RATE"] / config.settings["configuration"]["FPS"])
overflows = 0
prev_ovf_time = time.time()
prev_time = time.time()
adjustment_factor = 0.0
while True:
try:
if stream is None:
numdevices = p.get_device_count()
#for each audio device, determine if is an input or an output and add it to the appropriate list and dictionary
for i in range (p.get_device_count()):
device_info = p.get_device_info_by_index(i)
if device_info.get('maxInputChannels')>0:
log( "Audio Device Found : " + device_info.get('name'), 4 )
if device_info.get('name')==config.settings["configuration"]["MIC_NAME"]:
id=i
log( "Found Requested Microphone : " + device_info.get('name'), 3 )
stream = p.open(format=pyaudio.paInt16,
channels=1,
rate=config.settings["configuration"]["MIC_RATE"],
input=True,
input_device_index = id,
frames_per_buffer=frames_per_buffer)
time2 = time.time()
if config.uses_audio :
y = np.fromstring(stream.read(frames_per_buffer), dtype=np.int16)
y = y.astype(np.float32)
prev_time = time.time()
else:
y = 0
desired_sleep = 1.0/config.settings["configuration"]["FPS"]
last_loop = time.time() - prev_time
if abs(last_loop - desired_sleep) > 0.0005:
if last_loop > desired_sleep:
adjustment_factor -= 0.0005
else:
adjustment_factor += 0.0005
sleep_time = desired_sleep + adjustment_factor
prev_time = time.time()
time.sleep( max( 0, sleep_time ) )
callback(y)
except IOError:
overflows += 1
if time.time() > prev_ovf_time + 1:
prev_ovf_time = time.time()
if config.settings["configuration"]["USE_GUI"]:
ext_gui.label_error.setText('Audio buffer has overflowed {} times'.format(overflows))
else:
log('Audio buffer has overflowed {} times'.format(overflows))
stream.stop_stream()
stream.close()
p.terminate()
`
from systematic-leds.
@ReMiXs that's great! I'll give it a go.
from systematic-leds.
@RichusX nice :)
from systematic-leds.
@RichusX Im solved it! Find microphone.py and change method def get_audio_devices() to
(im bolded important fragment)def get_audio_devices():
#print( "get audio" )
global p
numdevices = p.get_device_count()
#for each audio device, determine if is an input or an output and add it to the appropriate list and dictionary
audio_options = 'Default'for i in range (p.get_device_count()): device_info = p.get_device_info_by_index(i)
if device_info.get('maxInputChannels')>0:
name = device_info.get('name')
audio_options += ',' + name
#print ( audio_options )
return audio_options
where did you find "microphone.py" ? there is no such a thing into "Systematic-LEDs" file.
from systematic-leds.
Could you please share if you get it somewhere else ?
from systematic-leds.
i got first that error when i was using anaconda with python 2.7 please double check if that is the case then i tried python 3.6 and voila no problems
from systematic-leds.
problem
(RGB) C:\systematic\python>python main.py
No user colours found No user gradients found
dear i am not professional, how can i easy way to solved it
from systematic-leds.
Related Issues (20)
- Audio setup on MAC (crashes)? HOT 3
- Python error using pyaudio HOT 4
- Raspberry Pi to ESP8266 HOT 10
- audio in RPI
- Esp8266 not sending data HOT 7
- LEDs all turn white after uploading arduino code, doesn't react to visualization
- Headless Pi Can't run HOT 1
- Problem with more then 1 board
- error compiling after update fastled 3.26 HOT 1
- Blinking leds HOT 3
- Path for configuration file of strips on mac
- I NEED HELP PLZ HOT 7
- ESP is not responding when I ping HOT 1
- Esp8266 automatic reder problem HOT 1
- Error when running main.py; OSError: [Errno -9996] Invalid device HOT 2
- problemas relacionadas com biblioteca pyaudio
- Project not compiles
- cannot uploud file on the ESP
- Version recomended
- flickering led
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 systematic-leds.