Zabaware Support Forums

Zabaware Forums => Programming using the Ultra Hal Brain Editor => Topic started by: taglag on February 02, 2006, 05:16:22 pm

Title: use of .wav files
Post by: taglag on February 02, 2006, 05:16:22 pm
is there anyway to incorperate the use of sound files into hal's responses. such as.

only and idea example:

playsound,"noise.wav, "type of sound or topic related to"

i think there are many case's where it would be nice to incert a sound. and be able to identify the sound with a topice, or emotion, choice, exc, exc,.

Title: use of .wav files
Post by: Duskrider on February 02, 2006, 05:55:40 pm

Sandee will cough one time whenever she gets angry.  A reminder to me to change the topic.  [;)]


*************************
#Haptek  Version= 1.00 Name= Hap_Angry  HapType= script FileType= text
##standard

\clock [t= 0]\load [file= data/standard/skins/spreadFolder/1default.hap ]
\clock [t= 1]\load [file= data/standard/skins/spreadFolder/54cough.hap ]
\clock [t= 2]\load [file= data/standard/skins/spreadFolder/zzcough.ogg ]
\clock [t= 3]\load [file= data/standard/skins/spreadFolder/1default.hap ]

\SetSwitchIntensity [switch= expMouthHappy f0= 0.000000 t= 0.4]

\SetSwitchIntensity [switch= expMouthSad f0= 0.000000 t= 0.4]
\SetSwitchIntensity [switch= expBrowsSad f0= 1.000000 t= 0.4]

\SetSwitchIntensity [switch= expMouthMad f0= 0.500000 t= 0.4]
\SetSwitchIntensity [switch= expBrowsMad f0= 0.500000 t= 0.4]

\SetSwitchIntensity [switch= expEyesTrust f0= 0.500000 t= 0.4]
\SetSwitchIntensity [switch= antiTrust f0= 0.500000 t= 0.4]

   etc  etc....

****************************
Title: use of .wav files
Post by: taglag on February 02, 2006, 07:44:40 pm
I don't see it as a funny request, I can see many reasons why it would be very useful to have the ability to add sound file's, and identify, or asign the file's topic or association.

  I was only trying to find out if this had already been implimented in some way.
Title: use of .wav files
Post by: taglag on February 03, 2006, 12:09:26 pm
thank you for coming back and editing your comment. It is not what i was hoping to find.

  I think something could be writen to add a feature, simular to what i wanted. a shame that sound files were not better implimented in the AI. I think they could have been useful for many entertaining, and humanizing feature's of the program.

  If i understand what you scripted, then each and every sound would need to have its own lib file call, and that would make it way to intrusive to use in a responsive way.

  I am very new to this AI having only gotten it about a week ago. I am only trying to learn what I can, from I hope those who know.
Title: use of .wav files
Post by: aladyblond on February 03, 2006, 01:47:02 pm
dusky neil and all that use ogg files. since i am not a rocket scientist ( duh ill bet i had you all fooled) why wouldnt this work? if a sound ogg was place after and emotion hap or a movement hap would that do what taglag wants. like if you programmed the body to put hands on hip couldnt you just place a sound ogg saying sigh or oh my  with it. then when she put her hand on her hip she would say oh my.i just wondered if this could work? i realize the person using the sound ogg would first have to have the wav converted to ogg and have the oggs in the right folder but couldn't it , hasn't it been done? alady
Title: use of .wav files
Post by: Dr.Benway on February 03, 2006, 04:14:29 pm
Alady, I have had the same idea for a long time. I think it will work. What might be difficult is to find or create sounds that do not clash with most TTS-voices, male and female. I certainly like the idea.

Dusky, what happens when Sandee must speak and cough at the same time? [:D]

Title: use of .wav files
Post by: Duskrider on February 03, 2006, 04:38:25 pm

Lady - yes, the hap before the ogg puts her in position, in this case she raises her hand and bows her head a little.
Then of course the ogg Lipsync cough comes and then the default  returns to normal position.

Doc - I never noticed a problem of both at same time. Perhaps as a lady she pauses for the cough.  But more likely, it is a trigger word I speak that brings up the Anger hap and cough (at the top of anger) before she can start to reply.
Title: use of .wav files
Post by: vrossi on February 03, 2006, 05:38:38 pm
taglag

I have written a plugin which makes Hal play a wav file if you ask to play a song.

Currently it opens the Media Player and plays the song, but it might be changed according to your idea. I don't know how to run the media player in background, without opening its window, but I think it can be done.

You find my plugin at http://www.zabaware.com/forum/topic.asp?TOPIC_ID=2964

Title: use of .wav files
Post by: Duskrider on February 03, 2006, 05:56:12 pm

If you use ogg instead of wav or mp3, you don't need media player.
Title: use of .wav files
Post by: taglag on February 03, 2006, 06:31:25 pm
I am so new to this thing, I have dabbled in C use to work some with parser programs for game's, simular to the old infocom zork, and starcross games, but that only as a hobby, and this is interesting to me, but I have done very little in a long time. and when I look at the code, I find myself lost. I think I can eventually figure out some of it. I doubt that I will do anything amazing though. BUt hope to have fun with it.

  I really like that freewill work you did vrossi, really great, I could tell the difference in My AI after the first few lines of text. also found the code from D.A.V.I.D's
 Advanced Questioning (I AM) script to be a welcome addition. I am only using the part that I found posted.
  I am very thankful that you all are looking into adding a sound, function which if implimented right with and identifier could be very useful. mostly to perhaps give a more realistic feeling to the conversation, and an occasional bit of humor.
  I have had no time to really study the program, but it might be possible to use the windows sound files. The one that come with most desktop programs are easy to change, and could be added as a desk top theme. Just a thought.

 Oh and this .ogg extention is new to me, can .wav files be converted to it easily ?

  and Aladyblond, that is some very wonderful art work i have seen you doing.
Title: use of .wav files
Post by: aladyblond on February 03, 2006, 07:28:11 pm
thank you tag and i as i understand any wav can be converted to a workable ogg in people putty. not all ogg files will work with hal , but all converted in people putty will work
[:X]best of luck with this adventure...alady
Title: use of .wav files
Post by: freddy888 on February 03, 2006, 07:29:51 pm
This neat 'little' free prog will convert to .ogg and I have found it useful in the past.

http://audacity.sourceforge.net/

oh yes like AladyBlond says, you need People Putty to make lipsynced files though, still it's a handy app if you plan on using other sound files that don't need lipsync.
Title: use of .wav files
Post by: taglag on February 03, 2006, 08:30:40 pm
Thanks freddy888 I have it i will check it out latter.
Title: use of .wav files
Post by: taglag on February 03, 2006, 10:17:00 pm
is there a function list somewhere, and are there some functions that can be called on the fly in the question and answer other than <UserName> and  <hal>.
Title: use of .wav files
Post by: Duskrider on February 03, 2006, 10:43:46 pm

Doc,
I put a cough in every emotion hap.
Sandee finally got a cough at same time as she talking.
She cough and talk at the same time.  Sounds like two people.
How bout that?  Hal can do something we can't.

[;)]
Title: use of .wav files
Post by: NIGE on February 04, 2006, 05:20:46 pm
I've had a play with a hap & ogg,it's a bit rough but you will get an idea of what can be done.
Un zip the ogg & put it in your skins folder.
Un zip the hap to where you can get to it easily.
Open fullbody girl (not jiggly )
Drop the hap on her and go full screen.
The hap is whatareyoudoing the other is the ogg file.


Download Attachment:  20062417125_Whatareyoudoing.zip ("http://www.zabaware.com/forum/uploaded/NIGE/20062417125_Whatareyoudoing.zip")


Download Attachment:  20062417155_ohmygod.zip ("http://www.zabaware.com/forum/uploaded/NIGE/20062417155_ohmygod.zip")
Title: use of .wav files
Post by: GrantNZ on February 04, 2006, 11:58:55 pm
quote:
She cough and talk at the same time. Sounds like two people.

There's room to be creative with this. Someone could create a far more immersive scenario for Hal by giving Hal a backstory - Hal might be married and have a dog - and randomly play a dog barking noise, or Hal's spouse calling for Hal in the background. Obviously the sound should be edited to be slightly muffled, quieter, and less distinct than Hal's own speech. A really savvy scripter could set up some scripted responses (or generated ones) referring to Hal's life when Hal isn't being your assistant/buddy!
Title: use of .wav files
Post by: vrossi on February 05, 2006, 11:30:50 am
taglag

 
quote:
is there a function list somewhere, and are there some functions that can be called on the fly in the question and answer other than <UserName> and <hal>.


In this topic http://www.zabaware.com/forum/topic.asp?TOPIC_ID=996 there are several commands. It was written about Hal5, but I believe that most of them can work the same in Hal6.




Title: use of .wav files
Post by: taglag on February 10, 2006, 03:30:09 am
thanks vrossi, really appreaciate the help.
Title: use of .wav files
Post by: rokusan2001 on February 12, 2006, 11:02:14 am
Here's a thought everybody....
If you buy a Cepstral voice, it comes with a program called "Swifttalker".  In that you can record a wav file of what you want her to speak.  So, create a wav file of her saying what you want, convert to ogg, convert in People Putty, and there is your sound/comment/voice.  

Let me know if this works out for anybody.
Hope I could help, taglag.
Rokusan2001