Jump to content

Microsoft Sam - "Bad to the bone"


 Share

Recommended Posts

Just for fun if you have SAPI.

It's not like you would really want to listen to MS Sam sing if it wasn't for fun.

Global Const $SVSFlagsAsync=1
Global Const $SRSEIsSpeaking=2
Global $_SAPI_SpVoice

_SAPI_Startup()

$Voices=$_SAPI_SpVoice.GetVoices()
For $i=0 To $Voices.Count-1
 $SpObjectToken=$Voices.Item($i)
 $Name=$SpObjectToken.GetDescription()
 ConsoleWrite($Name&@CRLF)
 If $Name='Microsoft Sam' Then $_SAPI_SpVoice.Voice=$SpObjectToken
Next


Global $Lyrics

; Bad to the Bone
_SAPI_Rate(2)
$Lyrics="On the day I was born, the nurses all gathered 'round. "& _
"And they gazed in wide wonder, at the juoy they had found. "& _
"The head nurse spoke up, and she said leave this one alone. "& _
'She could tell right away, that I was Bad to the Bone! '
_SAPI_Speak($Lyrics,$SVSFlagsAsync,True)
_B2()
_B2()
_B0()
_B1_2()
_B2()
$Lyrics="I broke a thousand hearts, before I met you. "& _
"I'll break a thousand more baby, before I am through. "& _
"I wanna be yours pretty baby, yours and yours alone. "& _
"I'm here to tell ya honey, that I'm bad to the bone! "
_SAPI_Speak($Lyrics,$SVSFlagsAsync,True)
_B2()
_B1_2()
_B1_1()
_B2()
$Lyrics="I make a rich woman beg, I'll make a good woman steal. "& _
"I'll make an old woman blush, and make a young woman squeal. "& _
"I wanna be yours pretty baby, yours and yours alone. "& _
"I'm here to tell ya honey, that I'm bad to the bone! "
_SAPI_Speak($Lyrics,$SVSFlagsAsync,True)
_B1_2()
_B1_1()
_B2()


Func _B0()
 _SAPI_Rate(5)
 _SAPI_Speak('Buh buh buh buh buh buh Bad to the bone!',$SVSFlagsAsync)
 _SAPI_WaitChangeRate(1,150,True); 2 didn't sound right.
EndFunc
Func _B1_1()
 _SAPI_Rate(5)
 _SAPI_Speak('Buh buh buh buh buh buh Bad!',$SVSFlagsAsync)
 _SAPI_WaitChangeRate(-5,150,True)
EndFunc
Func _B1_2()
 _B1_1()
 _SAPI_Rate(5)
 _SAPI_Speak('Buh buh buh buh buh buh Bad?',$SVSFlagsAsync)
 _SAPI_WaitChangeRate(-5,150,True)
EndFunc
Func _B2()
 _SAPI_Rate(2)
 _SAPI_Speak('Bad to the bone!',$SVSFlagsAsync,True)
EndFunc


Func _SAPI_Startup()
 Global $_SAPI_SpVoice
 If Not IsObj($_SAPI_SpVoice) Then $_SAPI_SpVoice=ObjCreate("SAPI.SpVoice")
EndFunc
Func _SAPI_Speak($sText, $iFlags=0, $fWaitFinishAsync=False, $iWaitFinishAsync=3600000)
 Global $_SAPI_SpVoice
 If IsObj($_SAPI_SpVoice) Then $_SAPI_SpVoice.Speak($sText,$iFlags)
 If $fWaitFinishAsync Then _SAPI_WaitFinishAsync($iWaitFinishAsync)
EndFunc
Func _SAPI_WaitFinishAsync($iMaxTime=3600000)
 Global $_SAPI_SpVoice
 If IsObj($_SAPI_SpVoice) Then
 Local $TWFAsync=TimerInit()
 Sleep(25); if I don't do this, the Status doesn't get set soon enough.
 While $_SAPI_SpVoice.Status.RunningState=$SRSEIsSpeaking And TimerDiff($TWFAsync)<$iMaxTime
 Sleep(300)
 WEnd
 EndIf
EndFunc
Func _SAPI_Rate($iNewRate)
 $_SAPI_SpVoice.Rate=$iNewRate
EndFunc
Func _SAPI_WaitChangeRate($iNewRate,$iWaitTime,$fWaitFinishAsync=False, $iWaitFinishAsync=3600000)
 $Timer=TimerInit()
 While 1
 If TimerDiff($Timer)>=$iWaitTime Then
 $_SAPI_SpVoice.Rate=$iNewRate
 ExitLoop
 EndIf
 Sleep(50)
 WEnd
 $Timer=0
 If $fWaitFinishAsync Then _SAPI_WaitFinishAsync($iWaitFinishAsync)
EndFunc

Func _SAPI_GetVoiceName()
 Global $_SAPI_SpVoice
 If IsObj($_SAPI_SpVoice) Then Return $_SAPI_SpVoice.Voice.GetDescription()
EndFunc
Func _SAPI_Shutdown()
 Global $_SAPI_SpVoice
 $_SAPI_SpVoice=0
EndFunc

EDIT: corruption fixed, helicopter easter egg gone.

Edited by crashdemons

My Projects - WindowDarken (Darken except the active window) Yahsmosis Chat Client (Discontinued) StarShooter Game (Red alert! All hands to battlestations!) YMSG Protocol Support (Discontinued) Circular Keyboard and OSK example. (aka Iris KB) Target Screensaver Drive Toolbar Thingy Rollup Pro (Minimize-to-Titlebar & More!) 2D Launcher physics example Ascii Screenshot AutoIt3 Quine Example ("Is a Quine" is a Quine.) USB Lock (Another system keydrive - with a toast.)

Link to comment
Share on other sites

Well, here's this - but it doesn't sound any better.

Global Const $SVSFlagsAsync=1
Global Const $SRSEIsSpeaking=2
Global $_SAPI_SpVoice
_SAPI_Startup()
_SetVoice('Microsoft Sam')


;;; Sympathy For The Devil ;;;
Global $Lyrics
_R0_1()
_SAPI_Rate(2)
$Lyrics="I've been around for a long long year. "& _
"Stole many a man's soul, and faith. "
_SAPI_Speak($Lyrics, $SVSFlagsAsync,True)
$Lyrics="I was 'round when Jesus Christ. "& _
"Had his moment, of doubt, and pain. "& _
"Made damn sure that Pilate. "& _
"Washed his hands, and sealed his fate. "
_SAPI_Speak($Lyrics, $SVSFlagsAsync,True)
_R1()
_R2()
_R3()
_SAPI_Rate(2)
$Lyrics="I stuck around St. Petersberg. "& _
"When I saw it was a time, for a change. "& _
"Killed the Czar, and his ministers. "& _
"Anastasia screamed in vain. "
_SAPI_Speak($Lyrics, $SVSFlagsAsync,True)
$Lyrics="I rode a tank. "& _
"Held a generals rank. "& _
"When the Blitzkrieg raged. "& _
"And the bodies stank. "
_SAPI_Speak($Lyrics, $SVSFlagsAsync,True)
_R1()
_R2()
_R3()
_SAPI_Rate(2)
$Lyrics="I watched with glee. "& _
"While your kings and queens. "& _
"Fought for ten decades. "& _
"For the Gods they made. "
_SAPI_Speak($Lyrics, $SVSFlagsAsync,True)
$Lyrics="I shouted out. "& _
"Who killed the Kennedys? "& _
"When after all. "& _
"It was you and me. "
_SAPI_Speak($Lyrics, $SVSFlagsAsync,True)
_R0_2()
_SAPI_Rate(2)
$Lyrics="And I laid traps for troobuhdoors. "& _
"Who get killed before they reached Bombay. "; MS Sam pronounces "troubadours" as "troo-badders"
_SAPI_Speak($Lyrics, $SVSFlagsAsync,True)
_R1()
_R2(True)
_R3()
Sleep(500); guitar solo?
_R1()
_R2(True)
_R3(True)
_SAPI_Rate(1)
$Lyrics="Just as every cop is a criminal. "& _
"And all the sinners saints. "& _
"As heads is tails, just call me Loosiffer. "& _
"'Cause I'm in need of some restraint. "; "Lucifer" was being pronounced "lussiffer"
_SAPI_Speak($Lyrics, $SVSFlagsAsync,True)
$Lyrics="So if you meet me. "& _
"Have some courtesy. "& _
"Have some sympathy, and some taste. "& _
"Use all your well-learned politesse. "& _
"Or I'll lay your. soul to waste. "
_SAPI_Speak($Lyrics, $SVSFlagsAsync,True)
_R1()
_R2(True)
_R3()
_SAPI_Rate(2)
_SAPI_Speak('Tell me baby, whats my name?', $SVSFlagsAsync,True)
_SAPI_Speak('Tell me honey, baby guess my name!', $SVSFlagsAsync,True)
_SAPI_Speak('Tell me baby, whats my name?', $SVSFlagsAsync,True)
_SAPI_Speak("tell you one time, you're to blame!", $SVSFlagsAsync,True)
Sleep(500); who, who?
_SAPI_Speak('whats my name?', $SVSFlagsAsync,True)
_SAPI_Speak('Tell me baby, whats my name?', $SVSFlagsAsync,True)
_SAPI_Speak('Tell me sweetie, whats my name?', $SVSFlagsAsync,True)



_SAPI_Shutdown()
Exit



Func _R0_1()
    _SAPI_Rate(2)
    _SAPI_Speak('Please allow me, to introduce myself', $SVSFlagsAsync,True)
    _R0()
EndFunc
Func _R0_2()
    _SAPI_Rate(2)
    _SAPI_Speak('Let me please, introduce myself', $SVSFlagsAsync,True)
    _R0()
EndFunc
Func _R0()
    _SAPI_Rate(2)
    _SAPI_Speak("I'm a man, of wealth, and taste", $SVSFlagsAsync,True)
EndFunc


Func _R1()
    _SAPI_Rate(2)
    _SAPI_Speak('Pleased to meet you.', $SVSFlagsAsync)
    _SAPI_WaitChangeRate(-5,100,True)
EndFunc

Func _R2($m=False)
    _SAPI_Rate(3)
    $t='I hope you guess my name!'
    If $m Then $t=StringReplace($t,'guess','guessed')
    _SAPI_Speak($t, $SVSFlagsAsync)
    ;_SAPI_WaitChangeRate(-3,200)
    _SAPI_WaitChangeRate(-5,500,True)
EndFunc

Func _R3($m=False)
    _SAPI_Rate(2)
    $t='But whats puzzling you'
    If $m Then $t=StringReplace($t,'puzzling','confusing')
    _SAPI_Speak($t, $SVSFlagsAsync)
    _SAPI_WaitChangeRate(-5,100,True)

    _SAPI_Rate(3)
    $t='Is the nature of my game!'
    If $m Then $t=StringReplace($t,'Is the','Is just the')
    _SAPI_Speak($t, $SVSFlagsAsync)
    _SAPI_WaitChangeRate(-3,200)
    _SAPI_WaitChangeRate(-5,500,True)
EndFunc



Func _SetVoice($sName='Microsoft Sam')
    $Voices=$_SAPI_SpVoice.GetVoices()
    For $i=0 To $Voices.Count-1
        $SpObjectToken=$Voices.Item($i)
        $Name=$SpObjectToken.GetDescription()
        ConsoleWrite($Name&@CRLF)
        If $Name=$sName Then
            $_SAPI_SpVoice.Voice=$SpObjectToken
            ExitLoop
        EndIf
    Next
EndFunc


Func _SAPI_Startup()
    Global $_SAPI_SpVoice
    If Not IsObj($_SAPI_SpVoice) Then $_SAPI_SpVoice=ObjCreate("SAPI.SpVoice")
EndFunc
Func _SAPI_Speak($sText, $iFlags=0, $fWaitFinishAsync=False, $iWaitFinishAsync=3600000)
    Global $_SAPI_SpVoice
    If IsObj($_SAPI_SpVoice) Then $_SAPI_SpVoice.Speak($sText,$iFlags)
    If $fWaitFinishAsync Then _SAPI_WaitFinishAsync($iWaitFinishAsync)
EndFunc
Func _SAPI_WaitFinishAsync($iMaxTime=3600000)
    Global $_SAPI_SpVoice
    If IsObj($_SAPI_SpVoice) Then
        Local $TWFAsync=TimerInit()
        Sleep(25); if I don't do this, the Status doesn't get set soon enough.
        While $_SAPI_SpVoice.Status.RunningState=$SRSEIsSpeaking And TimerDiff($TWFAsync)<$iMaxTime
            Sleep(300)
        WEnd
    EndIf
EndFunc
Func _SAPI_Rate($iNewRate)
    $_SAPI_SpVoice.Rate=$iNewRate
EndFunc
Func _SAPI_WaitChangeRate($iNewRate,$iWaitTime,$fWaitFinishAsync=False, $iWaitFinishAsync=3600000)
    $Timer=TimerInit()
    While 1
        If TimerDiff($Timer)>=$iWaitTime Then
            $_SAPI_SpVoice.Rate=$iNewRate
            ExitLoop
        EndIf
        Sleep(50)
    WEnd
    $Timer=0
    If $fWaitFinishAsync Then _SAPI_WaitFinishAsync($iWaitFinishAsync)
EndFunc

Func _SAPI_GetVoiceName()
    Global $_SAPI_SpVoice
    If IsObj($_SAPI_SpVoice) Then Return $_SAPI_SpVoice.Voice.GetDescription()
EndFunc
Func _SAPI_Shutdown()
    Global $_SAPI_SpVoice
    $_SAPI_SpVoice=0
EndFunc

My Projects - WindowDarken (Darken except the active window) Yahsmosis Chat Client (Discontinued) StarShooter Game (Red alert! All hands to battlestations!) YMSG Protocol Support (Discontinued) Circular Keyboard and OSK example. (aka Iris KB) Target Screensaver Drive Toolbar Thingy Rollup Pro (Minimize-to-Titlebar & More!) 2D Launcher physics example Ascii Screenshot AutoIt3 Quine Example ("Is a Quine" is a Quine.) USB Lock (Another system keydrive - with a toast.)

Link to comment
Share on other sites

really bored the other night, came up with this. tried to get him to say "yur bahrs, yur massahge pahlahs" but it don't come out right... :)

Global Const $SVSFlagsAsync=1
Global Const $SRSEIsSpeaking=2
Global $Lyrics
_SAPI_Startup()
_SAPI_voice_sam()

onib_chorus()
$Lyrics="Bang kok. Oriental setting "& _
"And the city don't know that the city is getting. "& _
"The crem de la crem of the chess world in a  "& _
"Show with everything but Yul Brynner. "& _
"Time flies. doesn't seem a minute "& _
"Since the Tirolean spa had the chess boys in it. "& _
"All change. don't you know that when you "& _
"Play at this level there's no ordinary venue. "& _
"It's Iceland... or the Philippines... or Hastings... or... or this place! "
onib_vs($Lyrics)
onib_chorus()


$Lyrics="One town's very like another When your head's down over your pieces, brother"
onib_vs($Lyrics)
$Lyrics="It's a drag, it's a bore, it's really such a pity To be looking at the board, not looking at the city"
onib_vm($Lyrics)
$Lyrics="Wait a minute! Ya seen one crowded, polluted, stinking town"
onib_vs($Lyrics)
$Lyrics="Tea girls, warm, sweet, Some are set up in the Somerset Maugham suite"
onib_vm($Lyrics)
$Lyrics="Get Thai'd! You're talking to a tourist Whose every move's among the purest. I get my kicks above the waistline, sunshine"
onib_vs($Lyrics)
onib_chorus()

$Lyrics="Siam's gonna be the witness To the ultimate test of cerebral fitness "& _
"This grips me more than would a Muddy old river or reclining Buddha. "& _
"And thank God I'm only watching the game, controlling it. "& _
"I don't see you guys rating "& _
"The kind of mate I'm contemplating. "& _
"I'd let you watch, I would invite you "& _
"But the queens we use would not excite you. "& _
"So you better go back to your bars, your temples, your massage parlours"
onib_vs($Lyrics)
onib_chorus()
Exit

Func onib_chorus()
$Lyrics="One night in Bangkok and the world's your oyster. "& _
"The bars are temples but the pearls ain't free. "& _
"You'll find a god in every golden cloister. "& _
"And if you're lucky then the god's a she. "& _
"I can feel an angel sliding up to me. " 
onib_vm($Lyrics)
endFunc 

Func onib_vm($say)
_SAPI_Rate(8)
_SAPI_voice_michelle()
_SAPI_Speak($say,$SVSFlagsAsync,True)
endFunc 

Func onib_vs($say)
_SAPI_Rate(3)
_SAPI_voice_sam()
_SAPI_Speak($say,$SVSFlagsAsync,True)
endFunc 

Func _SAPI_voice_sam()
$Voices=$_SAPI_SpVoice.GetVoices()
For $i=0 To $Voices.Count-1
    $SpObjectToken=$Voices.Item($i)
    $Name=$SpObjectToken.GetDescription()
    ConsoleWrite($Name&@CRLF)
    If $Name='Microsoft Sam' Then $_SAPI_SpVoice.Voice=$SpObjectToken
Next
endfunc

Func _SAPI_voice_michelle()
$Voices=$_SAPI_SpVoice.GetVoices()
For $i=0 To $Voices.Count-1
    $SpObjectToken=$Voices.Item($i)
    $Name=$SpObjectToken.GetDescription()
    ConsoleWrite($Name&@CRLF)
    If $Name='LH Michelle' Then $_SAPI_SpVoice.Voice=$SpObjectToken
Next
endfunc

Func _SAPI_Startup()
    Global $_SAPI_SpVoice
    If Not IsObj($_SAPI_SpVoice) Then $_SAPI_SpVoice=ObjCreate("SAPI.SpVoice")
EndFunc
    
Func _SAPI_Speak($sText, $iFlags=0, $fWaitFinishAsync=False, $iWaitFinishAsync=3600000)
    Global $_SAPI_SpVoice
    If IsObj($_SAPI_SpVoice) Then $_SAPI_SpVoice.Speak($sText,$iFlags)
    If $fWaitFinishAsync Then _SAPI_WaitFinishAsync($iWaitFinishAsync)
EndFunc
Func _SAPI_WaitFinishAsync($iMaxTime=3600000)
    Global $_SAPI_SpVoice
    If IsObj($_SAPI_SpVoice) Then
        Local $TWFAsync=TimerInit()
        Sleep(25); if I don't do this, the Status doesn't get set soon enough.
        While $_SAPI_SpVoice.Status.RunningState=$SRSEIsSpeaking And TimerDiff($TWFAsync)<$iMaxTime
            Sleep(300)
        WEnd
    EndIf
EndFunc
Func _SAPI_Rate($iNewRate)
    $_SAPI_SpVoice.Rate=$iNewRate
EndFunc
Func _SAPI_WaitChangeRate($iNewRate,$iWaitTime,$fWaitFinishAsync=False, $iWaitFinishAsync=3600000)
    $Timer=TimerInit()
    While 1
        If TimerDiff($Timer)>=$iWaitTime Then
            $_SAPI_SpVoice.Rate=$iNewRate
            ExitLoop
        EndIf
        Sleep(50)
    WEnd
    $Timer=0
    If $fWaitFinishAsync Then _SAPI_WaitFinishAsync($iWaitFinishAsync)
EndFunc

Func _SAPI_GetVoiceName()
    Global $_SAPI_SpVoice
    If IsObj($_SAPI_SpVoice) Then Return $_SAPI_SpVoice.Voice.GetDescription()
EndFunc
Func _SAPI_Shutdown()
    Global $_SAPI_SpVoice
    $_SAPI_SpVoice=0
EndFunc
Link to comment
Share on other sites

  • 8 months later...

Sorry for bumping an old topic, But does anyone have the helicopter one around? i was looking for it and couldn't find it as it was deleted.

0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...