Quantcast
Channel: NAudio
Viewing all 5831 articles
Browse latest View live

Edited Issue: ASIO number of channels [16365]

$
0
0
Hello,
I do not understand why the properties NumberOfInputChannel NumberofOutputChannel ASIO drivers and was always zero while the function getChannels is correct.
So I added a few lines in the class ASIOOut, function InifromName, properties that are functional.

private void initFromName(String driverName)
{
// Get the basic driver
ASIODriver basicDriver = ASIODriver.GetASIODriverByName(driverName);

///////////////////////////////////////////// Add Channels Number
int nbchannelin;
int nbchannelout;
basicDriver.getChannels(out nbchannelin, out nbchannelout);

NumberOfInputChannels = nbchannelin;
NumberOfOutputChannels = nbchannelout;
////////////////////////////////////////////// End Add
// Instantiate the extended driver
driver = new ASIODriverExt(basicDriver);
this.ChannelOffset = 0;
}

there is little to be another way for these parameters!

Edited Issue: ASIO number of channels [16365]

$
0
0
Hello,
I do not understand why the properties NumberOfInputChannel NumberofOutputChannel ASIO drivers and was always zero while the function getChannels is correct.
So I added a few lines in the class ASIOOut, function InifromName,
and I added two property CapacityNumberOfOutputChannels ,CapacityNumberOfInputChannels

private void initFromName(String driverName)
{
// Get the basic driver
ASIODriver basicDriver = ASIODriver.GetASIODriverByName(driverName);

///////////////////////////////////////////// Add Channels Number
int nbchannelin;
int nbchannelout;
basicDriver.getChannels(out nbchannelin, out nbchannelout);

CapacityNumberOfInputChannels = nbchannelin;
CapacityNumberOfOutputChannels = nbchannelout;
////////////////////////////////////////////// End Add
// Instantiate the extended driver
driver = new ASIODriverExt(basicDriver);
this.ChannelOffset = 0;
}

public int CapacityNumberOfOutputChannels { get; private set; }
public int CapacityNumberOfInputChannels { get; private set; }

there is little to be another way for these parameters!

New Post: Newbie Asio Playback Question

$
0
0

that's strange. I'm not a VB.NET developer but I cans see anything obviously wrong there. Could it be the garbage collector kicking in? ASIO works at a very low latency, and so if the garbage collector kicks in at an inopportune moment, it can cause stuttering and there is nothing much that can be done about it.

New Post: Overlapping .wav files in NAudio

$
0
0

yes, you have to go to IEEE before going into the mixer. WaveChannel32 can do this if you are using WaveMixerStream32.

Another option is to use AudioFileReader instances and pass them into MixingSampleProvider. Then do SampleToWaveProvider16 afterwards

Commented Issue: ASIO number of channels [16365]

$
0
0
Hello,
I do not understand why the properties NumberOfInputChannel NumberofOutputChannel ASIO drivers and was always zero while the function getChannels is correct.
So I added a few lines in the class ASIOOut, function InifromName,
and I added two property CapacityNumberOfOutputChannels ,CapacityNumberOfInputChannels

private void initFromName(String driverName)
{
// Get the basic driver
ASIODriver basicDriver = ASIODriver.GetASIODriverByName(driverName);

///////////////////////////////////////////// Add Channels Number
int nbchannelin;
int nbchannelout;
basicDriver.getChannels(out nbchannelin, out nbchannelout);

CapacityNumberOfInputChannels = nbchannelin;
CapacityNumberOfOutputChannels = nbchannelout;
////////////////////////////////////////////// End Add
// Instantiate the extended driver
driver = new ASIODriverExt(basicDriver);
this.ChannelOffset = 0;
}

public int CapacityNumberOfOutputChannels { get; private set; }
public int CapacityNumberOfInputChannels { get; private set; }

there is little to be another way for these parameters!
Comments: good idea, I might use different names though, perhaps DeviceInputChannels and DeviceOutputChannels

Commented Issue: ASIO number of channels [16365]

$
0
0
Hello,
I do not understand why the properties NumberOfInputChannel NumberofOutputChannel ASIO drivers and was always zero while the function getChannels is correct.
So I added a few lines in the class ASIOOut, function InifromName,
and I added two property CapacityNumberOfOutputChannels ,CapacityNumberOfInputChannels

private void initFromName(String driverName)
{
// Get the basic driver
ASIODriver basicDriver = ASIODriver.GetASIODriverByName(driverName);

///////////////////////////////////////////// Add Channels Number
int nbchannelin;
int nbchannelout;
basicDriver.getChannels(out nbchannelin, out nbchannelout);

CapacityNumberOfInputChannels = nbchannelin;
CapacityNumberOfOutputChannels = nbchannelout;
////////////////////////////////////////////// End Add
// Instantiate the extended driver
driver = new ASIODriverExt(basicDriver);
this.ChannelOffset = 0;
}

public int CapacityNumberOfOutputChannels { get; private set; }
public int CapacityNumberOfInputChannels { get; private set; }

there is little to be another way for these parameters!
Comments: Yes why not

New Post: Newbie Asio Playback Question

$
0
0

Hi Mark.

Thanks again for your patience on this.

I don't think that's the problem. I wish I had an example of just the Asio Direct Playback on a windows form. I'm having trouble with the panel.

I tried to do this on a windows form in c# (basically I copied and pasted the demo code), and it builds ok, and it works, but still stutters on stop.

This has me thinking that I'm definitely doing something wrong when I can build, and play the demo that you have with no stuttering, but when I use the same code on a form instead of a panel, it does. Hope this make sense.

Anyway, here's a link to my solution file. If you have a chance, could you take a look at it?

Thanks, Wyatt

 

New Post: Noise in playback start

$
0
0

Hi all! 

Sorry if this is already discussed question, I tried but couldn't find an answer here.

I need to allow user to listen some part of MP3 file. To do this I basically follow example from documentation, my code looks like this:

private Mp3FileReader _mp3Reader; 
private WaveOut _wavePlayer; 
private Timer _timer;
private double? _endSec;


		public void Play( double startSec, double? endSec )
		{
			_endSec = endSec;

			_mp3Reader.CurrentTime = new TimeSpan( (long)( startSec * 10000000 ) );

			_wavePlayer.Play();

			_timer.Start();
		}


		private void Timer_Tick( object sender, EventArgs e )
		{
			if( _endSec.HasValue && _mp3Reader.CurrentTime.TotalSeconds >= _endSec.Value )
				Stop();
		}

Everething is great at first time. But when I click Play next time I hear a distinct noise during the first miliseconds of playback. If at the end of the previous playback there was silence, then there will be no noise next time, if at the end of the previous playback was loud sound, then noise will be loud.

It looks like some internal sound buffer is left with a few milliseconds of sound from previous playback, and so next playback first plays that leftover of previous playback. Is there some way to clear these internal buffers? have you met such problem and what are solutions for it?

Thanks!

Sergey P.


New Post: Noise in playback start

$
0
0

Hi,

I have the same problem. Not only with the MP3 file (wav too) and all type of drivers (Wave, WASAPI, ASIO).

More generally, it remains a part of the buffer already read.

The number of remaining sample is proportional to the latency.

To make a simple test must be PLAY (listen to the song to a highlight). PAUSE and then move to the position (quiet time) and then PLAY. there is data in the buffer.

 

New Post: Noise in playback start

$
0
0

If you reposition, you should stop. Pause is supposed to keep things in the buffer, and WaveOut has no knowledge that you have repositioned.

Stopping however should flush the buffers, and if it isn't doing that there is a bug somewhere.

New Post: Noise in playback start

New Post: Noise in playback start

$
0
0

I think this is not really a bug, euhmmm

But one way to do it.

In your demo after every STOP,  you unload fileStream waveOut and reset with each PLAY.

The problem arises when initializing the beginning, and playing with Play, Pause, Stop

I do not know the structure of SergeyPo but I think it is the same problem.

New Post: Noise in playback start

$
0
0

Hi!

I don't use Pause, only Play and Stop -- exactly as in my code excerpt. So, obviously there is something with Stop method - it doesn't clear buffer.

New Post: Noise in playback start

$
0
0

Hi, I've found the bug. It's not in any of the output devices. It is in the Mp3FileReader class. The MP3 decoder needs to be alerted that you have repositioned. I've prototyped a fix, but it is a breaking change as it modifies the IMp3FrameDecompressor interface, so I'll need to think about how best to introdduce the change.

Source code checked in, #83c2d5b2e527

$
0
0
fixing a bug in Mp3FileReader where repositioning didn't flush the decoder buffer. Requires a new method on IMp3FrameDecompressor. DmoMp3FrameDecompressor and AcmMp3FrameDecompressor both updated to properly flush buffers on reposition

New Post: Noise in playback start

$
0
0

I've checked in a fix. If you build the very latest NAudio you should be able to test it out for yourself. I'll hopefully get a new build up on NuGet soon.

New Post: Noise in playback start

$
0
0

Mark, thank you for such a quick response!

I've downloaded and compiled the latest version of source codes but the bug is still here. :(

Can you check fix again?

New Post: Noise in playback start

$
0
0

Can you try the Simple Audio Playback demo in NAudio Demo and click the MP3 test button. It will ask you to select an MP3 file and then bring up a very simple form with Play Stop and Rewind. Click Play, then Stop, then Rewind, and then Play again. You shouldn't hear any left-over buffer sound if my fix worked properly. Let me know how you get on with that, and then we'll see if there is another unresolved issue.

New Post: Noise in playback start

$
0
0

Yes congratulations to speed for the update.

For me the problem is gone :-))

New Post: Noise in playback start

$
0
0

Hi, Mark!

I tried Simple Audio Playback demo -- the left-over is still here. You can try this file if you like http://www.filedropper.com/testaudio but actually I can reproduce it on any MP3 file, just you need to press Stop at the moment when sound is loud.

Viewing all 5831 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>