Add Go API for speaker identification (#718)

This commit is contained in:
Fangjun Kuang
2024-03-29 19:25:55 +08:00
committed by GitHub
parent 2e0bccad36
commit 6da4a1c12f
25 changed files with 641 additions and 27 deletions

View File

@@ -99,7 +99,7 @@ func main() {
duration := float32(len(speechSegment.Samples)) / float32(config.SampleRate)
audio := &sherpa.GeneratedAudio{}
audio := &sherpa.Wave{}
audio.Samples = speechSegment.Samples
audio.SampleRate = config.SampleRate
@@ -115,7 +115,7 @@ func main() {
chk(s.Stop())
}
func decode(slid *sherpa.SpokenLanguageIdentification, audio *sherpa.GeneratedAudio, id int) {
func decode(slid *sherpa.SpokenLanguageIdentification, audio *sherpa.Wave, id int) {
stream := slid.CreateStream()
defer sherpa.DeleteOfflineStream(stream)