Example #1
0
        def audio_init(self, bits, channels, samplerate):
            print "Initializing", bits, channels, samplerate
            self.bits = bits
            self.channels = channels
            self.samplerate = samplerate

            min_frequency = 500
            max_frequency = samplerate / 30 * 10  # Abusing integer division
            self.frequency_limits = calculate_column_frequency(
                min_frequency, max_frequency, COLUMNS
            )
            self.buffer = ''
Example #2
0
from hs_logo import draw_logo
from leds import ColumnedLEDStrip
from music import calculate_levels, read_musicfile_in_chunks, calculate_column_frequency
from shairplay import initialize_shairplay, shutdown_shairplay, RaopCallbacks

COLUMNS = 12
GAP_LEDS = 0
TOTAL_LEDS = 100
SKIP_LEDS = 4

SAMPLE_RATE = 44100
NUM_CHANNELS = 2
FORMAT = aa.PCM_FORMAT_S16_LE
PERIOD_SIZE = 2048

frequency_limits =  calculate_column_frequency(200, 10000, COLUMNS)


def analyze_airplay_input(led_strip):
    from os.path import join
    lib_path = join(sys.prefix, 'lib')
    initialize_shairplay(lib_path, get_shairplay_callback_class(led_strip))

    while True:
        try:
            pass
        except KeyboardInterrupt:
            shutdown_shairplay()
            break

def analyze_audio_file(led_strip, path):
Example #3
0
def update_frequency_limits_with_columns(columns):
	Audio.COLUMNS = columns
	Audio.FREQUENCY_LIMITS = calculate_column_frequency(200, 10000, columns)