` Comment on an Icetips Article
Icetips - Templates, Tools & Utilities for Clarion Developers

Templates, Tools and Utilities
for Clarion Developers

Add a comment to an Icetips Article

Please add your comments to this article. Please note that you must provide both a name and a valid email address in order for us to publish your comment. Comments are moderated and are not visible until they have been approved. Spam is never approved!

Your Name:  
Email:  
Header text/Subject:  

Please enter your comment in the box below:

Back to article list   Search Articles     Add Comment     Printer friendly     Direct link  

Par2: Playing WAV files
1998-01-24 -- Russ Eggen
 
Here is a simple Clarion source file that will do this (thanks to Alexey for providing it): PROGRAM OMIT('--- 16 bit', _WIDTH32_) SndPlayProc EQUATE('SNDPLAYSOUND') ! --- 16 bit COMPILE('--- 32 bit', _WIDTH32_) SndPlayProc EQUATE('SNDPLAYSOUNDA') ! --- 32 bit MAP MODULE('WIN%S%.LIB') Snd:PlaySound(*CSTRING,UNSIGNED),BOOL,PROC,RAW,PASCAL,NAME(SndPlayProc) END END SoundFile CSTRING(256) CODE LOOP WHILE FILEDIALOG ('Choose Sound File', SoundFile, 'WAV Files|*.WAV', 0) Snd:PlaySound (SoundFile, 0) END Brad Silverman adds: PLAYING .WAV FILES IN C4B EMBED POINTS UNDER MODULE TAB - DEFAULT PROGRAM - EMBEDS AFTER GLOBAL INCLUDES Omit('*** 16 Bit',_Width32_) SndPlayProc equate('SndPlaySound') !*** 16 Bit Compile('*** 32 Bit',_Width32_) SndPlayProc equate('SndPlaySoundA') !*** 32 Bit GLOBAL - EMBEDS INSIDE THE GLOBAL MAP MODULE('Win%S%.lib') Snd:PlaySound(*cString,Unsigned),Bool,Proc,Raw,Pascal,Name(SndPlayProc) END GLOBAL - EMBEDS GLOBAL DATA SoundFile Cstring(256) ASSUME A PUSH BUTTON CONTROL EMBEDS-CONTROL EVENT HANDLING - ACCEPTED your code to set-- SoundFile = 'Path to wav file' (Variable string or constant as needed) Snd:PlaySound(SoundFile,0) I don't understand everything that going on but it works on my system (Win98)


Today is April 27, 2024, 6:49 am
This article has been viewed 35111 times.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: