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

New Post: Can NAudio WaveOut Filter channel data for stereo wave?

$
0
0
Hi,
I will use NAudio in my project and I got a problem now.

I want WaveOut to play only one channel data (eg. right channel) when WaveStream is a stereo wave stream (mp3 encoding). How I can let WaveOut to filter it?
Regards!

New Post: No sound from headphone if unplug then replug

$
0
0
hi
i play some sound with WaveOut after i disconnect headphone and connect again the sound not return?

New Post: Can NAudio WaveOut Filter channel data for stereo wave?

$
0
0
Not WaveOut will filter this. You have to convert the stream first into mono and then play it.
You can use the SteroToMonoProvider but this will mix both channels together. I don't know whether something like this already exists. If not you will have to write your own provider.

New Post: Any recommendations on integrating SoundTouch?

$
0
0
any thoughts an my above question about applying bass/treble, panning adjustments after adjusting tempo?

Paul

New Post: Can NAudio WaveOut Filter channel data for stereo wave?

$
0
0
Thanks for your reply!

I try to update WaveOut and its WaveOutBuffer source code like this:

WaveOutBuffer.cs

/// this is called by the WAVE callback and should be used to refill the buffer
    internal bool OnDone()
    {
        int bytes;
        lock (waveStream)
        {
            bytes = waveStream.Read(buffer, 0, buffer.Length);
        }
        if (bytes == 0)
        {
            return false;
        }
        else
        {
            //Edit by charley at 2013/4/9
            //左右声道是交替出现的,所以在间隔处用0填充
            if (VolumnMode != 1)
            {
                for (int i = 0; i < bytes - 1; i += mVolumnSize)
                {
                    if (VolumnMode == 2)
                    {
                        for (int j = 0; j < mVolumnSize; j++)
                        {
                            buffer[i + j] = mLeftVolumn ? buffer[i + j] : (byte)0;
                        }
                        mLeftVolumn = !mLeftVolumn;
                    }
                    if (VolumnMode == 3)
                    {
                        for (int j = 0; j < mVolumnSize; j++)
                        {
                            buffer[i + j] = !mLeftVolumn ? buffer[i + j] : (byte)0;
                        }
                        mLeftVolumn = !mLeftVolumn;
                    }
                }
            }

            for (int n = bytes; n < buffer.Length; n++)
            {
                buffer[n] = 0;
            }
        }
        WriteToWaveOut();
        return true;
    }
Not well but can meet my requirement.

Any other method and how to write new provider?

Note:

I want to control each channel when wave playing.

New Post: Record a "conversation"

$
0
0
Thanks Mark. I guess I'll make a stereo mixed stream

New Post: Loud noise at the beginnig and at at the end of a stream with WaveOut.Play()

$
0
0
Hello!
I'd like to create a program witch streams sound to an another client, and replays the sound.
When I call the WaveOut.Play() method, a high pitched beep like sound is hearable (It won't show itself with zero volume, I'm sure that the Waveout.Play() produces it, and not the stream source)
In every 100ms I create a memorystream from the buffer of the microphone, and send it through network. On the another client theese memorystream objects become Enqueued into a Queue, and I call the WaveOut.Play() on each dequeued (converted into IWaveProvider) memorystream object, and call Thread.Sleep(100). It works almost flawlesly with one critical issue: that high pitched sound is present in every 100ms (I call the WaveOut.Play() in every 100ms on the freshly dequeued memorystream).

How could I make that high piched sound disappear, when WaveOut.Play() Begins to play and ends to play the 100ms long chunk? I tried to call immediately the WaveOut.volume = 0.0F and the Thread.Sleep(5) and resume the volume in every 100 ms, but it caused "choppy audio". (also timing if the sleeps is a hard thing to do.)

I am looking for your answers.

New Post: No sound from headphone if unplug then replug

$
0
0
playback will likely have stopped if it was a USB headset. Do you get the PlaybackStopped event?

New Post: No sound from headphone if unplug then replug

$
0
0

The headphone is not usb , and i dont get any event.
Its connected with jack .

New Post: bad sound with WasapiLoopbackCapture on WIndows 8 and/or HP EliteBook

$
0
0
Hi,
my application captures audio data and provides it as a stream on the local network. This used to work fine on Windows 7 with various PCs. On my new HP EliteBook (Windows 8) it sounds like coming thru a tin can telephone. Any ideas?
Thanks,
Steffen

New Post: Loud noise at the beginnig and at at the end of a stream with WaveOut.Play()

$
0
0
For network streaming I strongly recommend using BufferedWaveProvider as the NetworkChatDemo project in NAudio does. Calling WaveOut.Play every 100 ms is inevitably going to cause audio artefacts.

New Post: bad sound with WasapiLoopbackCapture on WIndows 8 and/or HP EliteBook

$
0
0
have you checked that the capture format has not changed?

New Post: Loud noise at the beginnig and at at the end of a stream with WaveOut.Play()

$
0
0
I did not know about the BufferedStreamWaveprovider. Now it is working properly. Thank you very much markheath!
Let me ask an another question. I enhanced my project with the BufferedStreamWaveprovider. Now I hear three high-pitched sound after the WaveOut.Play(). With a Thread.Sleep(500) immediately after WaveOut.Play() solves the problem, but does a proper solution exist about this problem?

New Post: Loud noise at the beginnig and at at the end of a stream with WaveOut.Play()

$
0
0
you should not hear high-pitched sound. Try writing the audio to a WAV file instead of playing and listen to that to see if it has the high pitched sound

New Post: bad sound with WasapiLoopbackCapture on WIndows 8 and/or HP EliteBook

$
0
0
Hi Mark,
The only difference I can see is the sampling rate, which is correctly recognized by the Yamah receiver.
Win7: Device=Lautsprecher Format=32 bit PCM: 44kHz 2 channels wBitsPerSample:32 dwChannelMask:3 subFormat:00000003-0000-0010-8000-00aa00389b71 extraSize:22
Win8: Device=Lautsprecher / Kopfhörer Format=32 bit PCM: 48kHz 2 channels wBitsPerSample:32 dwChannelMask:3 subFormat:00000003-0000-0010-8000-00aa00389b71 extraSize:22
next week I will have a chance to test with another PC running Win8
Thanks,
Steffen
Gesendet: Mittwoch, 10. April 2013 um 19:36 Uhr
Von: markheath <[email removed]>
An: [email removed]
Betreff: Re: bad sound with WasapiLoopbackCapture on WIndows 8 and/or HP EliteBook [naudio:439790]

From: markheath

have you checked that the capture format has not changed?

New Post: Wav file amplitude a a given time interval

$
0
0
Can i fetch amplitude of wav file at specified interval, say for example i want to check audio amplitude of wav file at 4.5sec.

New Post: bad sound with WasapiLoopbackCapture on WIndows 8 and/or HP EliteBook

$
0
0
Hi,
I now did some tests on another Win8 PC. There it works. Interestingly audio is running at 44kHz there. It looks like that the sound device of the EliteBook (IDT High Definition Audio CODEC) is responsible for the issue.
Steffen

New Post: How to use NAudio with video file !

$
0
0
I want to work with audio of video file but I don't know how I do.

I see NAudio only work with Mp3 file and Wav file.

Please help me !

New Post: How to use NAudio with video file !

$
0
0
You can use the MediaFoundationReader (currently in 1.7 preview release only) to do this

New Post: How to use NAudio with video file !

$
0
0
markheath wrote:
You can use the MediaFoundationReader (currently in 1.7 preview release only) to do this
Where can I download NAudio 1.7 ?

I don't see it on this web.
Viewing all 5831 articles
Browse latest View live


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