update examples
This commit is contained in:
parent
fe23d233a0
commit
e4854e9548
2 changed files with 10 additions and 2 deletions
|
@ -2,6 +2,7 @@ mumble-bot
|
|||
==========
|
||||
|
||||
prende l'audio del canale, ne fa stdout.
|
||||
prende l'audio da stdin, lo manda nel canale.
|
||||
|
||||
Install
|
||||
--------
|
||||
|
@ -58,3 +59,10 @@ samplerate: 48000,
|
|||
```
|
||||
|
||||
Poi entri in chat e fai il comando `/start` per iniziare la diretta, `/stop` per fermarla.
|
||||
|
||||
Client headless
|
||||
===============
|
||||
|
||||
```
|
||||
parecord --channels=1 --rate=48000 --format=s16le --raw | python3 bot.py --transmit --stream | paplay --raw --rate 48000 --format=s16le --channels=2
|
||||
```
|
||||
|
|
|
@ -104,7 +104,7 @@ def transmit(name, mumble, chunk_size):
|
|||
data = sys.stdin.buffer.read(int(chunk_size))
|
||||
if(get_rms(data) > 0.09):
|
||||
mumble.sound_output.add_sound(data)
|
||||
buffer = 10005B
|
||||
buffer = 1000
|
||||
else:
|
||||
# keep the audio open for one second
|
||||
if(buffer >= 0):
|
||||
|
@ -155,7 +155,7 @@ def main():
|
|||
cursor_time = time.time() - BUFFER
|
||||
|
||||
if args.transmit:
|
||||
transmit_thread = threading.Thread(target=sound_recorder, args=(1,mumble, MONO_CHUNK_SIZE))
|
||||
transmit_thread = threading.Thread(target=transmit, args=(1,mumble, MONO_CHUNK_SIZE))
|
||||
transmit_thread.start()
|
||||
|
||||
while mumble.is_alive():
|
||||
|
|
Loading…
Reference in a new issue