| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| The message below is being cross-posted from LogoForum. HI LOGO FANS!!!!!!! I hope all of you had got your dreamed gifts last Christmas. But, the best gift was, is and always will be... GOD!!! GOD is the only one source of love, peace and happiness. Please, don't forget it. I know MSWLogo isn't a "fast" computing language sometimes, but there must be some tricks to speed up it. Here is a summary of the procedures to audio file management with MSWLogo: to 16bpsmono setturtle 0 pd setx xcor+1 sety 0+(read_signed_littleendian_word/250) setreadpos :bn+2 end to 16bpsstereo setturtle 0 pd setx xcor+1 sety 90+(read_signed_littleendian_word/500) setturtle 1 pd setx xcor+1 sety -90+ (read_signed_littleendian_word/500) setreadpos :bn+2 end to 8bpsmono setturtle 0 pd setx xcor+1 sety -130+read_byte setreadpos :bn+1 end to 8bpsstereo setturtle 0 pd setx xcor+1 sety 0+(read_byte*0.7) setturtle 1 pd setx xcor+1 sety -180+(read_byte*0.7) setreadpos :bn+2 end to aaa cs ct home window setsc [0 0 0] setturtle 0 ht setturtle 1 ht scrollx 0 scrolly 0 closeall make "file dialogfileopen "c:\\mis\ documentos\\*.* boundaries diagram :file end to boundaries setturtle 0 ht pu setpc [255 0 0] pu setx -380 sety -180 pd setx -380 sety 180 setx 380 sety 180 setx 380 sety -180 setx -380 sety -180 setx -380 sety 0 setx 380 sety 0 pu setpc [0 0 255] pu setx -380 sety 90 pd setx 380 sety 90 pu setx -380 sety -90 pd setx 380 sety -90 pu home setpc [0 255 0] end to close_r :file close :file setread [] end to diagram :file open_r :file make "filelead [] readwavheading setturtle 0 ht pu setx -380 sety 0 setturtle 1 ht pu setx -380 sety 0 diagram_loop close_r :file boundaries end to diagram_loop make "bn readpos if eofp [stop] if :channels=1 [monodiagram] if :channels=2 [stereodiagram] diagram_loop end to monodiagram if :bps=16 [16bpsmono] if :bps=8 [8bpsmono] end to open_r :file (openread :file "true) setread :file end to read_byte output readchar end to read_signed_littleendian_word make "lsb readchar make "msb readchar make "word bitor :lsb (ashift :msb 8) if :display=1 [if :word>32767 [make "word :word-65536]] output :word end to readwavheading make "bn 0 make "display 0 repeat 44 [make "a read_byte if :bn=21 [make "bfn readpos make "channels read_signed_littleendian_word setreadpos :bfn] if :bn=23 [make "bfn readpos make "samples read_signed_littleendian_word setreadpos :bfn] if :bn=33 [make "bfn readpos make "bps read_signed_littleendian_word setreadpos :bfn] make "bn :bn+1] pr (list "Channels "= :channels) pr (list "Samples "= :samples) pr (list "Bits "per "sample "= :bps) make "display 1 end to stereodiagram if :bps=16 [16bpsstereo] if :bps=8 [8bpsstereo] end Of course, you must to type "aaa". Please, don't forget it's an unfinished work. I don't have got the value to know how much bytes (large) the file has. I know this value is in the file heading but... I don't find it!!! I tried to speed up it with an old trick: to skip some bytes from the files, but the result... isn't an ideal work!!! I tried to put all the read bytes into a list (to read the values from the list not the file) but... I didn't get more speed with it and the list just got an "out of memory" with a large audio file. Then... I don't know how to speed up it!!! (in a good logic way). As you see: I NEED HELP!!!!!!! GOD BLESS YOU ALL!!!!!!! Juan J. Paredes G. > From Curicó, Chile, with love LogoForum messages are archived at: http://groups.yahoo.com/group/LogoForum |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.