changes based on comments
This commit is contained in:
parent
444ffcd2a9
commit
642c09711f
|
|
@ -12,7 +12,6 @@ namespace BotSharp.Plugin.AudioHandler.Controllers
|
|||
#if DEBUG
|
||||
[AllowAnonymous]
|
||||
#endif
|
||||
[Route("[controller]/text/[action]")]
|
||||
[ApiController]
|
||||
public class AudioController : ControllerBase
|
||||
{
|
||||
|
|
@ -23,7 +22,7 @@ namespace BotSharp.Plugin.AudioHandler.Controllers
|
|||
_audioService = audioService;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[HttpGet("audio/transcript")]
|
||||
public async Task<IActionResult> GetTextFromAudioController(string audioInputString)
|
||||
{
|
||||
#if DEBUG
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ public class AudioProcessUtilities : IAudioProcessUtilities
|
|||
public Stream ConvertMp3ToStream(string mp3FileName)
|
||||
{
|
||||
var fileStream = File.OpenRead(mp3FileName);
|
||||
var reader = new Mp3FileReader(fileStream);
|
||||
using var reader = new Mp3FileReader(fileStream);
|
||||
if (reader.WaveFormat.SampleRate != 16000)
|
||||
{
|
||||
var wavStream = new MemoryStream();
|
||||
|
|
@ -31,7 +31,7 @@ public class AudioProcessUtilities : IAudioProcessUtilities
|
|||
public Stream ConvertWavToStream(string wavFileName)
|
||||
{
|
||||
var fileStream = File.OpenRead(wavFileName);
|
||||
var reader = new WaveFileReader(fileStream);
|
||||
using var reader = new WaveFileReader(fileStream);
|
||||
if (reader.WaveFormat.SampleRate != 16000)
|
||||
{
|
||||
var wavStream = new MemoryStream();
|
||||
|
|
|
|||
|
|
@ -10,6 +10,6 @@ namespace BotSharp.Plugin.AudioHandler.Models
|
|||
public class AudioInput
|
||||
{
|
||||
public string FilePath { get; set; }
|
||||
public Stream stream { get; set; }
|
||||
public Stream Stream { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue