Skip to content

Instantly share code, notes, and snippets.


Omri Gazitt ogazitt

View GitHub Profile
ogazitt / auth.go
Created Apr 14, 2020
Auth0 PKCE flow for a CLI built in golang
View auth.go
package auth
import (

Keybase proof

I hereby claim:

  • I am ogazitt on github.
  • I am omri ( on keybase.
  • I have a public key whose fingerprint is 977A F643 4275 DA28 0107 2D33 B3F3 0CFC BE9C 25CC

To claim this, I am signing this object:

ogazitt / gist:3372119
Created Aug 16, 2012
Decoding a Speex stream
View gist:3372119
private Stream DecodeSpeexStream(Stream stream)
// Log function entrance
int totalEncoded = 0;
int totalDecoded = 0;
ogazitt / gist:3366917
Created Aug 16, 2012
Encode a PCM byte array using NSpeex
View gist:3366917
// I call EncodeSpeech() with a byte array containing PCM-encoded audio data that I get from the
// microphone (with len being the number of encoded bytes in the buffer, in case this is the
// last chunk and the buffer is only partially filled).
// In my app I send the returned byte array to a service for processing - hence I prefix the
// encoded Speex data it with length information.
// The reason that I prefix the data with both the original PCM buffer size as well as the
// the size of the encoded chunk is that the DECODER needs to know the original buffer size,
// otherwise it does not decode properly. Of course the size of the encoded chunk is to "frame"
// the chunks for the service, which may read multiple chunks off a stream.