项目作者: markph0204

项目描述 :
Philips Hue halloween fun!
高级语言: Python
项目地址: git://github.com/markph0204/huelloween.git
创建时间: 2016-01-17T02:53:04Z
项目社区:https://github.com/markph0204/huelloween

开源协议:

下载


Huelloween

Huelloween processes an audio stream (microphone, wav recording) and adjusts Phillips Hue lights for that scary Halloween effect! It analyzes the amplitude of each frequency using the [Fast Fourier Transform] (https://en.wikipedia.org/wiki/Fast_Fourier_transform) (or FFT) algorithm.

CONFIG

Edit the config.yaml file, setting your Phillips Hue bridge IP address.

Sample Uses

Run Huelloween accepting the mic as the audio input.

Test using the microphone for audio input; first get the audio devices and set in config file

  1. python huelloween.py --list-audio-devices
  2. python huelloween.py --test-mic

Test using a sample file as input

  1. python huelloween.py --test-sound

Run normally

  1. python huelloween.py

The first time you run - you may get prompted to “pair” your program or machine with the Phillips Hue Bridge. For example:

  1. Press button on Bridge then hit Enter to try again
  2. Attempting to set up your Phillips Hue Bridge
  3. INFO:phue:Error opening config file, will attempt bridge registration
  4. INFO:phue:Writing configuration file to /Users/mark/.python_hue
  5. INFO:phue:Reconnecting to the bridge
  6. INFO:phue:Attempting to connect to the bridge...
  7. INFO:phue:Using ip: 10.0.1.2

Dependencies

MAC OS X (homebrew)

In order to get PyAudio working I had to first install pyaudio C lib. I used Macports:

  1. brew install portaudio

Linux

  1. sudo port install portaudio

Mentions

Author

Mark Hurley

Backstory

The purpose of Huelloween started just before Halloween 2014. I wanted to mimic the audio processing of scary recordings to adjust my Phillips Hue lightbulbs. Each window on the front side of the house would have a light bulb. It ended up being five windows in all with a speaker sitting just outside in a dark spot. Some children were scared, parents loved it, while I am sure my neighbors were happy to see it up for only one night.