Commit graph

23 commits

Author SHA1 Message Date
András Veres-Szentkirályi 2f7a11abc1 use yield from instead of explicit version 2021-04-19 16:26:34 +02:00
András Veres-Szentkirályi 30294ee096 removed six 2021-04-19 16:23:40 +02:00
András Veres-Szentkirályi 0c09c84360 fixed Python 2 compatibility
Python 2 returns the string representation with just calling
writeframes(data) instead of writeframes(data.tostring())

/tmp/post.wav
0000 0000: 52 49 46 46 C4 AA 00 00  57 41 56 45 66 6D 74 20  RIFF.... WAVEfmt
0000 0010: 10 00 00 00 01 00 01 00  80 BB 00 00 00 77 01 00  ........ .....w..
0000 0020: 02 00 10 00 64 61 74 61  A0 AA 00 00 61 72 72 61  ....data ....arra
0000 0030: 79 28 27 68 27 2C 20 5B  30 2C 20 38 30 36 35 2C  y('h', [ 0, 8065,
0000 0040: 20 31 35 36 33 35 2C 20  32 32 32 34 32 2C 20 32   15635,  22242, 2

This change adds an escape hatch that could work for both major Python
versions, except Python 3.0 and 3.1 but those should be rare and
unsupported anyway.
2021-03-02 11:18:58 +01:00
Edmond Belliveau 71ddabcb1d Removed tostring() in write_wav. Python 3.9+ has removed the tostring() methods from array.array and other primitives. 2021-03-01 18:07:38 -04:00
KM4YRI 5d3b11a144 added Python six compatibility layer (#10)
added dependency to `six` for better Python 2/3 compatibility
2017-01-12 10:49:13 +01:00
KM4YRI 56743c7afb Python 3 compatibility: imap->map, izip->zip, xrange->range (#9) 2017-01-03 15:04:11 +01:00
András Veres-Szentkirályi 9bf312ca85 added SSTV.on_init() hook 2013-11-22 18:19:00 +01:00
András Veres-Szentkirályi 4d56f34a72 gen_values: fixed FM sample repetition bug
In the previous version, the FM modulator issued the last sample of the
previous frequency-time tuple twice, once as the last sample of the
previous tuple, once as the first sample (sample = 0) of the next one.
2013-11-22 17:00:53 +01:00
András Veres-Szentkirályi 18dab4e0d3 gen_values: initialize local variable 'sample'
although in practice, this shouldn't happen -- I tried lowering the
sample rate, and even at 10 samples/sec with Martin M1, it worked, and
SSTV requires at least 4000 samples/sec

(1 sample/sec raises an error though, if you'd like to try)
2013-07-02 15:21:33 +02:00
András Veres-Szentkirályi 10c85423d4 removed unused import math.floor 2013-07-02 15:18:12 +02:00
András Veres-Szentkirályi 3e49c90394 moved freq * factor outside sampling loop 2013-07-02 15:12:43 +02:00
András Veres-Szentkirályi 33c983ac8f gen_samples: replaced int(round()) with int() 2013-07-02 15:06:05 +02:00
András Veres-Szentkirályi c29f696489 gen_values: siplified increment operation 2013-07-02 14:05:07 +02:00
András Veres-Szentkirályi 92fda0cd1f replaced int(floor()) with int() 2013-07-02 13:51:06 +02:00
András Veres-Szentkirályi 649a4b2140 simplified and optimized offset calculation 2013-07-02 11:55:16 +02:00
András Veres-Szentkirályi dcb194a5f0 gen_values: precalculate sin() param factor 2013-07-02 11:46:01 +02:00
András Veres-Szentkirályi f0a2076a68 moved multichannel logic to write_wav 2013-07-01 23:14:28 +02:00
András Veres-Szentkirályi 30ec459a22 precalculate additive noise 2013-07-01 20:36:28 +02:00
András Veres-Szentkirályi 1f5e2963ef avoid min/max function calls per sample 2013-07-01 16:32:00 +02:00
András Veres-Szentkirályi 7560c8f37f replaced struct with array 2013-06-26 11:22:30 +02:00
András Veres-Szentkirályi 808a47fa6d use integer division to avoid float amplitude 2013-06-26 11:21:04 +02:00
András Veres-Szentkirályi 4ce9d15b39 added option for multiple channels 2013-06-24 17:05:21 +02:00
András Veres-Szentkirályi 391377551c moved source to pysstv directory 2013-06-24 13:40:57 +02:00
Renamed from sstv.py (Browse further)