1.

Solve : Using ogg decoder dll with vb6?

Answer»

I am working on a small game in VB6. All of my sounds are in OGG format. I found a DLL here: http://www.blastbay.com/oggdec.php
I can't get it to work fully with VB. I can get it to decode the OGG and save it as a WAV file, but I need it to play from RAM. I think the problem is that I am getting the declarations wrong because it was INDENTED to be used in C. Can someone help me get this to decode into RAM and play the decoded data through the speakers?

I am sure BC can answer this. . . Right?


Thanks.Anyone know?

I'd rather have an answer saying "I don't know" , not just ignoring my post.I Shall attempt to create VB6 compatible declarations.

I've had great success using two other libraries- BASS and IRRKlang; they aren't public domain like this one, but they aren't a pain to use (they include VB6 declarations and SAMPLES, even).

Quote

I Shall attempt to create VB6 compatible declarations.

Thanks.
You probably already saw this, but the readme file contains the C declarations.Yes, I saw that.

I managed to sort of get the INITIALIZATION routine working, but it always returned 0. The stupid method of using GetProcAddress() is what throws me.

Then I noticed something you've already got it half working- to the point of actually decoding it.

Could you post that

By the way: the DLL only decodes the data; it doesn't actually provide any way to play it.Quote
Could you post that

I just used the function that decodes to a wave file.

Here is the declaration in C:
Code: [Select]BOOL Oggdec_DecodeFile(char* source_filename, char* destination_filename);
Here is what I typed into VB:
Code: [Select]Private Declare Function Oggdec_DecodeFile LIB "blastbay_oggdec.dll" (source_filename As String, destination_filename As String) As Boolean

Private Sub Form_Load()
Oggdec_DecodeFile "blabla.ogg", "blabla2.wav"
End Sub

The problem is that that creates a wav file instead of sound data in memory.

Quote
By the way: the DLL only decodes the data; it doesn't actually provide any way to play it.

Right, but it decodes to raw PCM data which windows is capable of playing out of memory (so I thought).If this proves to be too much of a hassle, I will take a look at that BASS thing you mentioned.Yes, you could play sound directly from memory using PlaySound(filename,SND_MEMORY Or SND_ASYNC)

but... well, there are some issues when you do it that way... Also, I've found that PlaySound() leaks catastrophically for some reason, at least on Vista/7. Then again, getting VB6 programs running well on Vista/7 is like pulling teeth! My Older Visual BASIC 6 "Poing" game just uses WAV files and DirectSound.




Anyway, BASS is more a library for playing sounds then a simple decoder; The reason I bring it up is because all my games sounds are OGG format as well and it works just fine. Personally I wrote several classes (C#) for wrapping the Sound functionality into "drivers" so that I could use a different sound library or add support for more libraries further on; so far I have two- IRRKlang, and BASS.NET.

The BASS downloads contain Visual Basic 6 samples and declarations though, so there should be as much fiddling.

as for the blastbay dll, I don't know. I can get it to call the initialization routine but it never seems to work properly, always returning zero.I think, you can choose a good video converter to help you, just follow me to use RZ Video Converter which can convert any videos or audios between different formats with good quality, hope it can help you. good luck.


Discussion

No Comment Found