![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Questions & Help Needed Post any question regarding Basic4ppc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
hi all...first of all Basic4ppc rocks! hehehe
i tired searching for free alaram software for my O2 mini (WM2003SE) so i decided to build my own alarm. hehehehe! (still learning). i know how to play sound using Sound("music.wav"). can anyone guide me how to repeatedly play the sound untill i click a button to stop it. p/s: i'm newbie...please be gentle. thanx! |
|
|||
|
Hi there, and welcome to the B4ppc community! To repeated play a sound, use the FMOD library. Follow these steps:
From the Basic4ppc IDE, go to Tools - Conponents, and press the Add DLL button, the one where it adds dlls to both list boxes. Next, select fmodDesktop.dll (to build this app on the desktop) or FMODDevice.dll (to build it on the device) from the Open File Dialog box. Next, press OK. Go back into Tools - Add Object, choose FMOD then give it a name so you can call it in your program. Click the Close button then where you want the sound to play repeatedly, just write the name you typed inside the object name field followed by a period, click PlayLoop and in parenthesis type (AppPath & "\Filename.wav") When you click the stop button, on the sub that is activated on the click event, inside the sub type objectname followed by a period, and click on Stop1. Here's an example program: Sub Globals 'Declare variables here. End Sub Sub App_Start 'MySound is a FMOD object added in Tools - Add Object after referencing FMODDesktop.DLL for the desktop. If I want device, I'd reference FMODDevice.dll from the Tools - Components dialog box. MySound.New1 'Initialize FMOD to get ready to play a sound. addform("Test", "Repeating Sound") addbutton(test, "Stop", 40, 40, 5, 5, "Stop") 'You will have to change the left, top, width, and height properties listed as numbers in between the commas, or use the Forms' Designer. test.show MySound.PlayLoop(AppPath & "\Alarm.wav") 'Use apppath to get the relevant path of the application. End Sub Sub Stop_click MySound.Stop1 End Sub Hope that helps. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| help on playing sound | sanoy | Questions & Help Needed | 4 | 11-08-2008 01:03 AM |
| playing a video clip | colin9876 | Questions & Help Needed | 5 | 05-20-2008 09:18 AM |
| Playing midi notes | Cor | Questions & Help Needed | 1 | 02-04-2008 11:47 AM |
| How to play multiple sounds at once? | justdo | Questions & Help Needed | 2 | 09-24-2007 04:59 AM |
| How to play 2 sound files at the same time? | conf | Questions & Help Needed | 2 | 08-27-2007 07:21 AM |