home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / utility / misc / reqchang.run / ReqChange / Upd / Upd.Doc < prev    next >
Encoding:
Text File  |  1992-06-23  |  12.1 KB  |  343 lines

  1. Release 1.20
  2.  
  3.         The minimal player daemon - upd
  4.         ===============================
  5.  
  6.     ⌐ 1991 Jonas Petersson & Absolut Software (aka Sirius Soft)
  7.  
  8.  
  9.  
  10. Introduction:
  11. =============
  12.  
  13. Wouldn't it be nice to have a process hanging around to play any
  14. sound file for you on demand instead of you having to do all this
  15. mucking about with audio.device etc? But it really has to be small
  16. and it HAS to be able to play my very large samples anytime...
  17. I must be able to call it simply from anywhere - even from scripts!
  18.  
  19. Tricky, but it can be done.
  20.  
  21. As a feature you can register you favourite sounds in a configuration
  22. file and well behaved programs will use the ones you like right now.
  23. It also has Arexx support - to be truely honest, that the ONLY way to
  24. use it... As of 1.01, there is also a fade option.
  25.  
  26. Actually, "minimal" is not quite true anymore as speech is available
  27. starting 1.20...
  28.  
  29. Current version works rather well along the way I intended.
  30.  
  31.  
  32. Usage:
  33. ======
  34. **** Note: rehacked interface
  35.  
  36.     [run] upd [-bBUFSIZE] [-fIDFILE] [-pPRIORITY]
  37.  
  38. The "run" is of course optional, but daemons really should be in the
  39. background unless you want the see the debugging information.  "bufsize"
  40. is the amount of chip memory that each of the four buffers will use
  41. while playing.  (These are allocated at start to make sure you will be
  42. able to play anytime - as long as you can get hold of the audio
  43. channels...).  Default is 1024 and specifying less than 64 will give you
  44. the default. (I've heard that some people can't ever get anything good
  45. out with less than a 1K buffer - am I really the only one with a quick
  46. enough HD/SCSI interface?) 
  47.  
  48. NOTE: Don't make the buffer bigger than you actually need - a large
  49. buffer also means that the sample will start a little bit later since
  50. more information must be loaded before it can begin!
  51.  
  52. If the IDfile parameter exists, it will be used instead of the
  53. default s:upd.IDs. 
  54.  
  55. As of 1.20 I've also added the priority option to satisfy some requests
  56. from people who prefer their sound to be perfect before getting things
  57. done... You people may specify -p35 or something like that along with
  58. some huge buffer. Of course, you can also lower priority with this option.
  59.  
  60. The above won't produce any sound as you probably realize.  Once run, the
  61. only way to talk to upd is with Arexx - I even removed the BREAK stuff
  62. that was in it for Zound, since Arexx could hang around waiting for a
  63. reply forever when you interupted the sound that way. The break will
  64. "wait" until the daemon is idle next time.
  65.  
  66. upd currently knows of these commands:
  67.  
  68.     file filepath [options] [anotherfilepath [options]]
  69.     id   id-in-s:upd.IDs
  70.         rescan new-id-file
  71.     fade #-of-steps-per-bufsize
  72.     say string-to-translate-and-say
  73.     phoneme phoneme-string-to-say
  74.     exit
  75.  
  76. The 'fade' command is new to 1.01 and might need some explanation:
  77. What is does is merely reconfigure upd for future requests. By default
  78. fade is set to 0 which means, that any playing sound will be cut off
  79. as soon as a new AREXX command arrives. Any other number indicates that
  80. when a new reqest arrives, first fade out the current sound by lowering
  81. the volume by the specified amount by each played buffer until volume reaches
  82. zero. As the observant reader realizes, a value exceding 64 will do 
  83. the same thing as 0 and a negative value may give nondesired effects...
  84.  
  85. 'say' and 'phoneme' are new as of 1.20 and their use should be obvious.
  86. These are really just a spin-off from what was added to the ID file and
  87. currently the options for MALE/FEMALE etc are not available. They shouldn't
  88. really be needed unless you plan to really misuse this deamon... Let
  89. me know if you insist on that...
  90.  
  91. Well, there is actually one more command: 'Can it, Marvin'. This will 
  92. silently interrupt the current sample. (To be truely honest, ANY command
  93. will interrupt a sample - if it's known, it will be used, otherwise the
  94. sound just stops). Be careful with the 'rescan' command, if there is a 
  95. problem reading the new file, you will loose all your old IDs...
  96.  
  97. The options are the same as for Zound except for the -n option that doesn't
  98. exist here (tell me you need it and I'll fix that too... sigh). Here's the
  99. list:
  100.  
  101.     -r rate    How fast to play the sample. Default is what is in the
  102.         8svx header or 310 if it's a raw file. This is usually
  103.         reasonable - most 'raw' samples I've come across are either
  104.         310 or 155. Lower numbers will play the sample faster.
  105.  
  106.     -v volume    Ranges between 0 and 64, 64 being max and default.
  107.  
  108.     -s start    Possible offset from the beginning. Default 0.
  109.     -l length    Possible length unless you want it all. Default is
  110.         length of the sample. Be careful with these two, or
  111.         you might get undesired results.
  112.  
  113.     -c cycles    How many times to play each buffer. Default 1. Not
  114.         very useful, but you can get a nice "mouse" effect by
  115.         setting this to 2 and playing twice as fast...
  116.  
  117.     -d        Show debug information. Note that this will appear on
  118.         the standard output of the DEAMON, not where you called 
  119.         it from (that is, the ARexx script or wherever).
  120.  
  121.     -L        Play the sample in the left speaker only. If it's a stereo
  122.         sample only the left channel samples are used.
  123.     -R        Same as '-L' but for right speaker.
  124.     -S        Play in both speakers even if it's a mono sample.
  125.         Default for these three options are of course what is in the
  126.         8SVX header or -L if it's a raw sample.
  127.  
  128.  
  129. Example of usage (from WShell etc):
  130.  
  131.     "address play file 'sounds:chopper'
  132.     "address play fade 2
  133.     "address play id 2001
  134.         "address play rescan 'ram:upd.IDs'
  135.     "address play exit
  136.  
  137. If you are using the vanilla 2.0 AREXX you might have to create a file
  138. like this:
  139.  
  140.     /* A test script in AREXX */
  141.  
  142.     address PLAY say "Hi there!"
  143.  
  144. Then execute it with 'rx filename.rexx'
  145.  
  146. NOTE: Arexx normally converts everything to UPPERCASE and might try to
  147. do arithmetics etc on filenames which is why it's generally a good idea
  148. to 'singelquote' all paths, IDs etc. If you're looking for the port
  149. 'the hard way' to send your own message, the name is "PLAY" in uppercase.
  150.  
  151. NOTE2: If you are REALLY in a hurry to get rid of upd you could do this:
  152.  1) Send a any dummy Arexx message (this will stop the sound)
  153.  2) Send a break C to upd - break still works when upd is idle.
  154. or
  155.  A) Send the exit message.
  156.  
  157. The last might sound much easier than the first unless you (like me)
  158. have a trapped DisplayBeep() that 'pings' via upd.  In this case,
  159. producing a DisplayBeep() and a break C is much simpler.  The order is
  160. not relevant since the break is "queued". 
  161.  
  162.  
  163. Hints:
  164. ======
  165.  
  166. Running upd from your SOUNDS: directory is a nice way to get rid of having
  167. you type the FULL path everytime you want to play a sample. (The daemon
  168. has no simple way of knowing WHERE you were when you sent the message 
  169. (that I know of) and therefore assumes it to be in the current directory)
  170.  
  171.  
  172. Files:
  173. ======
  174.  
  175.     s:upd.IDs
  176.  
  177. This file contains the IDs of your favourite samples like a database
  178. the is easily editable. File format:
  179.  
  180.  
  181. # Lines starting with '#' are comments
  182. # Id list for micro player daemon
  183. # Created 910201 Jonas Petersson (zaphod@magrathea.indic.se)
  184. # These sounds could be called for at certains situation
  185. # On severe error
  186. BUG    sounds:explosion -S
  187. # When asked for confirmation
  188. CONFIRM sounds:PressLeftMouseButton -L
  189. # Minor trouble
  190. ERROR   sounds:ImSorryDaveImAfraidICantDoThat -R
  191. # Going down...
  192. GURU    sounds:RoysDeathMonologueFromBladerunner -S
  193. # Personal shortcuts/favourites
  194. 2001    sounds:openpod -L sounds:hal -R
  195. # These should always work:
  196. ET      -SAY -r -f -p100 -F20000 -s110 E T phone home.
  197. RAW     -PHONEME /HAY4 DHEH1R.
  198.  
  199.  
  200. -SAY and -PHONEME are special "files" as of 1.20. These instead trigger
  201. the use of translator/narrator since some people don't have a lot of
  202. samples around. Remember that everything is defferent here - options
  203. come BEFORE the string and have other meanings than for samples. I've
  204. tried to keep the the same as the command 'say' uses:
  205.  
  206.     -m/-f    Male/Female
  207.     -n/-r    Natural/Robot
  208.     -p###    Pitch
  209.     -v###    Volume
  210.     -s###    Speed (rate really)
  211.     -F###    Sample frequency
  212.  
  213.     (Defaults are the same as for say)
  214.  
  215. Removing entries will ofcourse result in no sound (upd might mourn about
  216. it on the standard output though, unless you redirect it). Remember that
  217. ARexx might convert to uppercase unless you quote!
  218.  
  219. Feel free to add whatever you like. Could be nice with some standard though.
  220. If you make a program that uses several ID's it would be a good idea to have
  221. the same prefix for instance. 
  222.  
  223. Suggestions are welcome. Mjl's Arq is an example of a program that uses
  224. this feature. Read Arq's docs for details.
  225.  
  226. NOTE: It *IS* possible to have white space, lowercase etc in the IDs, but
  227. it might cause confusion if used. Be warned.
  228.  
  229. NOTE2: The file is scanned once when the program starts. If you make any
  230. changes to it, you'll have to restart the deamon.
  231.  
  232.  
  233. Return codes:
  234. =============
  235.  
  236. If the Arexx command returns 20, the secondary result code gives the
  237. reason for the failure:
  238.  
  239. 10    Can't allocate channels.
  240. 17    Can't open s:upd.IDs on request to play by ID.
  241. 18    Requested ID not found.
  242. 19    Trouble reading new ID file.
  243. 20    Error during parse of options.
  244. 21    Can't open file with sample.
  245. 22    File is IFF, but not FORM 8SVX.
  246. 23    Bad IFF file.
  247. 24    Bad CHAN length.
  248. 25    Bad VHDR length.
  249. 26    Can't open file 2nd time. (For stereo possibility)
  250. 30    Can't play backwards. (Wierd options)
  251. 31    Can't allocate IOAudio structs.
  252. 32    Can't open ports for channels.
  253. 47    Can't open the translator library.
  254. 48    Translator won't use that string.
  255. 50    Bad options to -SAY/-PHONEME in ID line.
  256. 51    Can't open the narrator device.
  257. 52    Couldn't Allocate talk Signal bit.
  258. 53    Narrator won't do that. Usually bad pitch etc.
  259.  
  260.  
  261.  
  262. Being interrupted to play another sample is not considered a failure.
  263.  
  264.  
  265. Future enhancements:
  266. ====================
  267.  
  268. Maybe automatic detach (didn't work well in Aztec 5.0a, and I havn't really
  269. tried with 5.0d yet).
  270.  
  271. Probably not very much else - this is a simple sound daemon for minor
  272. background purposes of helping simple programs do more than DisplayBeep().
  273. I'd like to think of it as a complement to SPEAK: - if you want more
  274. you probably want it interactive. (Hmm, that's a thought - a SOUND: device)
  275.  
  276.  
  277.  
  278. Problem history: 
  279. ================
  280.  
  281. 1. If your sample is on a floppy (or a very slow HD) there might be 
  282.    some sounds of silence when the playing rate exceeds the loading
  283.    rate... 
  284. Fix: You can now specify the amount of memory to be used by upd when you
  285.    start the daemon as in: 'upd 2000'. But note that a larger buffer also
  286.    makes a longer delay until you hear the first part of the sound - it
  287.    doesn't start until it has filled the first buffer.
  288.  
  289. 2. Stereo and Fibonachi packed samples not yet supported (there are loading
  290.    problems - play them with 'Zound' instead for now).
  291. Fix: Stereo is OK now if you use the above size option (it actually worked
  292.    in RAM: before too - but I didn't enable it for the prerelease). As for 
  293.    Fibonachi: it's not too hard to fix, but I've never seen anyone using it -
  294.    is it worth the effort? If you happen to have a Fib-sample - PLEASE send it
  295.    to me - I don't have the patience to reconstruct one by hand...
  296.  
  297. 3. Could hang forever if someone stole the channel. 
  298. Fix: So, I didn't check everything in 0.99 - now I do (I hope... ;-)
  299.  
  300. 4. -s and -l wasn't used in 0.99, now it is.
  301.  
  302. 5. On request from the UK CDTV developers, FADE was added as of 1.01
  303.  
  304. 6. Added speech and better command line parsing as of 1.20.
  305.  
  306. Thanks to mjl@alison.at for the idea.
  307.  
  308.  
  309. Distribution
  310. ============
  311.  
  312.   UPD is not public domain. A friend of mine advised me to call it
  313. "Freely Distributable Copyrighted" instead. That's close enough.  
  314. If You wish to include it with a commercial program feel free provided 
  315. that You send me a registered copy. And don't forget to mention me
  316. in the manual.
  317.  
  318.   As always, Fred Fish is free to include it in his library.
  319.  
  320.   Source code? You mean there is something to IMPROVE??? Right, send
  321. me a message then and I'll think about it...
  322.  
  323.  
  324.  
  325.  
  326.  
  327.     Jonas 'Zaphod' Petersson
  328.     Albrektsvagen 113A
  329.     S-603 53  Norrkoping
  330.     SWEDEN
  331.     Phone: +46 11 162517
  332.  
  333.     zaphod@magrathea.indic.se                   /* At home */
  334.     zap@indic.se                    /* At work  - Quickest */
  335.  
  336.  
  337. Feel free to send comments, bug reports (huh?), money, coke, beer, girls...
  338.  
  339. Just a "Hi, I liked your program" is as good as a few bucks - I wrote this
  340. because I needed it, not to make money out of it...
  341.  
  342.  
  343.