What does the value returned by 'LoadSound()' represent?

Advanced game related topics
Axeman
User
User
Posts: 89
Joined: Mon Nov 03, 2003 5:34 am

What does the value returned by 'LoadSound()' represent?

Post by Axeman »

Hi. I'd like to find out what the value returned by LoadSound() represents, if anyone knows (this is for the Windows x64 version of PureBasic). I assume that it's a handle\address pointer to a DirectSound object or buffer?

The reason that I'm asking is that I'm in the middle of porting an OpenAL wrapper library I wrote in BlitzMax to PureBasic and I need to get the buffer pointer, buffer size, sound format ID, etc for a loaded sound so that I can use them with the 'alBufferData' OpenAL command. I'm looking for a way to use the system ID returned by LoadSound() to obtain this information.
infratec
Always Here
Always Here
Posts: 6817
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: What does the value returned by 'LoadSound()' represent?

Post by infratec »

Wouldn't it be easier to simply load the file into a memory buffer?

It is easy to load a WAV file and find the buffer.
If you need other fileformats it gets complicated.
Axeman
User
User
Posts: 89
Joined: Mon Nov 03, 2003 5:34 am

Re: What does the value returned by 'LoadSound()' represent?

Post by Axeman »

Yes, the code for a WAV loader seems to be very simple and would give me the details I need to work with OpenAL. I was planning to use that method to convert my OpenAL library for BlitzMax to PureBasic, but now I'm hitting other issues with PureBasic's 3D library that make me think that I'm better off just switching my project back to BlitzMax.
User avatar
bfernhout
Enthusiast
Enthusiast
Posts: 123
Joined: Mon Feb 26, 2018 10:41 pm
Location: Netherlands
Contact:

Re: What does the value returned by 'LoadSound()' represent?

Post by bfernhout »

I do not know if i do this on the right way. But if you want to know the adress of a loaded sound. But i use the following methode:

Code: Select all

#My_Sound = 1
Global Position.i
LoadSound(#My_Sound,"The_Sound.wav")
*Position = @#My_Sound
*Position is now a memeory pointer to the sound file.
From my first self made computer till now I stil like computers.
Post Reply