naudio

How to convert wav file to mp3 in memory?

混江龙づ霸主 提交于 2021-02-07 09:13:07
问题 I have an application written using c# on the top of Asp.Net MVC 5 framework. My objective is to make a call to 3rd party service to download a wave file. Then I want to convert this file into mp3. Finally, I want to return the mp3 file as (byte[]) to allow the user to download it directly from memory. Here is how my code will end up which allow the user to download the converted file from the memory public ActionResult Download(int? id) { // Download and convert the file // the variable

How to convert wav file to mp3 in memory?

烂漫一生 提交于 2021-02-07 09:12:49
问题 I have an application written using c# on the top of Asp.Net MVC 5 framework. My objective is to make a call to 3rd party service to download a wave file. Then I want to convert this file into mp3. Finally, I want to return the mp3 file as (byte[]) to allow the user to download it directly from memory. Here is how my code will end up which allow the user to download the converted file from the memory public ActionResult Download(int? id) { // Download and convert the file // the variable

Discord.net can't stream audio with NAudio

北城以北 提交于 2021-02-05 09:12:10
问题 I want to play an mp3 file in a voice channel. The BOT successfully can connect, but doesn't play anything, and throws an exception. Code public async Task SendAudioAsync(IGuild guild, IMessageChannel channel, string path) { try { if (!File.Exists(path)) { await channel.SendMessageAsync("File does not exist."); return; } IAudioClient client; if (ConnectedChannels.TryGetValue(guild.Id, out client)) { await Log.d($"Starting playback of {path} in {guild.Name}", src); using (var reader = new

Resampling WasapiLoopbackCapture

非 Y 不嫁゛ 提交于 2021-01-28 19:27:22
问题 I'm trying to resample the WasapiLoopbackCapture's output from my soundcards 44100Hz, 16bit, 2 channel waveformat to a 16000Hz, 16bit, 1 channel format for later use in a System.Net.Sockets.NetworkStream (I want to write the converted bytes to the network stream) But I have no idea how to start even! I'm really new to signal processing and I've tried searching for tutorials but I just can't wrap my head around how to do this. Here's what I got so far: void StartRecording() { capture = new

How to send live audio stream to IBM Watson Speech-To-Text immediately without saving audio file locally using C# and IBM Watson SDK?

本秂侑毒 提交于 2020-11-29 19:12:57
问题 I have a requirement to use IBM Watson SDK to record the audio using microphone and send it to IBM Watson speech-to-text using C#. I am able to achieve this functionality by saving the audio file locally and then sending it using NAudio library. But my requirement is to use streaming mode to send live audio to IBM Watson Speech-to-Text service without storing the audio file physically. I am not able to find RecognizeUsingWebSocket service in the SDK. I am able to find only Recognize service.

How to VoIP using NAUDIO

旧巷老猫 提交于 2020-07-22 21:52:31
问题 I'm developing a voip server-client app using NAUDIO and Sockets. I've read the naudio's documentation and I have tried alot to get the data from the microphone then send it to the client, the thing that you can get the data, but you have to save it to a byte array first then send it which is almost like sending a file using TCP. How can I get data from naudio and send it at the same time "Stream it" to the client using UDP protocol. Thanks in advance. 回答1: NAudio has a Network Chat Demo

How to VoIP using NAUDIO

淺唱寂寞╮ 提交于 2020-07-22 21:51:53
问题 I'm developing a voip server-client app using NAUDIO and Sockets. I've read the naudio's documentation and I have tried alot to get the data from the microphone then send it to the client, the thing that you can get the data, but you have to save it to a byte array first then send it which is almost like sending a file using TCP. How can I get data from naudio and send it at the same time "Stream it" to the client using UDP protocol. Thanks in advance. 回答1: NAudio has a Network Chat Demo

Choppy Audio with Naudio and TCP Stream. Buffer Full Exception

荒凉一梦 提交于 2020-06-29 02:56:33
问题 I am attempting to stream audio using Naudio over a TCP connection. The problem is the audio sounds choppy. I believe this is because I am getting an exception saying the buffer is full when I try to add samples to the bufferedwaveprovider. I have tried increasing the buffer size however the result remains unchanged. -----CLIENT CODE----- public TcpClient client; public WaveOut waveplayer = new WaveOut(); public BufferedWaveProvider bwp = new BufferedWaveProvider(new WaveFormat(8000, 16, 1));

Naudio,how to tell playback is completed

孤街醉人 提交于 2020-05-26 04:02:47
问题 I am using the NAudio library to write a simple WinForms audio recorder/player. My problem is how can I tell that playback is completed? I need to close the wave stream after that. I knew there is a PlaybackStopped event listed below: wfr = new NAudio.Wave.WaveFileReader(this.outputFilename); audioOutput = new DirectSoundOut(); WaveChannel32 wc = new NAudio.Wave.WaveChannel32(wfr); audioOutput.Init(wc); audioOutput.PlaybackStopped += new EventHandler<StoppedEventArgs>(audioOutput