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

Created Unassigned: Audio sessions from CoreAudioAPI are not implemented [16468]

$
0
0
AudioSessionControl2, AudioSessionManager2 (from CoreAudioApi) and other classes are not implemented.
I can not change sound or mute specific program. (Sample can be found here: http://whenimbored.xfx.net/2011/01/core-audio-for-net/)

New Post: XNA and FFT

$
0
0
Hey all,

I'm fairly new to naudio and FFT. All I want to do is draw the waveform of the computer's speaker output (the same output I get peak volume with MMDevice.AudioMeterInformation.MasterPeakValue) to the screen. I've looked around google and everything is either poorly documented or windows forms or using about 9 million libraries. Is there any way to just draw the waveform to the screen in XNA? That's all I ask.

Thanks,
P

New Post: XNA and FFT

$
0
0
hi, to draw a waveform you don't need FFT, just get the peak volume level at regular intervals. To learn how to draw things in XNA though you would be better off asking at an XNA forum I'm afraid. I've never used it myself.

New Post: XNA and FFT

$
0
0
Thanks. I was thinking that that would be a way to do it, but never got around to trying it. I'm already aware on how to draw things in XNA, I was just wondering about how to get the waveform.

New Post: XNA and FFT

$
0
0
use WasapiLoopbackCapture to get the audio. Then examine the samples and pick out the max absolute sample value in a certain period to get a peak point to plot on your waveform

New Post: IKsJackDescription and IKsJackDescription2

$
0
0
Thanks for the response, is there any way currently to get the audio jack info with NAudio? if not, do you foresee adding these interfaces into the library on the road map?

thanks for creating a compelling library.

New Post: IKsJackDescription and IKsJackDescription2

$
0
0
hi, the interfaces in NAudio are added on an as-needed basis when I have the time, or when other people contribute them. I'm afraid I can't commit to a roadmap since it is just a spare time project for me

New Post: Creating a .wav file from WaveProvider32

$
0
0
Hello,

I've been writing some code based on the "Play a Sine Wave" example, here:

http://mark-dot-net.blogspot.co.uk/2009/10/playback-of-sine-wave-in-naudio.html

My code is working very nicely, but I want to be able to save the generated sound to a .wav file, and I can't seem to find the right magic spell to get this to work.

Could anyone point me in the right direction, or provide some extra code for the above example that will allow the sine wave sound to be written to a .wav file?

Many thanks,

Adam.

Commented Unassigned: Audio sessions from CoreAudioAPI are not implemented [16468]

$
0
0
AudioSessionControl2, AudioSessionManager2 (from CoreAudioApi) and other classes are not implemented.
I can not change sound or mute specific program. (Sample can be found here: http://whenimbored.xfx.net/2011/01/core-audio-for-net/)
Comments: agreed, would be nice to get this into NAudio

New Post: Creating a .wav file from WaveProvider32

$
0
0
you can use WaveFileWriter to create a WAV file. Read from the sine wave provider and write into the WaveFileWriter. Just remember that the sine provider will never end so stop writing when you have enough

Commented Unassigned: Error Handling for Corrupt Files [16466]

$
0
0
We are using NAudio in a media library application. As part of our unit testing suite, we run empty MP3 files (0 bytes) through our code to verify that corrupt files are handled correctly.

Unfortunately, the Mp3FileReader constructor throws a NullReferenceException, which isn't very descriptive and could happen for other reasons. Worse, it leaves the file reference open, so we're unable to clean up the empty test files.

Can we get a more robust exception, and some resource disposing? Thanks!
Comments: I get IndexOutOfRange exception. Are you sure you get NullReferenceException?

New Post: Creating a .wav file from WaveProvider32

$
0
0
Thanks for the quick reply, Mark, I've got this working now. For the benefit of anyone else reading this, here's how I did it:

I declared a class-level WaveFileWriter object named "writer" in my SineWaveProvider32 class. I then added a new method to the class:
    /// <summary>
    /// Start recording audio to the specified .wav file
    /// </summary>
    /// <param name="filename"></param>
    public void StartRecording(string filename)
    {
        writer = new NAudio.Wave.WaveFileWriter(filename, this.WaveFormat);
    }
This gets called from my form and tells it to instantiate the writer and set its filename. Make sure to call this after first calling the SetWaveFormat method.

Then in the Read method, I added the following code, just after the end of the for() loop:
        // Do we have a writer object?
        if (writer != null)
        {
            // Yes, so write the samples we've just added to the file
            writer.WriteSamples(buffer, 0, sampleCount);

            // Have we reached the termination point?
            if (sample > 20000)
            {
                // Yes, so dispose of and remove the writer
                writer.Dispose();
                writer = null;
            }
        }
This stops after generating ~20,000 samples, of course the dispose section can be adjusted to terminate under whatever circumstances are needed.

I'm having a huge amount of fun playing with NAudio, by the way, thank you so much for creating it!

Best regards,

Adam.

New Post: Creating a .wav file from WaveProvider32

$
0
0
awesome, glad you got it working

Source code checked in, #5bedcf17eccb

$
0
0
better error handling for zero length MP3 files

Commented Unassigned: Error Handling for Corrupt Files [16466]

$
0
0
We are using NAudio in a media library application. As part of our unit testing suite, we run empty MP3 files (0 bytes) through our code to verify that corrupt files are handled correctly.

Unfortunately, the Mp3FileReader constructor throws a NullReferenceException, which isn't very descriptive and could happen for other reasons. Worse, it leaves the file reference open, so we're unable to clean up the empty test files.

Can we get a more robust exception, and some resource disposing? Thanks!
Comments: I've checked in a fix. Will throw InvalidDataException now if there is a zero length file. To be honest though, I tend to recommend using MediaFoundationReader wherever possible now as it is faster and copes better with odd MP3 files

Source code checked in, #46dd420360cd

$
0
0
WaveFileWriter.Flush updates the headers now

Edited Unassigned: Error Handling for Corrupt Files [16466]

$
0
0
We are using NAudio in a media library application. As part of our unit testing suite, we run empty MP3 files (0 bytes) through our code to verify that corrupt files are handled correctly.

Unfortunately, the Mp3FileReader constructor throws a NullReferenceException, which isn't very descriptive and could happen for other reasons. Worse, it leaves the file reference open, so we're unable to clean up the empty test files.

Can we get a more robust exception, and some resource disposing? Thanks!

New Post: Media Foundation 48kHz files?

$
0
0

Dude, you are awesome! Thanks so much for that. I will check it out and let you know how it works. BTW, if you’re a musician or do any recording, check out the QSC Touchmix, it really rocks if you play small clubs and don’t want to haul around 200 lbs. of equipment. It replaces your mixer and outboard effects. It sounds great too! This application I’m writing just rearranges the session recording files for easier mixing/mastering and I’m using your tool to convert the audio files while moving them because there some DAWs out there that don’t read 32bit PCM files.

Thanks again!
Scott

New Post: Media Foundation 48kHz files?

New Post: Media Foundation 48kHz files?

$
0
0
Glad it worked for you. That QSC Touchmix looks a nice piece of kit.
Viewing all 5831 articles
Browse latest View live


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