Skip to content

Commit

Permalink
modify worker encode
Browse files Browse the repository at this point in the history
  • Loading branch information
chinaboard committed Sep 29, 2023
1 parent 251699c commit 22c701f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/worker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
)

const (
filePath = "/tmp/temp.wav"
filePath = "/tmp/temp.m4a"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/videodl/videodl.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

func Download(videoUrl, savePath string) error {
cmd := exec.Command("youtube-dl", "-f", "ba", "-x", "--audio-format", "wav", videoUrl, "-o", savePath)
cmd := exec.Command("youtube-dl", "-f", "ba", "-x", "--audio-format", "m4a", videoUrl, "-o", savePath)

var stdout, stderr bytes.Buffer
cmd.Stdout = &stdout
Expand Down
2 changes: 1 addition & 1 deletion pkg/whisper/whisper.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ func Asr(whisperEndpoint, filePath, language string) (*AsrResp, error) {
resp, err := client.R().
SetHeader("Accept", "application/json").
SetFiles(map[string]string{"audio_file": filePath}).
SetQueryString(fmt.Sprintf("task=transcribe&language=%s&encode=false&output=json", language)).
SetQueryString(fmt.Sprintf("task=transcribe&language=%s&encode=true&output=json", language)).
Post(whisperEndpoint + "/asr")

if err != nil {
Expand Down

0 comments on commit 22c701f

Please sign in to comment.