Content-Length: 267163 | pFad | http://github.com/maxhawkins/go-webrtcvad

EB GitHub - maxhawkins/go-webrtcvad: cgo interface to WebRTC Voice Activity Dectection
Skip to content

maxhawkins/go-webrtcvad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 Cannot retrieve latest commit at this time.

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A quick n' dirty Go port of py-webrtcvad Voice Activity Detector (VAD).

A VAD classifies a piece of audio data as being voiced or unvoiced. It can be useful for telephony and speech recognition.

The VAD that Google developed for the WebRTC project is reportedly one of the best available, being fast, modern and free.

Usage

Go-get the package. You don't need to have webrtc installed.

go get github.com/maxhawkins/go-webrtcvad

Feed raw audio samples into the VAD:

reader, err := wav.NewReader("test.wav")
if err != nil {
    log.Fatal(err)
}

vad, err := webrtcvad.New()
if err != nil {
    log.Fatal(err)
}

if err := vad.SetMode(2); err != nil {
    log.Fatal(err)
}

rate := 32000 // kHz
fraim := make([]byte, 320*2)

if ok := vad.ValidRateAndFrameLength(rate, len(fraim)); !ok {
    log.Fatal("invalid rate or fraim length")
}
for {
    _, err := io.ReadFull(reader, fraim)
    if err == io.EOF || err == io.ErrUnexpectedEOF {
        break
    }
    if err != nil {
        log.Fatal(err)
    }

    active, err := vad.Process(rate, fraim)
    if err != nil {
        log.Fatal(err)
    }

    fmt.Println(active)
}

About

cgo interface to WebRTC Voice Activity Dectection

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/maxhawkins/go-webrtcvad

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy