TADS 3: Invoking a sound file from a link

When the user clicks on a link, I want to play a sound file.

This statement works:

<a HREF=\'http://www.fileden.com/files/2008/10/13/2140959/Frosty/zing.mp3\'> Click to hear Frosty's voice</a>
It works because…

============================================================

However, I want to play a sound file that resides on the user’s computer.

This statement does not work:

<a HREF=\'file:zing.mp3\'> Click to hear Frosty's voice</a>
because…

============================================================

Moreover, TADS 3 needs the tag to play a sound file.

============================================================

Thus, I’m stuck.

Please, does anybody know how to play a sound file when the user clicks on a link?

Thanks for your help.

Jeff

I’ve finished writing my first IF with TADS 3. Just cleaning up loose ends now.

Jim Aikin on the rec.arts.int-fiction newsgroup provided the solution to this problem. Here’s the implementation in my code:

[code]<a HREF=‘voice1’>Click to hear Frosty’s voice

DefineIAction(Voice1)
execAction()
{
“<SOUND SRC=“sound\Track01.mp3” LAYER=BACKGROUND>”;
}
;

VerbRule(Voice1)
‘voice1’
: Voice1Action
verbPhrase = ‘Frosty’s voice 1’
;[/code]

Tricky, but functional. :slight_smile:

Jeff