Help,
can anybody post an example here for
playing (.WAV)-Files on an 9210 with OPL ?
(I think the MediaServer.OPX is needed).
Regards,
Luzie
Help,
can anybody post an example here for
playing (.WAV)-Files on an 9210 with OPL ?
(I think the MediaServer.OPX is needed).
Regards,
Luzie
See
http://www.allaboutsymbian.com/phpBB2/viewtopic.php?t=2852
Regards,
Roberto
Luzie,
I've used the code below to successfully play a wave file with OPL. Try it and let me know.
Regards
DECLARE EXTERNAL
INCLUDE "MediaServerOpx.oxh"
EXTERNAL tFilePlayerSimple
EXTERNAL tFilePlayerStop
Rem change this to where your wav file is
CONST KWAVFilename$="d\Documents\Tones\arrow.wav"
CONST KPriority&=KMdaPriorityNormal&
CONST KPreference&=KMediaSMdaPriorityPrefTimeQual&
PROC Main
GLOBAL gStatus&
tFilePlayerSimple
tFilePlayerStop
PRINT "Test code complete." PRINT "Press any key" GET
ENDP
PROC tFilePlayerSimple
EXTERNAL gStatus&
LOCAL priority&,preference&
IF NOT EXIST(KWAVFilename$)
ALERT(KWAVFilename$,"not found, test abandoned."😉
RETURN
ENDIF
priority&=0
preference&=KPreference&
CreateFilePlayerSimpleA(KWAVFilename$,gStatus&😉
IOWAITSTAT32 gStatus&
PRINT " PlayFileA",KWAVFilename$
PlayFileA(gStatus&😉
IOWAITSTAT32 gStatus&
CloseFilePlayer
PRINT
ENDP
PROC tFilePlayerStop
EXTERNAL gStatus&
CreateFilePlayerA(KWAVFilename$,KPriority&,KPreference&,gStatus&😉
IOWAITSTAT32 gStatus&
PlayFileA(gStatus&😉
StopFile
CloseFilePlayer
ENDP
Terminator wrote:Luzie,I've used the code below to successfully play a wave file with OPL. Try it and let me know.
Regards
DECLARE EXTERNAL
INCLUDE "MediaServerOpx.oxh"EXTERNAL tFilePlayerSimple
EXTERNAL tFilePlayerStopRem change this to where your wav file is
CONST KWAVFilename$="d\Documents\Tones\arrow.wav"CONST KPriority&=KMdaPriorityNormal&
CONST KPreference&=KMediaSMdaPriorityPrefTimeQual&PROC Main
GLOBAL gStatus&
tFilePlayerSimple
tFilePlayerStop
PRINT "Test code complete." PRINT "Press any key" GET
ENDPPROC tFilePlayerSimple
EXTERNAL gStatus&
LOCAL priority&,preference&
IF NOT EXIST(KWAVFilename$)
ALERT(KWAVFilename$,"not found, test abandoned."😉
RETURN
ENDIF
priority&=0
preference&=KPreference&
CreateFilePlayerSimpleA(KWAVFilename$,gStatus&😉
IOWAITSTAT32 gStatus&
PRINT " PlayFileA",KWAVFilename$
PlayFileA(gStatus&😉
IOWAITSTAT32 gStatus&
CloseFilePlayer
ENDPPROC tFilePlayerStop
EXTERNAL gStatus&
CreateFilePlayerA(KWAVFilename$,KPriority&,KPreference&,gStatus&😉
IOWAITSTAT32 gStatus&
PlayFileA(gStatus&😉
StopFile
CloseFilePlayer
ENDP
I have used this code, but my 9210i has many problems with it ! Does Anybody have a solution now for playing sounds ????
Terminator wrote:Luzie,I've used the code below to successfully play a wave file with OPL. Try it and let me know.
Regards
DECLARE EXTERNAL
INCLUDE "MediaServerOpx.oxh"EXTERNAL tFilePlayerSimple
EXTERNAL tFilePlayerStopRem change this to where your wav file is
CONST KWAVFilename$="d\Documents\Tones\arrow.wav"CONST KPriority&=KMdaPriorityNormal&
CONST KPreference&=KMediaSMdaPriorityPrefTimeQual&PROC Main
GLOBAL gStatus&
tFilePlayerSimple
tFilePlayerStop
PRINT "Test code complete." PRINT "Press any key" GET
ENDPPROC tFilePlayerSimple
EXTERNAL gStatus&
LOCAL priority&,preference&
IF NOT EXIST(KWAVFilename$)
ALERT(KWAVFilename$,"not found, test abandoned."😉
RETURN
ENDIF
priority&=0
preference&=KPreference&
CreateFilePlayerSimpleA(KWAVFilename$,gStatus&😉
IOWAITSTAT32 gStatus&
PRINT " PlayFileA",KWAVFilename$
PlayFileA(gStatus&😉
IOWAITSTAT32 gStatus&
CloseFilePlayer
ENDPPROC tFilePlayerStop
EXTERNAL gStatus&
CreateFilePlayerA(KWAVFilename$,KPriority&,KPreference&,gStatus&😉
IOWAITSTAT32 gStatus&
PlayFileA(gStatus&😉
StopFile
CloseFilePlayer
ENDP
😎 (A happy blind hacker!)
Good work, this worked for me (after I patched up for missing "colon" chars, and removed spurious "amp" and semi-colons, which the board must have mangled.
If I got lucky, I've attached the tidied code as a plain text file, which you can view with Notepad, and import into the 9210 emulator "Program" app with "File|More|Import text..." (choose "Show all files" from CBA!).
Multo Grazie!
Terminator wrote:Luzie,I've used the code below to successfully play a wave file with OPL. Try it and let me know.
Regards
DECLARE EXTERNAL
INCLUDE "MediaServerOpx.oxh"EXTERNAL tFilePlayerSimple
EXTERNAL tFilePlayerStopRem change this to where your wav file is
CONST KWAVFilename$="d\Documents\Tones\arrow.wav"CONST KPriority&=KMdaPriorityNormal&
CONST KPreference&=KMediaSMdaPriorityPrefTimeQual&PROC Main
GLOBAL gStatus&
tFilePlayerSimple
tFilePlayerStop
PRINT "Test code complete." PRINT "Press any key" GET
ENDPPROC tFilePlayerSimple
EXTERNAL gStatus&
LOCAL priority&,preference&
IF NOT EXIST(KWAVFilename$)
ALERT(KWAVFilename$,"not found, test abandoned."😉
RETURN
ENDIF
priority&=0
preference&=KPreference&
CreateFilePlayerSimpleA(KWAVFilename$,gStatus&😉
IOWAITSTAT32 gStatus&
PRINT " PlayFileA",KWAVFilename$
PlayFileA(gStatus&😉
IOWAITSTAT32 gStatus&
CloseFilePlayer
ENDPPROC tFilePlayerStop
EXTERNAL gStatus&
CreateFilePlayerA(KWAVFilename$,KPriority&,KPreference&,gStatus&😉
IOWAITSTAT32 gStatus&
PlayFileA(gStatus&😉
StopFile
CloseFilePlayer
ENDP
I get error: "Record too large" when I hit the Translate button..?????
This means that there are non default line breaks in the code you copied and pasted into the OPL editor.
If you configure the editor to display line breaks you can see where the correct line breaks are missing. Line breaks are displayed as a horizontally mirrored P. Just remove the incorrect line breaks with backspace and hit enter to replace it with a real linebreak.
Maybe the text was saved as Unix (LF) instead of DOS (CR/LF) text, so there is not CR to tell the OPL editor that the lines end.
I have just saved the attached file (as DOS text), then used "File/More/Import text... Shift+Ctrl+I" within the OPL Editor.
Ok. I pressed enter after every line.
Now it says after Translate: "Not found" (in finnish:"Ei l�ydy"😉 And goes to line: INCLUDE "MediaServerOpx.oxh"
Do I need to install that from somewhere?
Try the attached plain text file.
Regards
I'm just starting with OPL and am using this code - I sorted out the formatting errors, it translates fine and runs quite happily, but finishes in a couple of seconds without playing anything ! It finds that file OK, but nothing - any clues ?
Sorry, have found the problem, my input error. Learning all the time...
No work!
Record too large!
I downloaded that file to my PC. Opened it. Copyed the text to a mail. Sent it to my 9210i. Openend it there. Copied text. Opened TextEd and Pasted text. Translated and Record to large.
..And then I hit enter after every code line. Didn't help.
I put an empty line between every line and now after I press Translate it says: Not found! and the cursor goes to that line: INCLUDE "MediaServerOpx.oxh"
And why my BEEP 5,300 and BEEP 100,300 makes the same sound for about 8 seconds? And the sound is quite awfull... after about 3 seconds the sound gets a little bit louder.
Now I put BEEP -1,500 and it won't shut up at all...
raksutiikeri wrote:No work!
Record too large!I downloaded that file to my PC. Opened it. Copyed the text to a mail. Sent it to my 9210i. Openend it there. Copied text. Opened TextEd and Pasted text. Translated and Record to large.
Anyway, I have a further question; which formats are supported by OPL? Just WAV?
Does anyone have a solution for this: When I try to translate the code, the application warns: "Not found." Where can I get MediaServerOPX.oxh?
Identity wrote:Does anyone have a solution for this: When I try to translate the code, the application warns: "Not found." Where can I get MediaServerOPX.oxh?
I'm not sure, but I think you'll also need corresponding OPX file, but I can only find Mediaserveropx.opx inside WINSCW folders, so probably they are emulator versions....
Let us know if you'll success in playing WAV files! Which platform are you coding for?
Interesting link found!
http://www.getjar.com/repository/img_extra/1340/
(All OPX for UIQ).
I�m coding for Crystal a.k.a Series 80 (more precisely Nokia 9210). I can�t get the code work because of the MediaServerOPX.oxh, because I don�t have one. I have only MediaServerOPX.opx in the folder D:\System\OPX\ on the phone.
Identity wrote:I�m coding for Crystal a.k.a Series 80 (more precisely Nokia 9210). I can�t get the code work because of the MediaServerOPX.oxh, because I don�t have one. I have only MediaServerOPX.opx in the folder D:\System\OPX\ on the phone.
😮 😮 😮
Cassioli, I could kiss you! Well, not exactly, but thank you very much! 😊
This is a correct code (for Series 80) to play a wav file:
DECLARE EXTERNAL
INCLUDE "MediaServerOpx.oxh"EXTERNAL tFilePlayerSimple:
EXTERNAL tFilePlayerStop:
REM change this to where your wav file is
CONST fileName$="d:\?\?.wav"
CONST KPriority&=KMdaPriorityNormal&
CONST KPreference&=KMediaSMdaPriorityPrefTimeQual&
PROC main:
GLOBAL soundStatus&
tFilePlayerSimple:
tFilePlayerStop:
PRINT "Test code complete."
PRINT "Press any key."
GET
ENDP
PROC tFilePlayerSimple:
EXTERNAL soundStatus&
LOCAL priority&,preference&
IF NOT EXIST(fileName$)
ALERT(fileName$,"not found, test abandoned."😉
RETURN
ENDIF
priority&=0
preference&=KPreference&
CreateFilePlayerSimpleA😞fileName$,soundStatus&😉
IOWAITSTAT32 soundStatus&
PRINT "PlayFileA",fileName$
PlayFileA😞soundStatus&😉
IOWAITSTAT32 soundStatus&
CloseFilePlayer:
ENDP
PROC tFilePlayerStop:
EXTERNAL soundStatus&
CreateFilePlayerA😞fileName$,KPriority&,KPreference&,soundStatus&😉
IOWAITSTAT32 soundStatus&
PlayFileA😞soundStatus&😉
StopFile:
CloseFilePlayer:
ENDP
Tell me if there�s bug/bugs in the code.
Identity wrote:This is a correct code (for Series 80) to play a wav file:
PlayFileA😞soundStatus$)
IOWAITSTAT32 soundStatus$
And don't forget to use (code)(/code) tags when you post your source, else if it contains "strange characters" like these:
(drive c😊
(drive c😊
😉
P.S.
There is also a missing " in the line containing the name of WAV file.
Does anybody know if it also possible to RECORD sounds using OPL?
A couple of typos, sorry 🙄
Cassioli, I think we need an .opx for that. But I�m just 16-year-old and started programming OPL 1� months ago, so don�t look at me 😃
Identity wrote:A couple of typos, sorry 🙄Cassioli, I think we need an .opx for that. But I�m just 16-year-old and started programming OPL 1� months ago, so don�t look at me 😃
16 years? Ok, you're on holydays since 2 months , haven't you yet learnt how to program Symbian phones in C++? 🙄 😉 I really need some new OPXs... :frown:
[edit: deleted a stupid question...]
cassioli wrote:16 years? Ok, you're on holydays since 2 months , haven't you yet learnt how to program Symbian phones in C++? 🙄 😉 I really need some new OPXs... :frown:[edit: deleted a stupid question...]
I�m starting from this very easy language, OPL and when I know enough about variables, strings, blaah, blaah, blaah -things, I move into the deep, crazy, hell-hard world of C++. So it�s coming up, don�t know yet when 😊
OT: School starts tomorrow!!! Noooooooo!!!