QB64 Phoenix Edition v3.5.0 Released!
#1
QB64 Phoenix Edition v3.5.0!

https://github.com/QB64-Phoenix-Edition/...tag/v3.5.0

Enhancements
  • #46, #98, #250, #265, #272 - Added support for opening HTTP and HTTPS requests using _OPENCLIENT(). - @mkilgore
    • Feature is current unstable and requires $Unstable:Http to use.
    • On Linux and Mac OS this functionality requires libcurl to be installed.
    • HTTP(s) connections are opened using _OPENCLIENT() and generally work the same as the existing TCP/IP streams.
    • See the Wiki page on Downloading Files to see a complete overview of this functionality.
  • #28, #279 - Added _SNDNEW(frames&, channels&, bits&) function which can be used to make new sound buffers of a predetermined number of frames. - @a740g
    • The created sound buffer can be accessed using _MEMSOUND() to write sound data to it, and then played like any other sound.
  • #232, #279 - Sounds can now be opened from memory using _SNDOPEN(sound$, "memory"). - @a740g
    • The string provided to _SNDOPEN() in this case is not a filename, but instead contains the actual sound data that should be loaded into the new sound buffer.
  • #280, #279 - Added support for playing Amiga AHX and HVL audio files. - @a740g
    • They are played using _SNDOPEN() like any other audio file.
  • #261 - The IDE's new open file dialog will now remember the previous directory it was open to. - @SteveMcNeill
  • #264 - The error line color in the IDE is now configurable. - @SteveMcNeill

Bug Fixes
  • #252, #276 - Wiki will now be downloaded using the new HTTP support, curl is no longer needed. - @RhoSigma-QB64
  • #254 - _FONT settings that are invalid now produce an error rather than segfaulting. - @SteveMcNeill
  • #256, #258, #266, #267 - Fixed the command line compilation output when using some commands like $NoPrefix. - @mkilgore
  • #256, #257 - When compiling from the command line, the exe is now always located relative to the provided source file path. - @mkilgore
  • #234, #260 - Programs now wait for GLUT to be properly initialized before starting. - @mkilgore
  • #66, #270 - GLUT commands are now always executed on the correct thread. This fixes issues where some programs would randomly crash. - @mkilgore
  • #262, #233 - $IF checks involving VERSION now correctly compare all segments of the version individually. - @SteveMcNeill
    • Previously VERSION was compared as a string, which would have caused incorrect comparisons when the version numbers get larger.
  • #275 - Reduced the number of times nm is invoked to resolve Declare Library functions. - @flukiluke
  • #166, #279 - _SNDRAW is now fully implemented for the miniaudio audio backend - @a740g
    • The OpenAL audio backend is likely to be removed in the next version of QB64-PE.
  • #166, #279 - PLAY(n) now returns the number of sound samples left to play from PLAY, SOUND, or BEEP. - @a740g
  • #167, #279 - The timing of SOUND and PLAY calls were improved so that they wait for the sound to finish playing. - @a740g
  • #186, #279 - SOUND and PLAY now generate mono sound, reducing memory usage. - @a740g
  • #217, #279 - The N command for PLAY now plays the note in the correct octave. - @a740g, @mkilgore
  • #282, #284 - The long start-up time for QB64-PE programs has been fixed, there should no longer be a delay before the QB64-PE code starts running - @mkilgore
  • #281, #284 - A use-after-free bug was fixed in some of the buffer logic for the HTTP code - @mkilgore

Full Changelog: v3.4.1...v3.5.0
Reply
#2
Thank you as always Phoenix Team! Happy New Year!  Heart

Um, the above was going to be the only thing, but now I'm baffled by the new syntax of _SNDOPEN(). When getting a string to be interpreted as sound (second parameter), what happens to the first "sound$" parameter? Does it have to be set to something other than the empty string or an actual filename?

Also I hope you guys checked the "sanity" of the second parameter because there are a few QB64 programs floating around with that "VOL,SYNC" and whatnot... a few programs ended with "Illegal function call" without those "capabilities" in the SDL version.
Reply
#3
(01-09-2023, 03:59 PM)mnrvovrfc Wrote: Um, the above was going to be the only thing, but now I'm baffled by the new syntax of _SNDOPEN(). When getting a string to be interpreted as sound (second parameter), what happens to the first "sound$" parameter? Does it have to be set to something other than the empty string or an actual filename?

For that syntax, the second parameter is literally "memory", similar to the other settings that are allowed to be specified such as "stream". It's an optional parameter though and I don't typically see it used, so you might not be familiar with it.

When using the "memory" setting, you specify the sound data in a string in the first parameter where you would normally specify a filename.
Reply
#4
@mnrvovrfc See the example here QB64pe/sndopen_mem_test.bas at main · QB64-Phoenix-Edition/QB64pe (github.com)

@DSMan195276 I'll update the wiki soon.
Reply
#5
That example makes things more clear that the string buffer has to be treated like an actual sound file that is loaded. Eg. a raw wave file buffer could be created rather easily, but make sure to make room at the front for the wave file header, and to create the header correctly. This is actually pretty cool to be able to handle a wide variety of sound file formats.

However, that example looks a bit complicated, uses _INFLATE$ but isn't the content of an MP3 file already compressed?
Reply
#6
(01-09-2023, 05:37 PM)mnrvovrfc Wrote: That example makes things more clear that the string buffer has to be treated like an actual sound file that is loaded. Eg. a raw wave file buffer could be created rather easily, but make sure to make room at the front for the wave file header, and to create the header correctly. This is actually pretty cool to be able to handle a wide variety of sound file formats.

However, that example looks a bit complicated, uses _INFLATE$ but isn't the content of an MP3 file already compressed?


Yes. It is a bit complicated. But it's just a test I put together. The reason that has _INFLATE$ is because I used a hacked routine from MakeDATA by @RhoSigma. That _INFLATE$ could come in handy if we used a format like MOD/S3M/XM/IT etc. that do not support compression though.


See.
QB64-Museum/MakeDATA.bas at main · a740g/QB64-Museum (github.com)
Reply
#7
Code: (Select All)
OPTION _EXPLICIT

DIM buffer AS STRING: buffer = LoadSlidingAwayData
PRINT "Size ="; LEN(buffer)

DIM h AS LONG: h = _SNDOPEN(buffer, "memory")
PRINT "Handle ="; h
PRINT "Length ="; _SNDLEN(h)

_SNDLOOP h

END

' This function reads the file directly from data and then returns the decompressed data
FUNCTION LoadSlidingAwayData$
    DIM numL&, numB&, rawdata$, stroffs&, i&, dat&

    RESTORE Sliding_Away
    READ numL&, numB&
    rawdata$ = SPACE$((numL& * 4) + numB&)
    stroffs& = 1

    FOR i& = 1 TO numL&
        READ dat&
        MID$(rawdata$, stroffs&, 4) = MKL$(dat&)
        stroffs& = stroffs& + 4
    NEXT i&

    IF numB& > 0 THEN
        FOR i& = 1 TO numB&
            READ dat&
            MID$(rawdata$, stroffs&, 1) = CHR$(dat&)
            stroffs& = stroffs& + 1
        NEXT i&
    END IF

    LoadSlidingAwayData = _INFLATE$(rawdata$)

    '--- DATAs representing the contents of file sliding_away.hvl
    '---------------------------------------------------------------------
    Sliding_Away:
    DATA 192,10
    DATA &H56A59C78,&H51134F5B,&H7766FE10,&HE96D0B6B,&HC5258202,&H5BAED8BA,&H840A956B,&HFBB240F8
    DATA &H3E2483E0,&H4B3E24A0,&H018928C4,&H6217892F,&H9F813FA2,&H47E14FC0,&H3D1356F1,&HED9D9EB7
    DATA &H9A78DA05,&HFB3399CE,&HCCE677CD,&HB3CE6ECC,&H7451CF57,&HDF05877E,&H02F0F2DF,&H0F297204
    DATA &HA39E8435,&HF47BD182,&H9ED67297,&H95727A62,&HC2AD1C62,&HF6E174BD,&HFC52E2CC,&HCDF31E7B
    DATA &H8C1BFE31,&H0530CF3F,&HFC639FC6,&H767F8C33,&H3E117F0C,&H12FE196E,&HFC3551E6,&HC5602C65
    DATA &H88B0E660,&H622FE19A,&HBF86AB19,&H6DB89B82,&H42588BF8,&HFF9CEADD,&HFE69F88E,&HFE8E0AA2
    DATA &HB4151E28,&HB77813DB,&HC0F00F98,&HB1D0D7E2,&H6878BBF8,&HB23C0DF1,&H2DD626F8,&HE2D7443E
    DATA &HC5B1E1EF,&HF8B0D847,&H35213616,&H7DC6DF37,&HBF4CA16C,&H51D38F90,&H988C1126,&H6396662B
    DATA &H92BEE941,&H82D4AECA,&HAE19975A,&H84D3803F,&H78C59C84,&H2FDA3819,&H91FEB274,&HBD99B759
    DATA &H696D74A3,&H9EC47B19,&HD31127F3,&H7BFBB907,&H55F2AF36,&H07F1906A,&H48D709CE,&H28535583
    DATA &H14E43B7B,&H26A6E166,&HC5B6BE73,&H9987436B,&H4B9F9E0D,&H711ECA4F,&H1F8A569A,&H4C4C7F8E
    DATA &HD687B61D,&H169A5E4D,&H2C214CDF,&H606A9A4F,&H39E3E02F,&H19D3C0E2,&HBB2BA06B,&H44260BBA
    DATA &H36837A77,&HD7E5755B,&H8B6D5EB2,&HE2BD64E8,&H5DAFD7B6,&H511EC46B,&H28D99976,&HB2229E54
    DATA &H119E361B,&H7F0D34A1,&H3F556E80,&H54E38DA8,&HB2C43EA2,&H4A6A18AA,&H6D68D8AE,&HDD4B1A0F
    DATA &HB08FCF44,&H9F93723A,&H9BF305C9,&H0940B334,&H77655317,&HCFA7E047,&H1FABC0EE,&HB2C99E6B
    DATA &H6938C69D,&HD2B70456,&H3A4AA7FE,&H9A5571BE,&H72E75DE4,&HC6436D54,&H63C88D17,&H3B1E4C6B
    DATA &H7D6DAFC6,&H2D781D78,&H551D6B43,&H6D631693,&H0CA258D9,&HC2AD8353,&HDBED2EA1,&HE7D494D6
    DATA &HDB5D33AA,&HD774C635,&HB7B60E08,&HEA3C14D4,&HAE70F1F7,&H15274254,&H20DB7E57,&HDF3624DB
    DATA &HD967DE36,&H34FB694A,&H5CF3EAD5,&H3714A95D,&HDFB4B55D,&H8E1B15F5,&HD4C09FBB,&HB2E5593E
    DATA &HAE7965FB,&H1C50DEAF,&H4AADD413,&HCCF2D114,&H3C053CBE,&H2131FA2A,&HA86FB8EF,&H8B5EE49A
    DATA &H8E4EC59B,&H4A212712,&HE24DEF20,&H5CD1131F,&H8F7D3BC9,&HBACE8D52,&H48140715,&HF214BADF
    DATA &H2F5717E5,&HF0A5E631,&H5148A8A5,&HF4DD4296,&HDD4AEDD4,&HA3C4BD17,&HB991EF24,&H2C4E0200
    DATA &HE1EE4B6F,&H5A527069,&H07B674FC,&HDA9EC13F,&H70AF9D0A,&HA12937B6,&H196D4427,&H8BD50886
    DATA &H3422259D,&HE5FA7FC8,&HD1E1D1C3,&HE0E0BBF1,&H7C0FC1DB,&HE4F9FB7F,&H760F5838,&H63EEEE5F
    DATA &HA3,&HDB,&HDD,&H16,&HF8,&H7F,&HEE,&H68,&H18,&HB9
END FUNCTION

Try this.  Smile

Wiki updated: _SNDOPEN - QB64 Phoenix Edition Wiki
Reply
#8
The new version is another big step in the right direction. The "Open dialog" is now as usual in Windows. Let's see if I can find a point of criticism.  Tongue

Upload still doesn't work. But after my "nice" posting, the answer looks better.
(This has nothing to do with the cookies, they are regularly deleted by me.)
[Image: jw2dj8aq.jpg]
Reply
#9
BTW @coolman and @mnrvovrfc, it's a bit buried in the bug fix list but the seg faults you were running into on this thread should be resolved. Specifically, the issue where some commands like
_DesktopHeight
would blow up if you did not insert a delay at the beginning of the program should be fixed, the GLUT-related bug fixes in this release mean the delays are no longer necessary.

Edit: I also think one of you brought up the startup time of QB64-PE programs months ago, that should be significantly better in this release, especially for console programs.
Reply
#10
(01-09-2023, 08:11 PM)Kernelpanic Wrote: Upload still doesn't work. But after my "nice" posting, the answer looks better.
(This has nothing to do with the cookies, they are regularly deleted by me.)

That "imgbb-dot-com" site is very moody today. Sad



I have noticed the improvement with the window creation, trying to write a program that made use of the new _SNDOPEN() syntax. But as I've already hinted, the program had the function return zero because the sound buffer wasn't in a recognized format. I have to look at my archives on how to create a wave-file header.
Reply




Users browsing this thread: 25 Guest(s)