SyntaxError: 'await' outside function
TeaPoly opened this issue · 2 comments
TeaPoly commented
It's great to write silk decoder into a python interface. Thanks for your contribution. When I install graiax-silkcoder
and run example in README
, then an error has raise: SyntaxError: 'await' outside function
.
from graiax import silkcoder
await silkcoder.encode('a.wav', 'a.silk')
I-love-study commented
Hello
In fact, encode
and decode
method in graiax-silkcoder
is asynchronous.
you can do it by this
import asyncio
from graiax import silkcoder
asycio.run(silkcoder.encode('a.wav', 'a.silk'))
or if you want to run in the terminal
just using python -m asyncio
to open python
TeaPoly commented
Hello In fact,
encode
anddecode
method ingraiax-silkcoder
is asynchronous. you can do it by thisimport asyncio from graiax import silkcoder asycio.run(silkcoder.encode('a.wav', 'a.silk'))or if you want to run in the terminal just using
python -m asyncio
to open python
Thanks for your reply.