I think I have tested with Marshal.AllocHGlobal, and got the same garbled
output.

Currently it's done like this:

m_spMemoryStream = new SpMemoryStream();

m_spMemoryStream.Format.Type =
SpeechLib.SpeechAudioFormatType.SAFT8kHz16BitMono;

m_spVoice.AudioOutputStream = m_spMemoryStream;

m_spVoice.Speak(speechString, SpeechVoiceSpeakFlags.SVSFDefault |
SpeechVoiceSpeakFlags.SVSFPurgeBeforeSpeak );


byte [] byteArray = (byte[]) m_spMemoryStream.GetData();

GCHandle gcHandle = GCHandle.Alloc(byteArray, GCHandleType.Pinned);

IntPtr bufferIntPtr = gcHandle.AddrOfPinnedObject();

SipxCallPlayBufferStart(m_handleIntPtr, bufferIntPtr, byteArray.Length, 0,
false, false, true);



----- Original Message ----- 
From: "Daniel Sigurgeirsson" <[EMAIL PROTECTED]>
To: "stipus" <[EMAIL PROTECTED]>; <[email protected]>
Sent: Thursday, June 14, 2007 4:16 PM
Subject: RE: [sipxtapi-dev] SipxCallPlayBufferStart and jerky output
...I'mpuzzled !


How is the buffer allocated in the first place? I've used the
sipxCallPlayBufferStart (from .NET) with no problems, allocating buffer
using Marshal.AllocHGlobal( ).

Regards,
DanĂ­el


_______________________________________________
sipxtapi-dev mailing list
[email protected]
List Archive: http://list.sipfoundry.org/archive/sipxtapi-dev/

Reply via email to