An open API service indexing awesome lists of open source software.

https://github.com/abdullahb53/fastwavheader

Optimized way to get wav header.
https://github.com/abdullahb53/fastwavheader

fast golang header reader wav wav-header wavfile

Last synced: 3 months ago
JSON representation

Optimized way to get wav header.

Awesome Lists containing this project

README

          

# FastWavHeader
__Optimized way to get wav header.__

![fastwavheaderAlloc](https://github.com/abdullahb53/fastwavheader/assets/29378922/8e63ad06-eea0-4daf-a9ca-02bd4254670f)

**`Slice/Unsafe is selected`**

 Show becnhmark results:
```
make test
```

```golang
// If u want to stream data through channels.
fwh.StartStreamEvent()
filePaths := []string{
...
}

filePaths2 := []string{
...
}

// Send your filePaths to channel.
for _, val := range filePaths {
fwh.FilePathCh <- val
}

// Consume WavHeaderInfos from channel.
go func() {
consume := fwh.HeaderCh
for {
select {
case wavinfo, ok := <-consume:
if !ok {
consume = fwh.HeaderCh
} else {
// Do something..
log.Println("@@ WavInfo:", wavinfo)
}
default:
continue
}
}
}()

// Change channel capacity. Async or Sync.
go fwh.ChangeQueueSize(30, 40)

// Again, send new filePaths to adjusted channel.
for _, val := range filePaths2 {
fwh.FilePathCh <- val
}
```