Large sound files

Ken Ray kray at sonsothunder.com
Wed Oct 22 14:43:34 EDT 2003


> What I want in the end is to check that gmySound is True, if so then 
> check a sound file for that card, then to play that sound file. This 
> seems pretty straight forward at first. I have tried the suggestions 
> from the list but they have not produced a positive result.

I'd suggest something like this: set a custom property for the card that
corresponds to the sound file to play for that card. gMySound is used to
either play the sound or not, based on its true/false setting. Something
like this:

-- stack/background/library script:

global gMySound

on openCard
  if gMySound then
    put the soundPath of this card into tSoundPath  -- custom card prop
    if there is not a file tSoundPath then
      answer file "Please choose a file to play:"
      if it <> "" then
        set the soundPath of this card to it
        put it into tSoundPath
      else
        exit openCard
      end if
    end if
    set the fileName of player 1 to tSoundPath
    play player 1
  end if
end openCard

Hopefully this should work for you... 

Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/ 




More information about the Use-livecode mailing list