Skip to content

Commit

Permalink
Fix go-build-docker target (#25)
Browse files Browse the repository at this point in the history
* Fix go-build-docker target

* Add comment
  • Loading branch information
streamer45 authored Jun 27, 2024
1 parent 9d08479 commit 136952f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ go-build-docker: # to build binaries under a controlled docker dedicated go cont
-v $(PWD):/app -w /app \
-e GOCACHE="/tmp" \
$(DOCKER_IMAGE_GO) \
/bin/bash ./build/build.sh ${OPUS_VERSION} ${OPUS_SHA} ${WHISPER_VERSION} ${WHISPER_SHA} ${WHISPER_MODELS} ${ONNX_VERSION} ${ARCH} || ${FAIL}
/bin/bash ./build/build.sh ${OPUS_VERSION} ${OPUS_SHA} ${WHISPER_VERSION} ${WHISPER_SHA} ${WHISPER_MODELS} ${ONNX_VERSION} ${ARCH} ${AZURE_SDK_VERSION} ${AZURE_SDK_SHA} || ${FAIL}
@$(OK) go build docker

.PHONY: go-run
Expand Down
7 changes: 7 additions & 0 deletions cmd/transcriber/apis/azure/speech_recognizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,13 @@ func (s *SpeechRecognizer) TranscribeAsync(samplesCh <-chan []float32) (<-chan t
func (s *SpeechRecognizer) Transcribe(samples []float32) ([]transcribe.Segment, string, error) {
// TODO: we should likely re-use the same session throughout a track transcription to optimize
// resources a bit.
//
// NOTE: the underlying Golang wrapper is currently a bit bugged. Re-using the client is recommended
// but it doesn't work properly because everything relies on a stream which can't be flushed which can
// lead to data loss. And if we close the stream then we need to re-initialize everything like we do.
//
// A better solution may be to extend the Transcriber interface and pass an audio reader to this method
// instead of the chunks we create since we are dealing with post-transcript.

inputDuration := time.Duration(float32(len(samples))/float32(audioSampleRate)) * time.Second

Expand Down

0 comments on commit 136952f

Please sign in to comment.