[fix] fix missing content before inserting
This commit is contained in:
parent
fbb9ee57d8
commit
fcd15ef0ea
@ -1,3 +1,4 @@
|
||||
#! /usr/bin/python2.7
|
||||
"""
|
||||
Sends live audio analysis to the terminal.
|
||||
|
||||
@ -227,9 +228,9 @@ def m_spectrum(audio_data):
|
||||
#debug( 'spectrum_120:{} '.format(spectrum_120))
|
||||
#debug( 'spectrum_10:{}'.format(spectrum_10))
|
||||
#debug( 'rms:{}'.format(rms_avg))
|
||||
r.set( 'spectrum_120', json.dumps( spectrum_120 ) )
|
||||
r.set( 'spectrum_10', json.dumps( spectrum_10 ) )
|
||||
r.set( 'rms', "{}".format(rms_avg) )
|
||||
if len(spectrum_120): r.set( 'spectrum_120', json.dumps( spectrum_120 ) )
|
||||
if len(spectrum_10): r.set( 'spectrum_10', json.dumps( spectrum_10 ) )
|
||||
if rms : r.set( 'rms', "{}".format(rms_avg) )
|
||||
return True
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user