Skip to content

abdullahb53/fastwavheader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastWavHeader

Optimized way to get wav header.

fastwavheaderAlloc

Slice/Unsafe is selected

 Show becnhmark results:

make test
	// 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
	}

Releases

No releases published

Packages

No packages published