Switch file to io stream in recognizer interface
This commit is contained in:
@@ -2,7 +2,7 @@ package yandex
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"io"
|
||||
|
||||
"git.vakhrushev.me/av/transcriber/internal/entity"
|
||||
)
|
||||
@@ -54,10 +54,9 @@ func (s *YandexAudioRecognizerService) Close() error {
|
||||
return s.sttService.Close()
|
||||
}
|
||||
|
||||
func (s *YandexAudioRecognizerService) RecognizeFile(filePath string) (string, error) {
|
||||
fileName := filepath.Base(filePath)
|
||||
func (s *YandexAudioRecognizerService) Recognize(file io.Reader, fileName string) (string, error) {
|
||||
|
||||
err := s.s3Sevice.uploadFile(filePath, fileName)
|
||||
err := s.s3Sevice.uploadFile(file, fileName)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
Reference in New Issue
Block a user