Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Minor Issue with Audio
#5
Thank you sir! I really appreciate you looking into it, and of course, it works now.

Using what you said, I found that this also works.

Code: (Select All)
DIM AS STRING sndFile
DIM AS LONG sndH
DIM AS DOUBLE sndL

sndFile = _OPENFILEDIALOG$("Open Sound File", "", "*.mp3|*.ogg|*.wav|*.flac", "Audio files", -1)

IF sndFile <> "" THEN
sndH = _SNDOPEN(sndFile)
IF sndH > 0 THEN
  _SNDVOL sndH, .25
  PRINT "Waiting for sound to render";
  DO
  sndL = _SNDLEN(sndH)
  PRINT ".";
  _DELAY .001
  LOOP WHILE sndL = 0
  PRINT
  _SNDPLAY sndH
  PRINT "File:"; sndFile
  PRINT "Sound Handle:"; sndH
  PRINT "Sound Length:"; sndL
END IF
END IF

This has the advantage of allowing it to "bake" and the program can do other things, and periodically check if the audio is ready.

Is this going to be normal behavior moving forward? I don't want to build a work around and have it patched out later.
Reply


Messages In This Thread
Minor Issue with Audio - by justsomeguy - 08-11-2024, 05:46 PM
RE: Minor Issue with Audio - by bplus - 08-11-2024, 09:14 PM
RE: Minor Issue with Audio - by a740g - 08-12-2024, 04:17 AM
RE: Minor Issue with Audio - by a740g - 08-14-2024, 04:48 PM
RE: Minor Issue with Audio - by justsomeguy - 08-15-2024, 03:19 PM
RE: Minor Issue with Audio - by a740g - 08-15-2024, 08:02 PM
RE: Minor Issue with Audio - by NakedApe - 08-15-2024, 06:15 PM
RE: Minor Issue with Audio - by justsomeguy - 08-15-2024, 06:28 PM
RE: Minor Issue with Audio - by NakedApe - 08-15-2024, 06:40 PM



Users browsing this thread: 6 Guest(s)