KaKaRoTo says (5:34 AM):
it's mostly done already
KaKaRoTo says (5:35 AM):
+ I'm sure phil can figure out what I'm missing
KaKaRoTo says (5:35 AM):
problem with snack is that it's good for playing a good chunk of data
KaKaRoTo says (5:35 AM):
I've been getting garbage sound for a while and thought it was the codec, or the way I decoded or something
KaKaRoTo says (5:35 AM):
then I tried buffer 1 second before playing it, and it was better but couldn't understand shit
KaKaRoTo says (5:35 AM):
then I buffered 10 seconds before playing chunks of 10 seconds, it was great!
KaKaRoTo says (5:36 AM):
but... you get a glitch in the sound every 10 seconds.. AND the latency is huge, lol
KaKaRoTo says (5:36 AM):
so I realized that snack has a sort of mini fadein/fadeout (or whatever) because it starts playing before the device is accessible or something.. and it has a latency between two 'play' commands
KaKaRoTo says (5:37 AM):
and that's bad considering that I receive chunks of sound every 40ms
Vivia® {G} says (5:37 AM):
KaKaRoTo says (5:38 AM):
Streaming audio using sockets
Snack sound objects can also be linked to socket channels. This allows you to play sound data coming in from a socket or to record sound data and write it to a socket.
The following code creates a minimal audio server
package require snack
proc ServerCmd {sock args} {
set snd [snack: ound -channel $sock]
$snd play -command "[list close $sock];$snd destroy"