Skip to content

Commit

Permalink
feat: use ffmpeg in docker to convert webm with more logs and stream …
Browse files Browse the repository at this point in the history
…seek begin.
  • Loading branch information
seilerch committed Aug 26, 2023
1 parent c9731c5 commit 9584ede
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Backend2023/Modules/AudioTransformer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@ public AudioTransformer(HttpClient httpClient, ILogger<AudioTransformer> logger)
public async Task TransformWebAudioStreamToWavFileWithFfmpeg(Stream webAudioStream, string wavFileName)
{
string webAudioFileName = $"{Path.GetTempFileName()}";
webAudioStream.Seek(0, SeekOrigin.Begin);
await using (var fileStream = new FileStream(webAudioFileName, FileMode.Create))
{
await webAudioStream.CopyToAsync(fileStream);
await webAudioStream.FlushAsync();
}

_logger.LogInformation($"Created audioFile:{webAudioFileName}");

ProcessStartInfo psi = new ProcessStartInfo
{
FileName = "ffmpeg", // Use the shell executable (bash)
Expand Down

0 comments on commit 9584ede

Please sign in to comment.