History

python/demos/demo_pysoundcard_record.py: normalize downmixed signal

Paul Brossier committed 12 years ago

Commit 098925a1 parent 97d77da1 file · +2 −2Browse files

Showing the changes to python (1 of 1 file). Show all

Unified · Split

python/demos/demo_pysoundcard_record.py+2−2
@@ -16,9 +16,9 @@ def record_sink(sink_path): · 15 unmodified lines
16 while total_frames < duration * s.sample_rate:16 while total_frames < duration * s.sample_rate:
17 vec = s.read(hop_size)17 vec = s.read(hop_size)
18 # mix down to mono18 # mix down to mono
19 mono_vec = vec.sum(-1)19 mono_vec = vec.sum(-1) / float(s.input_channels)
20 g(mono_vec, hop_size)20 g(mono_vec, hop_size)
21 total_frames += hop_size 21 total_frames += hop_size
22 s.stop()22 s.stop()
23 23
24if __name__ == '__main__':24if __name__ == '__main__':

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t