Is it possible to play a sound on a playback device that is not set as default playback device?
I need to play multiple files simultaniously trough multiple output devices.
Does anyone knows a solution for .net? (C#)
Thanks!
you will have to go to lower level API. You can try find C# wrapper for Wasapi, ASIO, DirectSound or MediaFoundation. Maybe XNA framework could do the job, which is managed framework over directX
well I was playing around with similar issue.
XNA could not do send output to specific device.
I have ended out with http://naudio.codeplex.com/, which is exactly what you need. It's C# wrapper for Wasapi, ASIO, DirectSound libraries. It also includes many very helpful classes for converting, decoding, visualizing etc. For simple player, check out NAudioDemo sample project.
find out CreateWaveOut() method. This is where you should select your playbackdevice.
for example:
MMDevice device = new MMDeviceEnumerator()
.EnumerateAudioEndPoints(DataFlow.Render, DeviceState.All)
.FirstOrDefault(d => d.ID == "yourplaybackdeviceid");
IWavePlayer waveOut = new WasapiOut(device, AudioClientShareMode.Shared, false, latency);
Download the naudio library from sourcecode tab not from Download->Release, it's not very actual and it's little buggy.
another good tool is bass.net
http://www.un4seen.com/
Related
I'm trying to create a background application that allows me to easily change volumes of the rear channels
I've looked into the Core Audio API, and although I managed to change the balance/volume of the front speakers, the API seemingly had no access to the rear channels or any other surround channel. It only counted 2 channels for my audio device.
Is it in any way possible, using any API, to control the rear channel's volume?
Thanks in advance!
EDIT
Thanks, FMOD looks like what I need, although it's a bit overwhelming. :P What would I need to do, to change the volume of a specified channel. I believe I need this function:
FMOD.RESULT result = channel.setVolume(1.0f);
But then I need to find a way to specify the channel...
Also, to be clear: I need to change the volume of any running application, say Winamp.
Best chose for working with audio file is "Fmod.dll".this have a lot of Privilege to work with audio file.
This is an audio content creation tool for games, with a focus on a
‘Pro Audio’ approach. It has an entirely new interface that will be
more familiar to those using professional Digital Audio Workstations
than existing game audio tools and is loaded with new features.
I already use this,this is very powerful component and easy to use.
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)
Is it possible to use the NAudio on a silverlight application?
I just can't add the dll to my project... I'd like to build a little audio mixer.
I already searched on google but i can't find a way to do that...
someone has some hints for it???
NAudio uses tons of interop into Win32 functions that would be completely impossible to run in Silverlight.
UPDATE:
If you are looking for an MP3 player for Silverlight you may check out the Silverlight Audio Player.
I was wondering if there was a simple way to record audio, and have it saved as an object of any sort.
My personal goal is to eventually record audio, save it to a "channel", allow for multiple channels, and play them back simultaneously.
This project on CodeProject provides some classes for capturing audio. It uses Managed DirectX, which has been deprecated, so you might want to look into using SlimDx as a wrapper around DirectSound instead.
You could take a look into the OpenAL wrapper in OpenTK.
It should have what you need in it. The AudioCapture and AudioContext classes will collect your data, and then AL.SourcePlay() can be used to play multiple contexts together.
Is there a way to get the sound that the sound card is playing directly from the hardware?
NAudio is a nice API for sound programming in C#. I'm only discovered it myself, but it might be able to record the output, though probably not...
http://www.codeplex.com/naudio
some sound cars can select the output sound as mic, if that is acceptable then you could just google how to use the microphone...
The most general way is Total Recorder which has a COM interface.
I presume that this is Windows since you are using C#. Ignore this if you are using mono.
There is no officially supported way to do this in Windows. Some sound cards have a setting in the mixer that will set the wave record input to 'what you hear'. So on those cards, you could just set that setting and then record audio.
edit:
I should add that if your driver doesn't have built in support for recording what it's outputing, then you will need to write or purchase a driver that does. I've heard that TotalRecorder can do this.