Thanks Fargo, that is an alternative but doesn't explain why we end
up with compile errors when we add the sound to the project via the
dragging method but I will show the class your code tomorrow as a
backup method for those having the trouble.
Martin
On 14/09/2006, at 1:02 PM, Fargo Holiday wrote:
Hi,
I'm amongst the newbiest here, but wouldn't it be better to
actually bring the file in programatically?
Like so:
dim sf As FolderItem
dim sobj As Sound
sf = GetFolderItem("test.wav")
if sf <> Nil Then
if sf.Exists Then
sobj = sf.OpenAsSound
sobj.Play
end if
end if
Other than that, you should be able to drag the file to your
Project panel, and it should create the sound object for you. So,
test.wav becomes the sound object "test" and you can use
test.play . I don't know if that's 100% reliable, and it certainly
seems the less flexible route, but it should work. I can't test in
RB2005, but RB2006 handles it just fine.
Thanks,
Fargo
Martin Fitzgibbons wrote:
I am teaching a class using RealBASIC 2005 Release 4 (although the
same problem appears in 2006).
We are having trouble adding sounds to the game projects they are
working on.
This used to be a simple case of drag the sound to the project and
use sound.play
We have tried .wav, .mp3 etc
Any suggestions as to what is going wrong?
Martin Fitzgibbons
Kiama High
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
--No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.12.3/446 - Release Date:
9/12/2006
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|