mirror of
https://github.com/ggerganov/ggwave.git
synced 2026-02-06 16:47:59 +08:00
python : accept bytes as input to encode (#127)
Co-authored-by: deniz <deniz@r1oaz.ru>
This commit is contained in:
@@ -25,7 +25,10 @@ def encode(payload, protocolId = 1, volume = 10, instance = None):
|
||||
@return Generated audio waveform bytes representing 16-bit signed integer samples.
|
||||
"""
|
||||
|
||||
cdef bytes data_bytes = payload.encode()
|
||||
if isinstance(payload, str):
|
||||
payload = payload.encode('utf-8')
|
||||
cdef bytes data_bytes = payload
|
||||
|
||||
cdef char* cdata = data_bytes
|
||||
|
||||
own = False
|
||||
|
||||
Reference in New Issue
Block a user