using ComLight;
using System.Runtime.InteropServices;
namespace Whisper
{
/// A buffer with a chunk of audio.
/// Note the interface supports both marshaling directions.
/// I have not tested, but you should be able to implement this interface in C#, to supply PCM audio data to the native code
[ComInterface( "013583aa-c9eb-42bc-83db-633c2c317051", eMarshalDirection.BothWays )]
public interface iAudioBuffer: IDisposable
{
/// Count of samples in the buffer
int countSamples();
/// Unmanaged pointer to the internal buffer containing single-channel FP32 samples.
/// If you implementing this interface in C# and your audio data is on the managed heap, use to make sure it doesn't move.
/// Or better yet, move the data to unmanaged buffer allocated with or method.
IntPtr getPcmMono();
/// Unmanaged pointer to the internal buffer containing stereo FP32 samples.
/// When the buffer doesn’t have stereo data, the method gonna return .
IntPtr getPcmStereo();
/// Start time of the buffer, relative to the start of the media
void getTime( out TimeSpan time );
}
}