Files
ggwave/tests/test-ggwave.py
2021-11-22 20:17:16 +02:00

20 lines
443 B
Python

import sys
import ggwave
# optionally disable logging
#ggwave.disableLog()
# create ggwave instance with default parameters
instance = ggwave.init()
payload = 'hello python'
# generate audio waveform for string "hello python"
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)