Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Minor Issue with Audio
#1
Hello

I sorry to keep bothering you guys with issues. I'm writing a game that has background music that is looping. I fade the music in and fade it out, so that it doesn't sound abrupt when starting to play or when I want it to end. So, this somewhat depends on the length of the sound clip.

So, I use _SNDLEN (handle) get the length of the sound clip. With version 3.14, _SNDLEN() no longer reports the length of a sound file that has the *.ogg extention. It returns 0 length. It has a handle and it will play it, just _SNDLEN() returns 0. 

I checked with *.mp3 and they report the correct length.

Version 3.13 works correctly with either extension .

Sample code and couple of .ogg files.

I'm running Linux.

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
  sndL = _SNDLEN(sndH)
  _SNDPLAY sndH
  PRINT "File:"; sndFile
  PRINT "Sound Handle:"; sndH
  PRINT "Sound Length:"; sndL
END IF
END IF

END IF


.ogg   fx_drop_004.ogg (Size: 9.09 KB / Downloads: 23)

.ogg   fx_question_003.ogg (Size: 10.09 KB / Downloads: 31)
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: 1 Guest(s)