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
1616 while total_frames < duration * s.sample_rate:
1717 vec = s.read(hop_size)
1818 # mix down to mono
19− mono_vec = vec.sum(-1)
19+ mono_vec = vec.sum(-1) / float(s.input_channels)
2020 g(mono_vec, hop_size)
21− total_frames += hop_size
21+ total_frames += hop_size
2222 s.stop()
2323
2424 if __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