problem playing sound 
Author Message
 problem playing sound

Hi.
The following program in a pushbutton:

  dim s as sound
  dim f as folderItem

  f = getOpenFolderItem("audio/aiff")
  if f <> nil then
    s = f.openassound
    if s <> nil then
      s.play
    else
      msgbox "failed to open"
    end if
  end if

shows various sound files in the OpenFile dialog box, but s always comes
up nil. File types include aiff files. This is pretty much stragight from
the examples. I can play the sounds from QT player. Some are even created
by one of my RB programs.
What gives?

Ben



Wed, 28 Jan 2004 10:46:09 GMT  
 problem playing sound

Quote:

> Hi.
> The following program in a pushbutton:

>   dim s as sound
>   dim f as folderItem

>   f = getOpenFolderItem("audio/aiff")
>   if f <> nil then
>     s = f.openassound
>     if s <> nil then
>       s.play
>     else
>       msgbox "failed to open"
>     end if
>   end if

> shows various sound files in the OpenFile dialog box, but s always comes
> up nil. File types include aiff files. This is pretty much stragight from
> the examples. I can play the sounds from QT player. Some are even created
> by one of my RB programs.
> What gives?

What gives is that OpenAsSound is only for sound files (type "sfil"), so
naturally it doesn't work when you point it at other stuff. [See p. 510 of
my book.] If you want to play an aiff, open it as a movie; as you
correctly say, it's QuickTime that can play aiffs. m.

--

*** REALbasic, The Definitive Guide! ***
http://www.oreilly.com/catalog/realbasic/



Wed, 28 Jan 2004 23:39:51 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to play sounds?

2. Playing sound under Window

3. Playing sounds

4. crash on sound.play

5. playing sound file in Smalltalk

6. Playing Sound files under MacOS X

7. program that listens on port then plays sound

8. Can RB play external sound files

9. playing a sound in your rb app?

10. Playing Sound Files

11. play sound in ST

12. Playing Sound Files

 

 
Powered by phpBB® Forum Software