Archive

Archive for September, 2005

InitTTSCaptureStream of object ITTSSTream failed

September 29, 2005 Leave a comment
It’s very rarely, that you type an error message into google and get 0 results. It’s extremly discouraging to realize you are the only person in the world who has encountered this bug before. – Or at least the only person to take the time to talk about it on the web.
 
I’m stuggling with a Telephony application, Trying to use TAPI in .NET. I had it mostly working on a voice modem, making calls, playing audio, etc. But due to the limitations in the unimodem TSP – which are well documented, I decided to invest in some professional Telephony equipment, namely a Dialogic D/4PCI. It gets around the pitfalls of the voice modem TSP, but – the audio is scewed up.
 
I’m using code as follows:

playTerminal=currentCall.RequestTerminal("{0CB9914C-79CD-47dc-ADB0-327F47CEFB20}",

(int)MediaMode.MT_AUDIO,TERMINAL_DIRECTION.TD_CAPTURE);

//Create a playlist with the file sent as parameter

playback=(ITMediaPlayback)playTerminal;

Object[] playList = { String.Format(@"{0}TestWave.wav",Application.StartupPath) };

playback.PlayList=playList;

//

// //Assign terminal to call and starts playing

currentCall.SelectTerminalOnCall(playTerminal);

// … Then after the call is accepted…

ITMediaPlayback playback;

playback=(ITMediaPlayback)playTerminal;

Object[] playList = { fileName };

playback.PlayList=playList;

ITMediaControl mediaControl;

mediaControl=(ITMediaControl)playTerminal;

mediaControl.Start();

 

The audio quality is terrible, with stuttering, and excessive echo. I think, it’s something to do with the half-duplex nature of the 4/PCI. But to be honest I don’t know.

 

I even had a crack at working with some of the TAPI examples in the SAPI SDK – modifying the code to use my Dialogic card rather than the H323 line.

 

But I got stuck when I hit the error InitTTSCaptureStream of object ITTSSTream failed

And there is no information whatsoever on the net about it.

 

Advertisements
Categories: Uncategorized

Resurecting WinMX

September 24, 2005 Leave a comment
One of the beauties of P2P, I believed was that the network was supposed to be decentralized. And now, with the RIAA sueing WinMX, the entire network goes down. I would have thought, with so many people with WINMX (limeware/bearshare) installed that each copy of the client software would have built up a cache of other peers on the network it could connect to.
 
I believe, that all it will take is somebody to develop a pure P2P application, wthout this "single point of failure" in order to indefinitely defeat the music licensing industry.
 
Of course, I’m not advocating copyright piracy, after all, if you’re buying a CD, need I recommend www.buymusic.cd
🙂
 
Categories: Uncategorized

Printer error 482

September 16, 2005 Leave a comment
Murphys law. You write a cool application which works fine on your development environment,
you install it on your client’s machine, and you get some obscure vague error. In my case "Printer error 482".
 
Something to do with printing a document when the printer is on a network share. (I’m using VB6). And for the life of me I can’t re-create it at home.
 
Has anyone ever come accross this error before?, Or is there an alternative way to print from VB6?
Like spawing another application such as IE or paint to do the printing for it? (ok that’s a hack solution – but I’m desperate)
 
Categories: Uncategorized

Ebay phishing scam

September 7, 2005 Leave a comment
I actually fell for this one, feel rather stupid.
 

Dear eBay member,

Hey are you going to buy the item from the auction that you won, why dont you answer to my emails, if you dont Respond Now I will contact ebay safeharbor and I will report you !  I am not a fool !

 

If you get this email, just delete it.

Categories: Uncategorized

RETURN statements in scalar valued functions must include an argument.

September 5, 2005 1 comment
Ever get one of those vague error messages back from SQL server, for once, I decided to throw a bit of light on this gem "RETURN statements in scalar valued functions must include an argument."
 
It occurs when you omit the brackets after a return statement in a User defined function i.e
 
create function fn_something(@something float)
returns float
as
begin
 return
 select  @something + 10  
end
 
gives you:
Server: Msg 1075, Level 15, State 1, Procedure fn_something, Line 5
RETURN statements in scalar valued functions must include an argument.
 
but this works
 
create function fn_something(@something float)
returns float
as
begin
 return ( select  @something + 10  )
end
Categories: Uncategorized

XSL stylesheet for displaying serialized datasets

September 5, 2005 Leave a comment
A utility I wrote some time ago http://www.webtropy.com/articles/art22-SQLCache.asp?SQL%20Server%20Performance for increasing SQL server (repeat) performance using XML caching used XMLSerializer to create XML files which were serialized versions of Datasets returned from SQL server.
 
I was looking for an easy way to display the contents of these files, without sifting through XML. I decided to have a look at writing a generic XSL style sheet to view these serialized datasets. First, I add a line to the top of the xml file:
<?xml-stylesheet type="text/xsl" href="dataset.xsl"?>
 
where dataset.xsl is:
 
<?xml version=’1.0′?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
<xsl:template match="/">
  <html>
  <body>
    <table>
   <tr>
    <xsl:for-each select="DataSet/xs:schema/xs:element/xs:complexType/xs:choice/xs:element/xs:complexType/xs:sequence/xs:element">
         <td><b><xsl:value-of select="@name"/></b></td>   
    </xsl:for-each>
       </tr>
    <xsl:for-each select="/DataSet/diffgr:diffgram/NewDataSet/*">
   <tr>
    <xsl:for-each select="*">
         <td><xsl:value-of select="." /></td>   
    </xsl:for-each>
       </tr>
   </xsl:for-each>
    </table>
  </body>
  </html>
</xsl:template>
</xsl:stylesheet>
 
 
Categories: Uncategorized

Mcisendstring in .NET for recording audio

September 2, 2005 Leave a comment
Just found out how to record and playback audio. Really easy.
 

Private Declare Function mciSendString Lib "Winmm.dll" Alias "mciSendStringA" _

(

ByVal lpstrCommand As String, ByVal lpstrReturnString As String, _

ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long

 

Public Sub recordToWave(ByVal filename As String)

mciSendString("open new type waveaudio alias capture", vbNullString, 0, 0)

mciSendString("record capture", vbNullString, 0, 0)

blnIsRecording =

True

While blnIsRecording

Application.DoEvents()

End While

mciSendString("save capture " + filename, vbNullString, 0, 0)

mciSendString("close capture", vbNullString, 0, 0)

End Sub

Public Sub playWave(ByVal filename As String)

mciSendString("Play waveaudio!" + filename, vbNullString, 0, 0)

End Sub

Categories: Uncategorized