↧
Released: NAudio 1.6 (Oct 26, 2012)
↧
Updated Release: NAudio 1.6 (Oct 26, 2012)
↧
↧
Edited Issue: Format header read for some wav files are incorrect [10105]
The problem is if the header length is not quite correct. fool.wav is a wave file that plays correctly in most players and reads correctly through the mm api, but fails in naudio
The solutions was to hack WaveFormat to set the binary reader to the correct position
/// <summary>
/// Reads a new WaveFormat object from a stream
/// </summary>
/// <param name="br">A binary reader that wraps the stream</param>
public WaveFormat(BinaryReader br)
{
int formatChunkLength = br.ReadInt32();
--> ADDED long chunkStartPosition = br.BaseStream.Position;
if(formatChunkLength < 16)
throw new ApplicationException("Invalid WaveFormat Structure");
this.waveFormatTag = (WaveFormatEncoding) br.ReadUInt16();
this.channels = br.ReadInt16();
this.sampleRate = br.ReadInt32();
this.averageBytesPerSecond = br.ReadInt32();
this.blockAlign = br.ReadInt16();
this.bitsPerSample = br.ReadInt16();
if (formatChunkLength > 16)
{
this.extraSize = br.ReadInt16();
if (this.extraSize > formatChunkLength - 18)
{
Console.WriteLine("Format chunk mismatch");
//RRL GSM exhibits this bug. Don't throw an exception
//throw new ApplicationException("Format chunk length mismatch");
this.extraSize = (short) (formatChunkLength - 18);
}
// read any extra data
// br.ReadBytes(extraSize);
}
ADDED--> br.BaseStream.Position = chunkStartPosition + formatChunkLength;
}
The solutions was to hack WaveFormat to set the binary reader to the correct position
/// <summary>
/// Reads a new WaveFormat object from a stream
/// </summary>
/// <param name="br">A binary reader that wraps the stream</param>
public WaveFormat(BinaryReader br)
{
int formatChunkLength = br.ReadInt32();
--> ADDED long chunkStartPosition = br.BaseStream.Position;
if(formatChunkLength < 16)
throw new ApplicationException("Invalid WaveFormat Structure");
this.waveFormatTag = (WaveFormatEncoding) br.ReadUInt16();
this.channels = br.ReadInt16();
this.sampleRate = br.ReadInt32();
this.averageBytesPerSecond = br.ReadInt32();
this.blockAlign = br.ReadInt16();
this.bitsPerSample = br.ReadInt16();
if (formatChunkLength > 16)
{
this.extraSize = br.ReadInt16();
if (this.extraSize > formatChunkLength - 18)
{
Console.WriteLine("Format chunk mismatch");
//RRL GSM exhibits this bug. Don't throw an exception
//throw new ApplicationException("Format chunk length mismatch");
this.extraSize = (short) (formatChunkLength - 18);
}
// read any extra data
// br.ReadBytes(extraSize);
}
ADDED--> br.BaseStream.Position = chunkStartPosition + formatChunkLength;
}
↧
Closed Issue: Format header read for some wav files are incorrect [10105]
The problem is if the header length is not quite correct. fool.wav is a wave file that plays correctly in most players and reads correctly through the mm api, but fails in naudio
The solutions was to hack WaveFormat to set the binary reader to the correct position
/// <summary>
/// Reads a new WaveFormat object from a stream
/// </summary>
/// <param name="br">A binary reader that wraps the stream</param>
public WaveFormat(BinaryReader br)
{
int formatChunkLength = br.ReadInt32();
--> ADDED long chunkStartPosition = br.BaseStream.Position;
if(formatChunkLength < 16)
throw new ApplicationException("Invalid WaveFormat Structure");
this.waveFormatTag = (WaveFormatEncoding) br.ReadUInt16();
this.channels = br.ReadInt16();
this.sampleRate = br.ReadInt32();
this.averageBytesPerSecond = br.ReadInt32();
this.blockAlign = br.ReadInt16();
this.bitsPerSample = br.ReadInt16();
if (formatChunkLength > 16)
{
this.extraSize = br.ReadInt16();
if (this.extraSize > formatChunkLength - 18)
{
Console.WriteLine("Format chunk mismatch");
//RRL GSM exhibits this bug. Don't throw an exception
//throw new ApplicationException("Format chunk length mismatch");
this.extraSize = (short) (formatChunkLength - 18);
}
// read any extra data
// br.ReadBytes(extraSize);
}
ADDED--> br.BaseStream.Position = chunkStartPosition + formatChunkLength;
}
Comments: released in NAudio 1.6
The solutions was to hack WaveFormat to set the binary reader to the correct position
/// <summary>
/// Reads a new WaveFormat object from a stream
/// </summary>
/// <param name="br">A binary reader that wraps the stream</param>
public WaveFormat(BinaryReader br)
{
int formatChunkLength = br.ReadInt32();
--> ADDED long chunkStartPosition = br.BaseStream.Position;
if(formatChunkLength < 16)
throw new ApplicationException("Invalid WaveFormat Structure");
this.waveFormatTag = (WaveFormatEncoding) br.ReadUInt16();
this.channels = br.ReadInt16();
this.sampleRate = br.ReadInt32();
this.averageBytesPerSecond = br.ReadInt32();
this.blockAlign = br.ReadInt16();
this.bitsPerSample = br.ReadInt16();
if (formatChunkLength > 16)
{
this.extraSize = br.ReadInt16();
if (this.extraSize > formatChunkLength - 18)
{
Console.WriteLine("Format chunk mismatch");
//RRL GSM exhibits this bug. Don't throw an exception
//throw new ApplicationException("Format chunk length mismatch");
this.extraSize = (short) (formatChunkLength - 18);
}
// read any extra data
// br.ReadBytes(extraSize);
}
ADDED--> br.BaseStream.Position = chunkStartPosition + formatChunkLength;
}
Comments: released in NAudio 1.6
↧
Edited Issue: Error if mp3 frame not at the begining [9071]
If the frame header don't starts imediatly after the the end of the ID3 Tag (or the begining of the file), it is not recognised as an mp3 file, however it is valid, according to http://www.datavoyage.com/mpgscript/mpeghdr.htm. I know, this is not the official source, but for me it worked. I had such a file, ad after changing the sourcecode, it worked fine.
I attach the changed Mp3Frame.cs. But it is not the best/most efficient way. But this is from the 24556 build version.
And sorry for my bad english :)
I attach the changed Mp3Frame.cs. But it is not the best/most efficient way. But this is from the 24556 build version.
And sorry for my bad english :)
↧
↧
Closed Issue: Error if mp3 frame not at the begining [9071]
If the frame header don't starts imediatly after the the end of the ID3 Tag (or the begining of the file), it is not recognised as an mp3 file, however it is valid, according to http://www.datavoyage.com/mpgscript/mpeghdr.htm. I know, this is not the official source, but for me it worked. I had such a file, ad after changing the sourcecode, it worked fine.
I attach the changed Mp3Frame.cs. But it is not the best/most efficient way. But this is from the 24556 build version.
And sorry for my bad english :)
Comments: released in NAudio 1.6
I attach the changed Mp3Frame.cs. But it is not the best/most efficient way. But this is from the 24556 build version.
And sorry for my bad english :)
Comments: released in NAudio 1.6
↧
Edited Issue: IeeeFloat to ASIOSTFloat32LSB converter [7979]
If you have sound that's already IeeeFloat but you use ASIO, it seems to me it must be deinterleaved as I found of no way to just pass the interleaved floats through it.
So I've added these to NAudio\Wave\Asio\ASIOSampleConvertor.cs:
case ASIOSampleType.ASIOSTFloat32LSB:
switch (waveFormat.BitsPerSample)
{
case 32:
convertor = (SampleConvertor)ConvertorFloatToFloat2Channels;
break;
}
break;
// IeeeFloat to ASIOSTFloat32LSB (deinterleave)
public static void ConvertorFloatToFloat2Channels(IntPtr inputInterleavedBuffer, IntPtr[] asioOutputBuffers, int nbChannels, int nbSamples)
{
unsafe
{
float* inputSamples = (float*)inputInterleavedBuffer;
float* leftSamples = (float*)asioOutputBuffers[0];
float* rightSamples = (float*)asioOutputBuffers[1];
for (int i = 0; i < nbSamples; i++)
{
*leftSamples++ = inputSamples[0];
*rightSamples++ = inputSamples[1];
inputSamples += 2;
}
}
}
So I've added these to NAudio\Wave\Asio\ASIOSampleConvertor.cs:
case ASIOSampleType.ASIOSTFloat32LSB:
switch (waveFormat.BitsPerSample)
{
case 32:
convertor = (SampleConvertor)ConvertorFloatToFloat2Channels;
break;
}
break;
// IeeeFloat to ASIOSTFloat32LSB (deinterleave)
public static void ConvertorFloatToFloat2Channels(IntPtr inputInterleavedBuffer, IntPtr[] asioOutputBuffers, int nbChannels, int nbSamples)
{
unsafe
{
float* inputSamples = (float*)inputInterleavedBuffer;
float* leftSamples = (float*)asioOutputBuffers[0];
float* rightSamples = (float*)asioOutputBuffers[1];
for (int i = 0; i < nbSamples; i++)
{
*leftSamples++ = inputSamples[0];
*rightSamples++ = inputSamples[1];
inputSamples += 2;
}
}
}
↧
Closed Issue: IeeeFloat to ASIOSTFloat32LSB converter [7979]
If you have sound that's already IeeeFloat but you use ASIO, it seems to me it must be deinterleaved as I found of no way to just pass the interleaved floats through it.
So I've added these to NAudio\Wave\Asio\ASIOSampleConvertor.cs:
case ASIOSampleType.ASIOSTFloat32LSB:
switch (waveFormat.BitsPerSample)
{
case 32:
convertor = (SampleConvertor)ConvertorFloatToFloat2Channels;
break;
}
break;
// IeeeFloat to ASIOSTFloat32LSB (deinterleave)
public static void ConvertorFloatToFloat2Channels(IntPtr inputInterleavedBuffer, IntPtr[] asioOutputBuffers, int nbChannels, int nbSamples)
{
unsafe
{
float* inputSamples = (float*)inputInterleavedBuffer;
float* leftSamples = (float*)asioOutputBuffers[0];
float* rightSamples = (float*)asioOutputBuffers[1];
for (int i = 0; i < nbSamples; i++)
{
*leftSamples++ = inputSamples[0];
*rightSamples++ = inputSamples[1];
inputSamples += 2;
}
}
}
Comments: released in NAudio 1.6
So I've added these to NAudio\Wave\Asio\ASIOSampleConvertor.cs:
case ASIOSampleType.ASIOSTFloat32LSB:
switch (waveFormat.BitsPerSample)
{
case 32:
convertor = (SampleConvertor)ConvertorFloatToFloat2Channels;
break;
}
break;
// IeeeFloat to ASIOSTFloat32LSB (deinterleave)
public static void ConvertorFloatToFloat2Channels(IntPtr inputInterleavedBuffer, IntPtr[] asioOutputBuffers, int nbChannels, int nbSamples)
{
unsafe
{
float* inputSamples = (float*)inputInterleavedBuffer;
float* leftSamples = (float*)asioOutputBuffers[0];
float* rightSamples = (float*)asioOutputBuffers[1];
for (int i = 0; i < nbSamples; i++)
{
*leftSamples++ = inputSamples[0];
*rightSamples++ = inputSamples[1];
inputSamples += 2;
}
}
}
Comments: released in NAudio 1.6
↧
Edited Issue: Midi Interop with MIDIHDR is wrong? [2278]
I think your interop with the MIDIHDR struct is wrong. You use a marshal-as attribute and a ref. I think this will not prevent the GC from relocating the (managed) MIDIHDR and when that happens the ref passed to (for instance) midiInAddBuffer is no longer valid. I would use an IntPtr to an unmanaged memory block that contains the MIDIHDR (copied there using Marshal.StructureToPtr).
↧
↧
Closed Issue: Midi Interop with MIDIHDR is wrong? [2278]
I think your interop with the MIDIHDR struct is wrong. You use a marshal-as attribute and a ref. I think this will not prevent the GC from relocating the (managed) MIDIHDR and when that happens the ref passed to (for instance) midiInAddBuffer is no longer valid. I would use an IntPtr to an unmanaged memory block that contains the MIDIHDR (copied there using Marshal.StructureToPtr).
Comments: released in NAudio 1.6
Comments: released in NAudio 1.6
↧
Edited Feature: WMA Reader and WMA Writer Classes [6341]
http://msdn.microsoft.com/en-us/library/bb288688(VS.85).aspx
↧
Closed Feature: WMA Reader and WMA Writer Classes [6341]
http://msdn.microsoft.com/en-us/library/bb288688(VS.85).aspx
Comments: released in NAudio 1.6
Comments: released in NAudio 1.6
↧
Updated Wiki: Home
NAudio Overview
NAudio is an open source .NET audio and MIDI library, containing dozens of useful audio related classes intended to speed development of audio related utilities in .NET. It has been in development since 2002 and has grown to include a wide variety of features. While some parts of the library are relatively new and incomplete, the more mature features have undergone extensive testing and can be quickly used to add audio capabilities to an existing .NET application. NAudio can be quickly added to your .NET application using NuGet.NAudio demo project showing an MP3 file playing:
NAudio WPF Project showing waveform visualisation and spectrum analyser:
Latest News
For the latest news and more documentation on NAudio, visit Mark Heath's blog.- 26 Oct 2012 NAudio 1.6 Released. Read the release notes
- 9 Sep 2012 ASIO Recording Support added
- 19 Dec 2011 NAudio 1.5 Released. Read the release notes
- 20 Apr 2011 NAudio 1.4 Released. Read the release notes
- 15 Apr 2011 NAudio demo now shows how to select output devices (for WaveOut, DirectSound, WASAPI and ASIO), and can play 8 bit, 16 bit, 24 bit, and 32 bit float WAV files. Fixed a longstanding ASIO issue.
- 7 Nov 2010 Major improvements to Mp3FileReader
- 10 Oct 2009 Version 1.3 Released. Read the release notes
- 20 Sep 2009 We are getting close to feature complete for 1.3. Last chance to get in any feedback on the API
- 26 Aug 2009 WPF Waveform drawing demo project including FFT added
- 28 Feb 2009 Lots of new stuff is being added and planned, so do check out the Source Code tab to have a sneak peak at what's coming in 1.3
- 26 June 2008 Version 1.2 Released. Read the release notes
NAudio Features
- Play back audio using a variety of APIs
- WaveOut
- DirectSound
- ASIO
- WASAPI (Windows Vista and above)
- Decompress audio from different Wave Formats
- MP3 decode using ACM or DMO codec
- AIFF
- G.711 mu-law and a-law
- ADPCM
- G.722
- Speex (using NSpeex)
- SF2 files
- Decode using any ACM codec installed on your computer
- Record audio using WaveIn, WASAPI or ASIO
- Read and Write standard .WAV files
- Mix and manipulate audio streams using a 32 bit floating mixing engine
- Extensive support for reading and writing MIDI files
- Full MIDI event model
- Basic support for Windows Mixer APIs
- A collection of useful Windows Forms Controls
- Some basic audio effects, including a compressor
Projects Using NAudio
NAudio currently is used to support a number of audio related utilities, some of which may be moved to be hosted on CodePlex in the future. If you have used NAudio for a project, please get in touch so we can post it here.- Skype Voice Changer - Modify your voice with audio effects while talking on Skype
- .NET Voice Recorder - Record your voice, save to MP3, and visualise the waveform using WPF. Now includes autotune
- MIDI File Mapper - Utility for mapping MIDI drum files for use on other samplers
- MIDI File Splitter - Split MIDI files up at their markers
- SharpMod - managed port of MikMod, can play mod files in both WinForms and Silverlight
- NVorbis - Fully managed Vorbis decoder, with support for NAudio
- Practice# - Windows tool for practicing playing an instrument with playback music. Includes FLAC playback support and an equaliser for NAudio.
- WPF Sound Visualization Library - beautiful waveform and spectrum analyzer code written for WPF, comes with NAudio sample
- SIPSorcery - .NET softphone framework
- Squiggle - A free open source LAN Messenger
- Helix 3D toolkit
- airphone-tv - A revival of axStream to implement control through the iPhone
- JamNet - a Silverlight drum sample player
- Jingle Jim - Jingle Software (German language)
- All My Music
- iSpy - Open Source Camera Security Software
- RadioTuna - Online internet radio player
- Fire Talk New - chat program
- AVR Audio Guard - utility to fix a HDMI related issue
More Info
For more information, please visit the NAudio Documentation WikiDonate
NAudio is a free open source project that is developed in personal time. You can show your appreciation for NAudio and support future development by donating.↧
↧
Created Issue: AccessViolationException when disposing WaveOut in a 64-bit application [16369]
I'm currently migrating my application to 64-bit and whenever I'm trying to dispose the WaveOut class, I'm getting an "AccessVoilationException" with the message "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
Stacktrace:
at NAudio.Wave.WaveInterop.waveOutClose(IntPtr hWaveOut)
at NAudio.Wave.WaveOut.Dispose(Boolean disposing)
at NAudio.Wave.WaveOut.Dispose()
I've tested this with version 1.5 and 1.6 of NAudio, it only happens when I compile my application for 64-bit, 32-bit works fine.
Small codepiece where it happens:
if (wavePlayer != null)
{
this.wavePlayer.Stop();
this.wavePlayer.Dispose(); //AccessViolationException
}
Stacktrace:
at NAudio.Wave.WaveInterop.waveOutClose(IntPtr hWaveOut)
at NAudio.Wave.WaveOut.Dispose(Boolean disposing)
at NAudio.Wave.WaveOut.Dispose()
I've tested this with version 1.5 and 1.6 of NAudio, it only happens when I compile my application for 64-bit, 32-bit works fine.
Small codepiece where it happens:
if (wavePlayer != null)
{
this.wavePlayer.Stop();
this.wavePlayer.Dispose(); //AccessViolationException
}
↧
Edited Issue: AccessViolationException when disposing WaveOut in a 64-bit application [16369]
I'm currently migrating my application to 64-bit and whenever I'm trying to dispose the WaveOut class, I'm getting an "AccessVoilationException" with the message "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
Stacktrace:
at NAudio.Wave.WaveInterop.waveOutClose(IntPtr hWaveOut)
at NAudio.Wave.WaveOut.Dispose(Boolean disposing)
at NAudio.Wave.WaveOut.Dispose()
I've tested this with version 1.5 and 1.6 of NAudio, it only happens when I compile my application for 64-bit, 32-bit works fine.
Small codepiece where it happens:
if (wavePlayer != null)
{
this.wavePlayer.Stop();
this.wavePlayer.Dispose(); //AccessViolationException
}
Stacktrace:
at NAudio.Wave.WaveInterop.waveOutClose(IntPtr hWaveOut)
at NAudio.Wave.WaveOut.Dispose(Boolean disposing)
at NAudio.Wave.WaveOut.Dispose()
I've tested this with version 1.5 and 1.6 of NAudio, it only happens when I compile my application for 64-bit, 32-bit works fine.
Small codepiece where it happens:
if (wavePlayer != null)
{
this.wavePlayer.Stop();
this.wavePlayer.Dispose(); //AccessViolationException
}
↧
Edited Issue: AccessViolationException when disposing WaveOut in a 64-bit application [16369]
I'm currently migrating my application to 64-bit and whenever I'm trying to dispose the WaveOut class, I'm getting an "AccessVoilationException" with the message "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
Stacktrace:
at NAudio.Wave.WaveInterop.waveOutClose(IntPtr hWaveOut)
at NAudio.Wave.WaveOut.Dispose(Boolean disposing)
at NAudio.Wave.WaveOut.Dispose()
I've tested this with version 1.5 and 1.6 of NAudio, it only happens when I compile my application for 64-bit, 32-bit works fine.
Small codepiece where it happens:
if (wavePlayer != null)
{
this.wavePlayer.Stop();
this.wavePlayer.Dispose(); //AccessViolationException
}
Initialization of the WaveOut class:
this.wavePlayer = new WaveOut(WaveCallbackInfo.FunctionCallback());
I've also tried it with the new WaveOutEvent class in NAudio, but the problem persists.
Stacktrace:
at NAudio.Wave.WaveInterop.waveOutClose(IntPtr hWaveOut)
at NAudio.Wave.WaveOut.Dispose(Boolean disposing)
at NAudio.Wave.WaveOut.Dispose()
I've tested this with version 1.5 and 1.6 of NAudio, it only happens when I compile my application for 64-bit, 32-bit works fine.
Small codepiece where it happens:
if (wavePlayer != null)
{
this.wavePlayer.Stop();
this.wavePlayer.Dispose(); //AccessViolationException
}
Initialization of the WaveOut class:
this.wavePlayer = new WaveOut(WaveCallbackInfo.FunctionCallback());
I've also tried it with the new WaveOutEvent class in NAudio, but the problem persists.
↧
Commented Issue: AccessViolationException when disposing WaveOut in a 64-bit application [16369]
I'm currently migrating my application to 64-bit and whenever I'm trying to dispose the WaveOut class, I'm getting an "AccessVoilationException" with the message "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
Stacktrace:
at NAudio.Wave.WaveInterop.waveOutClose(IntPtr hWaveOut)
at NAudio.Wave.WaveOut.Dispose(Boolean disposing)
at NAudio.Wave.WaveOut.Dispose()
I've tested this with version 1.5 and 1.6 of NAudio, it only happens when I compile my application for 64-bit, 32-bit works fine.
Small codepiece where it happens:
if (wavePlayer != null)
{
this.wavePlayer.Stop();
this.wavePlayer.Dispose(); //AccessViolationException
}
Initialization of the WaveOut class:
this.wavePlayer = new WaveOut(WaveCallbackInfo.FunctionCallback());
I've also tried it with the new WaveOutEvent class in NAudio, but the problem persists.
Comments: Whoooops, I checked it a second time, WaveOutEvent doesn't has the problem, I think this can be closed!
Stacktrace:
at NAudio.Wave.WaveInterop.waveOutClose(IntPtr hWaveOut)
at NAudio.Wave.WaveOut.Dispose(Boolean disposing)
at NAudio.Wave.WaveOut.Dispose()
I've tested this with version 1.5 and 1.6 of NAudio, it only happens when I compile my application for 64-bit, 32-bit works fine.
Small codepiece where it happens:
if (wavePlayer != null)
{
this.wavePlayer.Stop();
this.wavePlayer.Dispose(); //AccessViolationException
}
Initialization of the WaveOut class:
this.wavePlayer = new WaveOut(WaveCallbackInfo.FunctionCallback());
I've also tried it with the new WaveOutEvent class in NAudio, but the problem persists.
Comments: Whoooops, I checked it a second time, WaveOutEvent doesn't has the problem, I think this can be closed!
↧
↧
Commented Issue: AccessViolationException when disposing WaveOut in a 64-bit application [16369]
I'm currently migrating my application to 64-bit and whenever I'm trying to dispose the WaveOut class, I'm getting an "AccessVoilationException" with the message "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
Stacktrace:
at NAudio.Wave.WaveInterop.waveOutClose(IntPtr hWaveOut)
at NAudio.Wave.WaveOut.Dispose(Boolean disposing)
at NAudio.Wave.WaveOut.Dispose()
I've tested this with version 1.5 and 1.6 of NAudio, it only happens when I compile my application for 64-bit, 32-bit works fine.
Small codepiece where it happens:
if (wavePlayer != null)
{
this.wavePlayer.Stop();
this.wavePlayer.Dispose(); //AccessViolationException
}
Initialization of the WaveOut class:
this.wavePlayer = new WaveOut(WaveCallbackInfo.FunctionCallback());
I've also tried it with the new WaveOutEvent class in NAudio, but the problem persists.
Comments: Ok, I'm really sorry, but with the WaveOutEvent class, the exception is now thrown only sometimes
Stacktrace:
at NAudio.Wave.WaveInterop.waveOutClose(IntPtr hWaveOut)
at NAudio.Wave.WaveOut.Dispose(Boolean disposing)
at NAudio.Wave.WaveOut.Dispose()
I've tested this with version 1.5 and 1.6 of NAudio, it only happens when I compile my application for 64-bit, 32-bit works fine.
Small codepiece where it happens:
if (wavePlayer != null)
{
this.wavePlayer.Stop();
this.wavePlayer.Dispose(); //AccessViolationException
}
Initialization of the WaveOut class:
this.wavePlayer = new WaveOut(WaveCallbackInfo.FunctionCallback());
I've also tried it with the new WaveOutEvent class in NAudio, but the problem persists.
Comments: Ok, I'm really sorry, but with the WaveOutEvent class, the exception is now thrown only sometimes
↧
Commented Issue: AccessViolationException when disposing WaveOut in a 64-bit application [16369]
I'm currently migrating my application to 64-bit and whenever I'm trying to dispose the WaveOut class, I'm getting an "AccessVoilationException" with the message "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
Stacktrace:
at NAudio.Wave.WaveInterop.waveOutClose(IntPtr hWaveOut)
at NAudio.Wave.WaveOut.Dispose(Boolean disposing)
at NAudio.Wave.WaveOut.Dispose()
I've tested this with version 1.5 and 1.6 of NAudio, it only happens when I compile my application for 64-bit, 32-bit works fine.
Small codepiece where it happens:
if (wavePlayer != null)
{
this.wavePlayer.Stop();
this.wavePlayer.Dispose(); //AccessViolationException
}
Initialization of the WaveOut class:
this.wavePlayer = new WaveOut(WaveCallbackInfo.FunctionCallback());
I've also tried it with the new WaveOutEvent class in NAudio, but the problem persists.
Comments: what OS and soundcard are you using?
Stacktrace:
at NAudio.Wave.WaveInterop.waveOutClose(IntPtr hWaveOut)
at NAudio.Wave.WaveOut.Dispose(Boolean disposing)
at NAudio.Wave.WaveOut.Dispose()
I've tested this with version 1.5 and 1.6 of NAudio, it only happens when I compile my application for 64-bit, 32-bit works fine.
Small codepiece where it happens:
if (wavePlayer != null)
{
this.wavePlayer.Stop();
this.wavePlayer.Dispose(); //AccessViolationException
}
Initialization of the WaveOut class:
this.wavePlayer = new WaveOut(WaveCallbackInfo.FunctionCallback());
I've also tried it with the new WaveOutEvent class in NAudio, but the problem persists.
Comments: what OS and soundcard are you using?
↧
Commented Issue: AccessViolationException when disposing WaveOut in a 64-bit application [16369]
I'm currently migrating my application to 64-bit and whenever I'm trying to dispose the WaveOut class, I'm getting an "AccessVoilationException" with the message "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
Stacktrace:
at NAudio.Wave.WaveInterop.waveOutClose(IntPtr hWaveOut)
at NAudio.Wave.WaveOut.Dispose(Boolean disposing)
at NAudio.Wave.WaveOut.Dispose()
I've tested this with version 1.5 and 1.6 of NAudio, it only happens when I compile my application for 64-bit, 32-bit works fine.
Small codepiece where it happens:
if (wavePlayer != null)
{
this.wavePlayer.Stop();
this.wavePlayer.Dispose(); //AccessViolationException
}
Initialization of the WaveOut class:
this.wavePlayer = new WaveOut(WaveCallbackInfo.FunctionCallback());
I've also tried it with the new WaveOutEvent class in NAudio, but the problem persists.
Comments: I knew I forgot to mention something... I'm using Windows 7 64-bit, Soundcard is the built in of my Asus N56-VZ (hm, where do I find the specific model?), but the exception occurs on all of my 3 computers (also with Win7 64-bit)
Stacktrace:
at NAudio.Wave.WaveInterop.waveOutClose(IntPtr hWaveOut)
at NAudio.Wave.WaveOut.Dispose(Boolean disposing)
at NAudio.Wave.WaveOut.Dispose()
I've tested this with version 1.5 and 1.6 of NAudio, it only happens when I compile my application for 64-bit, 32-bit works fine.
Small codepiece where it happens:
if (wavePlayer != null)
{
this.wavePlayer.Stop();
this.wavePlayer.Dispose(); //AccessViolationException
}
Initialization of the WaveOut class:
this.wavePlayer = new WaveOut(WaveCallbackInfo.FunctionCallback());
I've also tried it with the new WaveOutEvent class in NAudio, but the problem persists.
Comments: I knew I forgot to mention something... I'm using Windows 7 64-bit, Soundcard is the built in of my Asus N56-VZ (hm, where do I find the specific model?), but the exception occurs on all of my 3 computers (also with Win7 64-bit)
↧