mirror of https://github.com/naudio/NAudio.git
Browse Source
Added a Custom Marshaller for WaveFormat (not used everywhere yet) which is now working with ACM
Added a Custom Marshaller for WaveFormat (not used everywhere yet) which is now working with ACM
Fixed some marshalling bugs in ResamplerDMOStream caused by WaveFileReader using WaveFormatExtraData Fixed some broken unit testspull/1/head

16 changed files with 207 additions and 76 deletions
-
8NAudio/Changes.xml
-
6NAudio/Dmo/DmoMediaType.cs
-
1NAudio/Dmo/IMediaBuffer.cs
-
21NAudio/Dmo/MediaObject.cs
-
38NAudio/Dmo/ResamplerMediaObject.cs
-
1NAudio/NAudio.csproj
-
10NAudio/Wave/Compression/AcmInterop.cs
-
11NAudio/Wave/Compression/AcmStream.cs
-
6NAudio/Wave/WaveFormats/WaveFormat.cs
-
47NAudio/Wave/WaveFormats/WaveFormatCustomMarshaler.cs
-
14NAudio/Wave/WaveStreams/ResamplerDmoStream.cs
-
2NAudio/Wave/WaveStreams/WaveFileReader.cs
-
47NAudioTests/Acm/WaveFormatConversionStreamTests.cs
-
15NAudioTests/AudioClientTests.cs
-
1NAudioTests/NAudioTests.csproj
-
55NAudioTests/ResamplerDmoStreamTests.cs
@ -0,0 +1,47 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
using System.Runtime.InteropServices; |
|||
|
|||
namespace NAudio.Wave |
|||
{ |
|||
|
|||
public sealed class WaveFormatCustomMarshaler : ICustomMarshaler |
|||
{ |
|||
private static WaveFormatCustomMarshaler marshaler = null; |
|||
|
|||
public static ICustomMarshaler GetInstance(string cookie) |
|||
{ |
|||
if (marshaler == null) |
|||
{ |
|||
marshaler = new WaveFormatCustomMarshaler(); |
|||
} |
|||
return marshaler; |
|||
} |
|||
|
|||
public void CleanUpManagedData(object ManagedObj) |
|||
{ |
|||
|
|||
} |
|||
|
|||
public void CleanUpNativeData(IntPtr pNativeData) |
|||
{ |
|||
Marshal.FreeHGlobal(pNativeData); |
|||
} |
|||
|
|||
public int GetNativeDataSize() |
|||
{ |
|||
throw new NotImplementedException(); |
|||
} |
|||
|
|||
public IntPtr MarshalManagedToNative(object ManagedObj) |
|||
{ |
|||
return WaveFormat.MarshalToPtr((WaveFormat)ManagedObj); |
|||
} |
|||
|
|||
public object MarshalNativeToManaged(IntPtr pNativeData) |
|||
{ |
|||
return WaveFormat.MarshalFromPtr(pNativeData); |
|||
} |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue