修改audio文件命名
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 2s
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 2s
This commit is contained in:
parent
927406b6c8
commit
112a7dd70d
@ -303,7 +303,7 @@ func (s *LLMService) handleStreamingResponse(req *http.Request, data map[string]
|
|||||||
fmt.Printf("Error reading audio data: %v\n", err)
|
fmt.Printf("Error reading audio data: %v\n", err)
|
||||||
} else {
|
} else {
|
||||||
// Save original audio first
|
// Save original audio first
|
||||||
originalPath := fmt.Sprintf("audio/original_%d.wav", time.Now().Unix())
|
originalPath := fmt.Sprintf("audio/original_%d.wav", time.Now().UnixNano())
|
||||||
if err := os.WriteFile(originalPath, audioBytes, 0644); err != nil {
|
if err := os.WriteFile(originalPath, audioBytes, 0644); err != nil {
|
||||||
fmt.Printf("Error saving original audio: %v\n", err)
|
fmt.Printf("Error saving original audio: %v\n", err)
|
||||||
}
|
}
|
||||||
@ -315,7 +315,7 @@ func (s *LLMService) handleStreamingResponse(req *http.Request, data map[string]
|
|||||||
fmt.Printf("Error trimming audio silence: %v\n", err)
|
fmt.Printf("Error trimming audio silence: %v\n", err)
|
||||||
} else {
|
} else {
|
||||||
// Save the trimmed audio as WAV file
|
// Save the trimmed audio as WAV file
|
||||||
audio_path := fmt.Sprintf("trimmed_%d.wav", time.Now().Unix())
|
audio_path := fmt.Sprintf("trimmed_%d.wav", time.Now().UnixNano())
|
||||||
outputPath := "audio/" + audio_path
|
outputPath := "audio/" + audio_path
|
||||||
if err := s.SaveBase64AsWAV(trimmedAudio, outputPath); err != nil {
|
if err := s.SaveBase64AsWAV(trimmedAudio, outputPath); err != nil {
|
||||||
fmt.Printf("Error saving trimmed WAV file: %v\n", err)
|
fmt.Printf("Error saving trimmed WAV file: %v\n", err)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user