Skip to content

Commit

Permalink
Use track ID as audio filenames suffix (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
streamer45 authored Feb 29, 2024
1 parent cc2f4d0 commit 690a47a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/transcriber/call/tracks.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func (t *Transcriber) processLiveTrack(track trackRemote, sessionID string, user
trackID: track.ID(),
sessionID: sessionID,
user: user,
filename: filepath.Join(getDataDir(), fmt.Sprintf("%s_%s.ogg", user.Id, sessionID)),
filename: filepath.Join(getDataDir(), fmt.Sprintf("%s_%s.ogg", user.Id, track.ID())),
}

slog.Debug("processing voice track",
Expand Down
6 changes: 3 additions & 3 deletions cmd/transcriber/call/transcriber_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func TestProcessLiveTrack(t *testing.T) {
close(tr.trackCtxs)
require.Len(t, tr.trackCtxs, 1)

trackFile, err := os.Open(filepath.Join(getDataDir(), fmt.Sprintf("%s_%s.ogg", user.Id, sessionID)))
trackFile, err := os.Open(filepath.Join(getDataDir(), fmt.Sprintf("%s_%s.ogg", user.Id, track.id)))
defer trackFile.Close()
require.NoError(t, err)

Expand Down Expand Up @@ -265,7 +265,7 @@ func TestProcessLiveTrack(t *testing.T) {
close(tr.trackCtxs)
require.Len(t, tr.trackCtxs, 1)

trackFile, err := os.Open(filepath.Join(getDataDir(), fmt.Sprintf("%s_%s.ogg", user.Id, sessionID)))
trackFile, err := os.Open(filepath.Join(getDataDir(), fmt.Sprintf("%s_%s.ogg", user.Id, track.id)))
defer trackFile.Close()
require.NoError(t, err)

Expand Down Expand Up @@ -359,7 +359,7 @@ func TestProcessLiveTrack(t *testing.T) {
close(tr.trackCtxs)
require.Len(t, tr.trackCtxs, 1)

trackFile, err := os.Open(filepath.Join(getDataDir(), fmt.Sprintf("%s_%s.ogg", user.Id, sessionID)))
trackFile, err := os.Open(filepath.Join(getDataDir(), fmt.Sprintf("%s_%s.ogg", user.Id, track.id)))
defer trackFile.Close()
require.NoError(t, err)

Expand Down

0 comments on commit 690a47a

Please sign in to comment.