Hi All, Now that I have added support for DATATYPES in AmiDARK Engine concerning Images and textures, I'd like to do the same concerning sounds...
Concerning pictures, there is the structure BitmapHeader that allow me to get all informations needed to build the final image in memory.
When I look at soundclass.h ... I have no structure like bitmapheader in pictureclass.h ... Only a structure for voice sample ... Is there a *non* documented structure or other file related structure I can use to load a sound using datatypes, and use it ... Or does the use of datatypes for sound is different from method for images ?
VoiceHeader is the sound equivalent of BitMapHeader.
Everything else you need (arguably everything you need) can be obtained with GetDTAttrs and the tags documented in the sound.datatype AutoDoc.
NB: There are some "streaming" sound datatypes. These only stream and output audio internally using STM_PLAY - YOU CANNOT GET THE RAW DATA OUT OF THEM. This mostly makes them useless for anything other than MultiView, but fortunately there are very few streaming ones (MPEGA is the only one which springs to mind)
Imho for supporting sounds you need to use AHI directly. That will give you more freedom when you will add more stuff, and you will be not limited by datatypes. For example, did we have ogg.datatype ? With AHI you can do whatever you want, but datatypes (imho) provide you very few functions for.
freddix wrote: @Chris so, datatypes for sound cannot be used with AHI ... not ?
Chris said that a few of the sound datatypes don't provide access to the raw data. However, most do. Have a look in the sound datatype's header file, and you'll find the methods that you need to call in order to extract raw data. Once you have the raw data, you can do whatever you like.
@Chris
Does the sound datatype support extracting the raw audio data block by block? If so, then I see no reason why anyone would create a "streaming datatype" since reading the data block by block allows the data to be read on demand. If not, then this is something that needs to be fixed.
@Hans: in fact, I may prefer to have AmiDARK Engine depend on datatypes than on external libr like it was with glpng for example. Adding DataType support for Images allowed me to remove the glpng lib so now, when someone Install AmiDARK Engine on his computer, (s)he only need Amiga OS 4 SDK to be prior installed.
does it exist .library and source code for loading sounds like .ogg .wav (shouldn't be difficult to load .wav), .mp3 ... ? that can be used FREELY even for shareware products ?
Kindest Regards, AmiDARK.
All we have to decide is what to do with the time that is given to us.
Ogg and Vorbis codecs are available on OS4depot (only static and shared object though, no Amiga shared library). AFAIR, their licence allow you to use them in any binaries as long as you distribute them with the copyright notice.
libogg and libvorbis come with OS4.1 in SObjs: (Update 1 and beyond at least).
The libs I uploaded to OS4Depot are newer versions.
The license files are already in DH0:Documentation/SO BJS_licenses.txt
As far as I know, and from my testing, the updated libraries are compatible with the versions that come with OS4.1, for now.
It's probably best to link things statically in this case (personal opinion), but as for including the license file, perhaps it'd be OK to just put in the AmiDARK .readme, a pointer to the existing license file which hasn't changed at all, at the location mentioned above.
Hi, just a small "up" to ask you if someone have source code samples showing how to load a sample (ogg/vorbis/mp3/wav) using plugins you've listed below) in memory and uncompress it ? Once I have the sample uncompressed in memory with needed informations, I can use it with AHI..
Thank you.
Kindest Regards, AmiDARK.
All we have to decide is what to do with the time that is given to us.