Hi All I have an application which receives simultaneously wav data through multiple threads from different UDP ports:
Is it possible to play all received wav data at same time, simultaneously, using Wave Out API?
Is it possible to play all received wav data at same time, simultaneously, using NAudio? does NAudio objects thread safe?
saying play simultaneously I mean case when a file played in media player and something in YouTube played at the same time and you can hear both sound from your speakers at the same time:
Any help or hint would be appreciated. Thanks in advance.
Yes, you can do it with multiple instances of WaveOut (one for each stream), or you can do it with a single WaveOut and mix it yourself (e.g. with the MixingSampleProvider)
I think that you can do that.
this tutorial can help you :http://msdn.microsoft.com/en-us/magazine/cc163455.aspx
It explane how to integrate a video but I think that the used Library can play audio
Related
I want to have a functionality of recording a conversation between two person. I want to do it in a such a way that the outgoing sound be on 1 channel and incoming sound on another channel. So finally i get a stereo file(mp3) file having 2 channels.
For now I am looking to achieve this is windows form and then eventually target xamarin.forms(android, iOS, windows).
Any way to achieve this in c#? Or any plugin available for this?
FFMPEG is a good tool for video or audio manipulation. I've only used it with video, but looks like it can encode two audio channels. Have a look at
this, hope it is helpful
Very similar to this question, I have I networked micro-controller which collects PCM audio (8-bit, 8 kHz) and streams the data as raw bytes over a TCP network socket. I am able to connect to the device, open a NetworkStream, and create a RIFF / wave file out of the collected data.
I would like to take it a step further, and enable live playback of the measurements. My approach so far has been to buffer the incoming data into multiple MemoryStream's with an appropriate RIFF header, and when each chunk is complete to use System.Media.SoundPlayer to play the wave file segment. To avoid high latency, each segment is only 0.5 seconds long.
My major issue with this approach is that often there is a distinctive popping sound between segments (since each chunk is not necessarily zero-centered or zero-ended).
Questions:
Is there a more suitable or direct method to playback live streaming PCM audio in C#?
If not, are there additional steps I can take to make the multiple playbacks run more smoothly?
I don;t think you can manage it without popping sounds with the SoundPlayer, because there shouldn't be any delay in pushing the buffers. Normally you should always have one extra buffer buffered. But the SoundPlayer only buffers one buffer. Even when the soundplayer gives an event that it is ready, you're already too late to play a new sound.
I advise you to check this link: Recording and Playing Sound with the Waveform Audio Interface http://msdn.microsoft.com/en-us/library/aa446573.aspx
There are some examples of the SoundPlayer (skip those), but also how to use the WaveOut. Look at the section Playing with WaveOut.
The SoundPlayer is normally used for notification sounds.
I have sound stored in database in byte[] type. I can easily play with SoundPlayer, but not with MediaPlayer. Nice thing about MediaPlayer is I can play from middle of the sound. SoundPlayer doesn't have this feature. Is there way to play sound which stored in database with MediaPlayer(not from the filesystem).
Any help appreciated.
Unfortunately the MediaPlayer class can only Open media from the file system - it's simply a limitation. It's only option is to receive a Uri. However, I would recommend leveraging NAudio. With NAudio you can in fact play, pause, stop, rewind, and more all in memory.
How do I play 3 different music tracks at the same time on my computer, such that song1 is played in speaker1, song2 in speaker2...
Is this possible programatically? What additional hardware will I need? Do I need 3 seperate sound cards? Given that the hardware is in place, how would I "route" the sound output for a particular song to a particular speaker.
Alternatively, is there a special hardware that can handle multiple inputs and outputs?
Appreciate your expert opinions.
http://www.esi-audio.com/products/maya44usb+/ Try this with the NAudio c# Libary look at AsioOut and the MultiplexingWaveProvider
Provided that you have as many outputs (total) as you have songs you are all set (I'm assuming you'll just be playing each song in mono). The simplest way to tackle this problem is to open one "stream" for each song and play the song through that stream. You'll have to do some work to open each stream with the right number of channels and ensure that the song is played in the correct channel.
There are two potential problems with that technique: 1. some audio API/hardware combinations don't allow multiple streams to access the same device. This is most commonly an issue on windows/ASIO, but it may be an issue in other cases -- I am not a windows expert. 2. it is a bit tricky to ensure that all streams are exactly synchronized. If you require tight synchronization you should use a single stream and a single hardware device.
If the above issues are a concern, then you should get some audio hardware with at lest three outputs, and open one stream with access to three channels.
You can use PortAudio for audio I/O, and libsoundfile for reading the sound files (of course, there are other options for both these tasks).
I need to make a Windows applications which takes audio input (from microphone) and plays immediately to the speaker. If I explain in short, nI eed to make an application which can test my microphone.
I have been exploring Naudio and wmp libraries over the last 3 days but I couldn't get enough help to create it. But I know using these libraries there must be a way to create such an application.
Thanks in anticipation.
You can use two ways
csaudio //hard way, but realy nice
How-record-voice-from-microphone //easy way
EDIT
At list try this
Voice Recorder (here using naudio its opensource)