Skip to content

Commit

Permalink
disable audio streaming
Browse files Browse the repository at this point in the history
  • Loading branch information
seilc1 committed Aug 25, 2024
1 parent bf5e6d5 commit 05a0a32
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/TrackMate.Backend.RestApi/Hubs/TrackNodeHub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public async Task UploadTrackPositionPicture(UploadTrackPositionPicture uploadTr

if (result.type == TrackUpdateResultType.NewInstruction)
{
await Clients.Caller.SendAsync("InstructionAudio", Convert.ToBase64String(ReadAllBytesFromStream(result.instructionAudio!)));
// await Clients.Caller.SendAsync("InstructionAudio", Convert.ToBase64String(ReadAllBytesFromStream(result.instructionAudio!)));
await SendToTrackAsync(uploadTrackPositionPicture.TrackId, "InstructionText", result.instruction);
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/Trackmate.Backend/Tracks/TrackService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,11 @@ public async Task<TrackUpdateResult> UpdateTrackAsync(
nextTrackNodeModel.Location);

string instructionText = await instructionsClient.CreateInstructionTextAsync(instructionRequestModel);
Stream audioStream = await instructionsClient.CreateInstructionAudioAsync(instructionRequestModel);
// disabled for debugging
// Stream audioStream = await instructionsClient.CreateInstructionAudioAsync(instructionRequestModel);
logger.LogInformation("Instruction generated ({elapsedMiliseconds}ms)", stopwatch.ElapsedMilliseconds);

return TrackUpdateResult.NewInstruction(instructionText, audioStream);
return TrackUpdateResult.NewInstruction(instructionText, null);
}

track.VisitedNodes.Add(new VisitedTrackNodeModel(currentTrackNode, DateTimeOffset.Now));
Expand Down
2 changes: 1 addition & 1 deletion src/Trackmate.Backend/Tracks/TrackUpdateResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ public static TrackUpdateResult NoLocation
public static TrackUpdateResult LocationUpdated
=> new TrackUpdateResult(TrackUpdateResultType.LocationUpdated);

public static TrackUpdateResult NewInstruction(string instruction, Stream instructionAudio)
public static TrackUpdateResult NewInstruction(string instruction, Stream? instructionAudio)
=> new TrackUpdateResult(TrackUpdateResultType.NewInstruction, instruction, instructionAudio);
}

0 comments on commit 05a0a32

Please sign in to comment.