Dmitry,
Thanks for your response. I originally thought the GrabtrackAsAudio was performing an on-the-fly conversion in the sense that it was encoding chunks as it grabbed the wav file. From the source in the MSVS samples it appears it grabs the entire wav file before sending it for compression. This is fine, I just had it wrong in my mind.
I've implemented the GrabTrack and it works fine, but I'm having a problem with converting the StarBurn_StarWave_UncompressedFileCompress function to C#. The following are the pieces of code I'm using. The problem is I'm not sure how to properly define the PSTARBURN_STARWAVE_CALLBACK parameter. I was hoping you may be able to provide some guidance.
Code:
[DllImport("StarBurn.dll")]
private static extern ulong StarBurn_StarWave_UncompressedFileCompress
(
string p__PCHAR__SourceUncompressedFileName,
string p__PCHAR__DestinationCompressedFileName,
ulong p__ULONG__WorkingBufferSizeInUCHARs,
PSTARBURN_STARWAVE_CALLBACK p__PSTARBURN_STARWAVE_CALLBACK,
uint p__PVOID__Context,
STARBURN_STARWAVE_COMPRESSION p__STARBURN_STARWAVE_COMPRESSION
);
public enum STARBURN_STARWAVE_CALLBACK_REASON :uint
{
STARBURN_STARWAVE_CALLBACK_REASON_UNKNOWN = 0, // Unknown call reason
STARBURN_STARWAVE_CALLBACK_REASON_PROGRESS // Progress indication reason
}
public ulong CompressorCallback(
ulong p__ULONG__Reason,
ulong p__ULONG__Parameter,
IntPtr p__PVOID__Context)
{ return 0; }
public delegate uint PSTARBURN_STARWAVE_CALLBACK(
uint p__ULONG__Reason,
uint p__ULONG__Parameter,
IntPtr p__PVOID__Context);
// *** calling function in my compression sub
l__ULONG__Status = StarBurn_StarWave_UncompressedFileCompress
(
destPath,
System.IO.Path.ChangeExtension(destPath, ".wma"),
STARBURN_STARWAVE_IO_BUFFER_SIZE_IN_UCHARS,
(PSTARBURN_STARWAVE_CALLBACK)CompressorCallback, // [color=#BF0000]<=== I'm not sure how to define this[/color]
0,
STARBURN_STARWAVE_COMPRESSION.STARBURN_STARWAVE_COMPRESSION_WMA_LOSSLESS_VBR_Q100
);