that's interesting. LowLatency mode has been on my list of things to experiment with for some time, but I haven't got round to it yet. It it does work like that, that will be excellent for audio. You could also do a collect before playback begins.
New Post: NAudio Performance
New Post: NAudio Performance
markheath wrote:that's interesting. LowLatency mode has been on my list of things to experiment with for some time, but I haven't got round to it yet. It it does work like that, that will be excellent for audio. You could also do a collect before playback begins.
It would actually be great to have this built into version 1.7. They recommend that you use Constrained Execution (http://msdn.microsoft.com/en-us/library/ms228973.aspx) and limit the code that runs with low latency mode enabled to a try/finally block. This
could be done in the NAudio processing thread, because often Play() and Stop() are not called from the same method. I would recommend the SustainedLowLatency actually. Glad I could pique your interest on the matter.
New Post: G.727 Support
Hi Mark,
I fully agree that BlockAlign for A-law should be 1. But as far as I can see, it can be greater. In this short example I wanted to show what happens, if you use a BlockAlign 1024, which I use.
I experience the same stumbling when I use a file with a SampleRate of 24000.
New Post: PanSlider Object - How to use?
Hello and Thanks!
I have already a IWavePlayer using a MeteringSampleProvider. So how can I use a MeteringSampleProvider and a PanningSampleProvider in the same Player? Does it work with Stereo Sound or just with Mono?
Moritz :)
Sorry for my bad English!
New Post: Asio Channel offset pairs
I mean is there a way to get the number of Asio Channels, and display them to a combo box?
Like there is for WaveOut.DeviceCount, but add AsioOut.ChannelCount?
New Post: Asio Channel offset pairs
I recently checked in a change that adds properties for this (DriverInputChannelCount and DriverOutputChannelCount)
New Post: Asio Channel offset pairs
Any chance of a code snippet, or could it be included in the NAudio Demo?
Thanks, Wyatt
New Post: WaveFormatConversionStream on WP7
I'm trying to implement a converter such that the 16KHz audio that is recorded by WP7's microphone can be down sampled to 8KHz, ideally ALaw, as is required by an API I'm using and I'd like to use WaveFormatConversionStream.
I've been using PAR for WP7 as an example as it includes a subset of NAudio that works on the phone, WaveFormatConversionStream isn't included in that by default and I was wondering if it will even function on the phone as I'm not sure what codecs are included on the platform.
Has anyone succeeded in this or is it not feasible? Any tips welcome if another method is possible too.
Thanks,
JB
New Post: G.727 Support
Hi Mark,
do you think it is a calibration thing, or do you suggest to solve it differently?
New Post: WaveFormatConversionStream on WP7
You can't use WaveFormatConversionStream on the Windows Phone as it calls into the ACM APIs which are not available.
However, I have implemented fully managed a-law encoding and decoding in NAudio, so you could use that instead.
New Post: Asio Channel offset pairs
Just call those properties on AsioOut. They return integers.
New Post: WaveFormatConversionStream on WP7
Ah, good to hear it is possible and thanks for setting me on the right track. No pun intended...
I'll have a look for the ALaw conversion methods and will give them a go.
Thanks,
JB
New Post: PanSlider Object - How to use?
You pipe them through each other. So pass the MeteringSampleProvider into the PanningSampleProvider (or the other way round, depending if you want to meter the sound before it is panned or not).
Mark
New Post: G.727 Support
I'm not sure what you mean by "stumbling". 24000 is also possibly not suppored by all soundcards. 22050 is more likely.
New Post: G.727 Support
Hi Mark,
I have PCM, aLaw and ADPCM2, 3, 4 & 5 data with sample rates of 8000, 12000, 16000 and 19200.
For PCM and aLaw also 24000. My soundcard had never a problem with any of these sample rates. When I provided a wrong sample rate on purpose, it played it slowlier or faster.
Have you tried the example? Of course you have to use the sample rate of your file.
But please ignore this if you are busy. Today I solved that issue by providing exactly 2880 bytes. The rest is buffered for the next Read call. Now I have no problems.
Best regards
Karsten
New Post: Asio Channel offset pairs
Thanks Mark.
Is there a way to get AsioOut.GetCapabilities?
Sorry for the confusion.
Heres what I'm trying to do.
Here's an example on a windows form with a button and listbox using WaveOut.
Is it possible to do this with AsioOut?
PrivateSub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click ListBox1.Items.Add("Wave in :")Dim waveInDevices AsInteger = WaveIn.DeviceCountFor waveInDevice AsInteger = 0 To waveInDevices - 1Dim deviceInfo As WaveInCapabilities = WaveIn.GetCapabilities(waveInDevice) ListBox1.Items.Add("Device {0}: {1}, {2} channels"&" , "& Convert.ToString(waveInDevice) &" , "& Convert.ToString(deviceInfo.ProductName))Next waveInDevice ListBox1.Items.Add("Wave out :")Dim waveOutDevices AsInteger = waveOut.DeviceCountFor waveOutDevice AsInteger = 0 To waveOutDevices - 1Dim deviceInfo As WaveOutCapabilities = WaveOut.GetCapabilities(waveOutDevice) ListBox1.Items.Add("Device {0}: {1}, {2} channels"&" , "& Convert.ToString(waveOutDevices) &" , "& Convert.ToString(deviceInfo.ProductName))NextEndSub
New Post: Need help with exception thrown by NAudio
Thanks, it doesn't seem like there has been any progress in the bug report you listed.
Is there anything I can do to help? What I'm working on is a simple tool to help friends and family and while not critical, it is pretty annoying to have that Windows diag pop up every now and then.
New Post: Need help with exception thrown by NAudio
Yes, you could do a null check, although I can't understand what is causing it to be null. What callback model are you using.
Alternatively, you could try using WaveInEvent instead, which may be more reliable.
Mark
New Post: Asio Channel offset pairs
unfortunately I you have to open the ASIO device to query it for channel count, so you'd have to write your own code that creates a new instance of AsioOut for each driver and asks it for these properties.
New Post: G.727 Support
You can try wrapping your waveformatconversionstream in a blockalignreductionstream before passing it to waveout, which might help. I still can't understand why you'd need to change blockalign for a-law. I use a-law all the time with NAudio and have never needed to do that. Your file has an asf extension, which suggests to me that there is more than just raw audio in the file.
As for sample rates, I suspect that windows is using another WaveFormatConversionStream under the hood to do SRC on the fly. This might account for some of the issues you have.