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

New Post: InvalidOperationException on playing some MP3 files

$
0
0

I put that exception in to show that the MP3 is not playable by NAudio. The only options when you get a sample rate change in NAudio are to close your WaveOut device and open another at the new sample rate, or to put a resampler in your audio pipeline. I'm hoping that NAudio 1.7 will have a WaveFormatChanged event on Mp3FileReader, allowing people to disable this exception and write their own handling logic for format changes. Currently though, you'd have to create your own customised Mp3FileReader to play files like this.

It should be very rare that MP3s contain frames of different sample rates. It is usually a sign someone has tried to concatenate parts of two completely different MP3 files/


Commented Issue: WMA [16370]

$
0
0
Hello,
the WMA file only works with WaveOut () standard.

With other DriverOut, I receive an error message from WMAStream function Read
(GetNextSample).

Tested with your NAudio Demo 1.6
Comments: the problem is definitely related to threading. I'll maybe try the solution here at some point: http://stackoverflow.com/questions/1233468/unable-to-cast-com-object-of-type-exception

New Post: InvalidOperationException on playing some MP3 files

$
0
0

Oh, okay...because I'm playing the sample music in Windows 7. One of them gave me that exception.

New Post: Audio Samplerate

$
0
0

Hello,

I'm using some very simple code to open and play a wave file, using a DirectSoundOut object.  If I open a 44.1kHz wave file to start, then the output on WinXP is 44.1kHz to my USB sound card.  If I open a 48kHz wave file to start, then the output on WinXP is 48kHz.  However, once I've opened one file, the sample rate is stuck at that value until I close and re-open the application.

I've tried disposing the DirectSoundOut object between wave files, and have run a full GC.Collect() to try to call the finalizers/etc on the objects.  I then re-create everything from scratch, but it looks like Windows is somehow caching the previous samplerate.  This causes samplerate conversion artifacts in my sound.  Is there any way around this using NAudio?

With the new Windows Core Audio functionality (Win8/7/Vista) I can create an IAudioClient and using the IAudioClockAdjustment interface to set the samplerate of the audio device, but this is a pain and most likely will not work in WinXP.  I'd like to solve this with NAudio if possible.

Cheers,

Giawa

New Post: Choppy Audio While Testing NetworkChatDemo

$
0
0

Good Afternoon,

 

I've been testing the network chat demo and I noticed that when the host computer begins streaming, the audio coming from the microphone works well.  However, when another client connects, the audio becomes choppy and it's hard to hear anything.  What might be causing this and what would I need to look at to fix the problem?

 

Thanks

New Post: Choppy Audio While Testing NetworkChatDemo

$
0
0

the demo code doesn't support multiple clients. You'd need a separate BufferedWaveProvider for each incoming stream and then mix them together with the MixingSampleProvider.

New Post: Choppy Audio While Testing NetworkChatDemo

$
0
0

Thank you for clearing that up for me.  I didn't realize that the demo didn't support more than one client.

New Post: About audio level alignment

$
0
0

I found the maximum amplitude of a wavefile1 in respect to 1. I want to play awavefile2 whose maximum amplitude is at 1 with the same volume in realtime aswavefile1 to have them at equal volume when playing together; in other words:

How to multiply the amplitude of wavefile2 with - for instance - 0.3 in realtime?

What would be the elegant way to do this with NAudio?


New Post: Audio Samplerate

$
0
0

The actual sample rate that the sound card runs at is determined by the operating system, and NAudio is not able to control it with the waveOut or DirectSound out APIs.

Commented Issue: the Mp3FileReader should not set stream position [16371]

$
0
0
It appears that we could add a few smarts to the Mp3FileReader and make it so that it would not have to use the Position property on the stream. Not all streams (especially web streams) allow the Seek operation. Also, the Mp3FileReader makes no attempt to check the CanSeek flag on the stream.

It would be okay to set stream position if the user wanted to adjust the playback position. However, that functionality should be disabled when the stream does not allow seeking or it should only be functional in some kind of cached data.
Comments: Mp3FileReader is for reading MP3 files. Use the code from the NAudio MP3 streaming demo for streaming MP3s which are not seekable.

New Post: About audio level alignment

$
0
0

You can adjust volume using any of the SampleProviders or WaveProviders with a volume property. For example, if you use AudioFileReader, then you can simply set its Volume to 0.3

New Post: Need help with exception thrown by NAudio

$
0
0

not sure what is causing this, I'll try to reproduce if possible. It is possibly related to http://naudio.codeplex.com/workitem/16347

Edited Feature: AutoCue [16366]

$
0
0
I created a class on the basis of AudioFileReader to integrate an Autocue option (as with CD Player) to readjust the beginning of the song without white or 'click' the beginning of song.


Enclosed Class AudioFileReaderAutoCue.cs and a small demo based on your PlugIn (AutoCue.cs, AutoCue.Designer.cs, AutoCuePlugin.cs)
Files are compiled in VS 2012 Express Desktop

New Post: About audio level alignment

$
0
0

Now it is working. Thanks for your help.

New Post: How to create a virtual audio source with NAudio?

$
0
0

To create a virtual audio input source to use in Skype etc. by mixing Line in and some other wave file together. Like Virtual Audio Cable.


New Post: How to create a virtual audio source with NAudio?

$
0
0

Unfortunately you can't create Virtual Audio Cable with NAudio - you'd need to use the Windows Driver Kit and make it in C/C++.

However, if you want to feed audio ito Skype then you can look at the Skype4Com library which lets you do this (you open up a port and send audio to it).

New Post: How to create a virtual audio source with NAudio?

$
0
0

That's what I want to do.

"you open up a port and send audio to it"

Elaborate please.

New Post: WaveIn stops after unplugging the Mic jack

$
0
0

Hi

There's a strange problem with WaveIn. When I unplug the Mic jack, recording stops and I can't start it again. I just can start it again if I close the program and open it again.

I followed the problem and found that after unplugging the Mic jack, the program receives WaveInterop.WaveMessage.WaveInClose message.

I have an onboard Realtek High Definition Audio.

Thanks in advance

New Post: WaveIn stops after unplugging the Mic jack

$
0
0

You should get a RecordingStopped message, probably with an Exception set. You'd need to dispose WaveIn, and create a new one to start recording again.

New Post: WaveIn stops after unplugging the Mic jack

$
0
0

I exactly did that, but it doesn't work. To my surprise the windows native sound recorder program works exactly like my application. In both programs (my program and windows sound recorder) I have to close the program and open it again.

Viewing all 5831 articles
Browse latest View live


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