revert 112a7dd70d70f46c6effd05be871fded71063251
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 52s

revert 修改audio文件命名
This commit is contained in:
宋居成 2025-06-18 16:55:09 +08:00
parent 68919732db
commit b0af0899df

View File

@ -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().UnixNano()) originalPath := fmt.Sprintf("audio/original_%d.wav", time.Now().Unix())
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().UnixNano()) audio_path := fmt.Sprintf("trimmed_%d.wav", time.Now().Unix())
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)