Ejemplo n.º 1
0
        public long PacketToFrame(long packet)
        {
            AudioFramePacketTranslation buffer;

            buffer.Packet = packet;

            unsafe {
                AudioFramePacketTranslation *p = &buffer;
                int size = Marshal.SizeOf(buffer);
                if (AudioFileGetProperty(handle, AudioFileProperty.PacketToFrame, ref size, (IntPtr)p) == 0)
                {
                    return(buffer.Frame);
                }
                return(-1);
            }
        }
Ejemplo n.º 2
0
        public long PacketToFrame(long packet)
        {
            AudioFramePacketTranslation buffer;

            buffer.Packet = packet;

            unsafe {
                AudioFramePacketTranslation *p = &buffer;
                int size = sizeof(AudioFramePacketTranslation);
                LastError = AudioFileStreamGetProperty(handle, AudioFileStreamProperty.PacketToFrame, ref size, (IntPtr)p);
                if (LastError == 0)
                {
                    return(buffer.Frame);
                }
                return(-1);
            }
        }
Ejemplo n.º 3
0
        public long FrameToPacket(long frame, out int frameOffsetInPacket)
        {
            AudioFramePacketTranslation buffer;

            buffer.Frame = frame;

            unsafe {
                AudioFramePacketTranslation *p = &buffer;
                int size = Marshal.SizeOf(buffer);
                if (AudioFileGetProperty(handle, AudioFileProperty.FrameToPacket, ref size, (IntPtr)p) == 0)
                {
                    frameOffsetInPacket = buffer.FrameOffsetInPacket;
                    return(buffer.Packet);
                }
                frameOffsetInPacket = 0;
                return(-1);
            }
        }
Ejemplo n.º 4
0
        public long FrameToPacket(long frame, out int frameOffsetInPacket)
        {
            AudioFramePacketTranslation buffer;

            buffer.Frame = frame;

            unsafe {
                AudioFramePacketTranslation *p = &buffer;
                int size = sizeof(AudioFramePacketTranslation);
                LastError = AudioFileStreamGetProperty(handle, AudioFileStreamProperty.FrameToPacket, ref size, (IntPtr)p);
                if (LastError == 0)
                {
                    frameOffsetInPacket = buffer.FrameOffsetInPacket;
                    return(buffer.Packet);
                }
                frameOffsetInPacket = 0;
                return(-1);
            }
        }