update default parameters + python updates

- by default ggwave will now output 32-bit float samples
- python samples no longer use numpy
- python test now decodes payload
- fix buffer overflow in receive.py example
This commit is contained in:
Georgi Gerganov
2021-01-23 23:30:24 +02:00
parent ba8e0cd2b1
commit 105e0fd48d
7 changed files with 19 additions and 14 deletions

View File

@@ -1,6 +1,15 @@
import sys
import ggwave
instance = ggwave.init()
payload = 'hello python'
# generate audio waveform for string "hello python"
waveform = ggwave.encode("hello python", txProtocolId = 1, volume = 20, instance = instance)
waveform = ggwave.encode(payload, txProtocolId = 1, volume = 20, instance = instance)
# decode the audio waveform back to text
res = ggwave.decode(instance, waveform)
if res != payload.encode():
sys.exit(1)