Beispiel #1
0
        internal static IntPtr ProsodyToPtr(Prosody prosody, Collection <IntPtr> memoryBlocks)
        {
            if (prosody == null)
            {
                return(IntPtr.Zero);
            }
            ProsodyInterop prosodyInterop = default(ProsodyInterop);

            prosodyInterop._pitch    = prosody.Pitch;
            prosodyInterop._range    = prosody.Range;
            prosodyInterop._rate     = prosody.Rate;
            prosodyInterop._duration = prosody.Duration;
            prosodyInterop._volume   = prosody.Volume;
            ContourPoint[] contourPoints = prosody.GetContourPoints();
            if (contourPoints != null)
            {
                int num = Marshal.SizeOf((object)contourPoints[0]);
                prosodyInterop._contourPoints = Marshal.AllocCoTaskMem(contourPoints.Length * num);
                memoryBlocks.Add(prosodyInterop._contourPoints);
                for (uint num2 = 0u; num2 < contourPoints.Length; num2++)
                {
                    Marshal.StructureToPtr((object)contourPoints[num2], (IntPtr)((long)prosodyInterop._contourPoints + num * num2), false);
                }
            }
            else
            {
                prosodyInterop._contourPoints = IntPtr.Zero;
            }
            IntPtr intPtr = Marshal.AllocCoTaskMem(Marshal.SizeOf((object)prosodyInterop));

            memoryBlocks.Add(intPtr);
            Marshal.StructureToPtr((object)prosodyInterop, intPtr, false);
            return(intPtr);
        }
 public FragmentState(TtsEngineAction action, int langId, int emphasis, int duration, SayAs sayAs, Prosody prosody, char[] phonemes)
 {
     _action   = action;
     _langId   = langId;
     _emphasis = emphasis;
     _duration = duration;
     _sayAs    = sayAs;
     _prosody  = prosody;
     _phoneme  = phonemes;
 }
Beispiel #3
0
        internal Prosody Clone()
        {
            Prosody prosody = new Prosody();

            prosody._pitch    = _pitch;
            prosody._range    = _range;
            prosody._rate     = _rate;
            prosody._duration = _duration;
            prosody._volume   = _volume;
            return(prosody);
        }