Apr 18th, 2002, 04:27 PM
Is there a DLL or OCX, that you can give a buffer (WAV Data) and converts it to an MP3 buffer ? and vice versa ?
I need it to be done in memory (with buffers), I want to do a voice chat program..... so nothing is done on the disk...
Tanks in advance
Apr 18th, 2002, 04:33 PM
So are you saying you want the program to change a wav sequence into a mp3 sequence as it is being said and not save anything onto the computer?
-Show me on the doll where the music touched you.
Apr 18th, 2002, 04:42 PM
I have programs that convert a WAV file to MP3, but when I have to send over the internet every second, and every time to make a WAV file for only one second and then convert to another file MP3, it too much processing, too many files, and too slow....
I want to give to a DLL(let say), a pointer to the WAV data, the DLL converts the data to MP3 and returns a pointer to the new buffer, then I can send the buffer over the internet to the person I'm chatting with.... (and there the reverse is done)
Maybe there are OCX, or DLL files that do ALL that, but I want only the converting part because I want to throw in an encription algoritm before sending the data (I know how to do that)
All I need is something that convers to mp3 and vice versa in memory....
Apr 18th, 2002, 06:20 PM
Someone.... please...... help !
May 5th, 2002, 12:54 PM
Please, if you find this Dll, please contact me, I really need this kind of dll. I'll contact you if I find One.
May 5th, 2002, 08:10 PM
I FOUND IT !!!
I FOUND IT !!!
It's a DLL, as I was hoping, It's called BladeEnc.DLL (Blade Encoder DLL). BUT it works only in C/C++, I don't know why it does not work in Visual Basic... (I could not get it to work...)
But I got around it, of course, I made another DLL, in MFC that is using the BladeEnc.DLL, and this one can be included in Visual Basic.
First of all, here is the link where I found the original DLL....
I attached my source code for the DLL(that uses BladeEnc.DLL), a BAS file so you can use my DLL in Visual Basic, and a CLS, to make your life a little easier . The code is not very good, but it's a start
So, let's recap.
The CLS uses the BAS, the BAS uses the BladeEncVB.DLL, and BladeEncVB.DLL uses the BladeEnc.DLL....
If your wandering if it affects the speed passing values from one to the other, then the other, and so on.... I say ... NO, not really... If you notice, every time it's passing pointers (4 Bytes for each parameter), so, that should not slow down the encoding part even if the buffer is very long, it only passes 4 bytes (it's pointer)
Also, you will notice a new function I made, ChangeSoundVolume and ChangeSoundVolumeB, both of them are for 16 Bit WAV buffer, just the way you pass the data is different. Visual Basic is slow on loops, that's why I made it in the BladeEncVB.DLL
OK, NOW !
I have another problem
ANYONE find the same thing but to DECODE !
(To decode in memory like this DLL...)
PS: I noticed this thread has top rating, I wander how it will be after this post
If anyone makes improvements to my code, please post the code here, Thanks...
May 6th, 2002, 11:16 AM
Thank you for your Dll. I will try it as soon as possible.
I don't know C/C++, but i see you do so have a look at this file, maybe it can help you.
I've got other files that could help but bigger than 100 Ko. Can you send me your email please cause i don't remember where i download them.
May 6th, 2002, 05:49 PM
I have a mp3 encoding example on my website. I didn't make the dll so I don't know if it encodes in memory or not. Couldn't hurt to try it out I guess. I saw a couple examples at planetsourcecode using a c++ dll to decode a mp3 to a wave file. Again I don't know if it does it in memory or not.
May 7th, 2002, 09:51 AM
The Dll you've made is just great. It works well, I can code in mp3. Only one thing, I don't know why, but i can't get access to your event MP3buffer(Buffer() as byte). One other thing is that i don't know why when outputing to a file the end of the file is just no sound but what i encoded is perfect. (I recorded 8s via DSound8 : 8s perfect then 8s nosound).
Thank you for all
Hope you'll find the other way (mp3->wav).
May 7th, 2002, 02:57 PM
to get the event working, do this in your form...
And to fix the problem with the second buffer not being correct you need to make the DirectX buffer a multiple of BEncoder.Samples and to make sure the buffer is aligned (divizible by 4)
' General Declarations...
Private WithEvents BEncoder As BladeEncoder
Private Sub Form_Load()
Set BEncoder = New BladeEncoder
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Set BEncoder = Nothing
Private Sub DirectXEvent8_DXCallback(ByVal eventid As Long)
Dim DataBuff() As Byte
ReDim DataBuff(HBuffer - 1)
Select Case eventid
gDSCB.ReadBuffer HBuffer, HBuffer, DataBuff(0), DSCBLOCK_DEFAULT
gDSCB.ReadBuffer 0, HBuffer, DataBuff(0), DSCBLOCK_DEFAULT
If eventid = StartEvent Or eventid = MidEvent Then
' write to file...
' when you initialize your DirectX sound do this
Private Sub Initialize()
' you must call BEncoder.InitStream before this line
HBuffer = BEncoder.Samples * 8
HBuffer = HBuffer + (HBuffer Mod wFormat.nBlockAlign)
BufferSize = HBuffer * 2
.fxFormat = wFormat
.lBufferBytes = BufferSize
.lFlags = DSCBCAPS_DEFAULT
Set gDSCB = gDSC.CreateCaptureBuffer(dscBuf)
ReDim dsbpn(0 To 2) As DSBPOSITIONNOTIFY
StartEvent = gDX.CreateEvent(Me)
.hEventNotify = StartEvent
.lOffset = 1
MidEvent = gDX.CreateEvent(Me)
.hEventNotify = MidEvent
.lOffset = HBuffer
EndEvent = gDX.CreateEvent(Me)
.hEventNotify = EndEvent
.lOffset = DSBPN_OFFSETSTOP
gDSCB.SetNotificationPositions 3, dsbpn()
May 7th, 2002, 03:02 PM
Your putting alot of work into this. If you want to share it I would put it on my website. Giving you the credit of course.
May 7th, 2002, 03:35 PM
I would want to share the program i'm working on (SoundBroadcast), but I don't really want to share the code at this point, it's too messy... lot's of functions that are not used... it's not comented at all.... (I hate that ), I don't need coments for myself...
The initial code was only for recording sound to a wave file, and I modified the project to compress to mp3, then to send to whomever is connected to the program...
But the program itself (compiled) is pretty good....
It's basicly like a Shouthcast server.... except this one is sending what you curently have on you sound card... if windows makes a sound, or if ICQ is on, or something like that... the people connected hear whatever you hear on your sound card hehe, and oviously, if the micrphone is on, you can also talk in it, and they will hear it.... (That's how I really wanted to do), then I discovered that it works for all sounds....
Well... I think it depends on the sound card also.... with mine i can set it to "what you hear", or a specific input... like wave, midi, mic., etc.
If you want to put the Setup program on your web-page, just tell me, and i'll make the setup, and i'll put it on MY web-page (probaly it's about 3 - 4 Megs) so you can download it.... (I don't have any hits on my web-page...)
May 7th, 2002, 07:32 PM
The code you send doesn't work on my computer, the sound is awful. Can you send me the whole code Please.
May 9th, 2002, 05:15 AM
I change your class module just in one line this one :
DSamples = DSamples - (TSamples)
DSamples = DSamples - (TSamples * 2)
in the encodeChunk function.
Now it works very well and i don't have to care about the buffer size.
Thank you for your Dll a lot, it's great.
May 9th, 2002, 06:08 PM
New encoder Dll
I found another dll that works for encoding like bladeenc.dll.
you can find it there : http://www.jthz.com/~lame/
It uses the same functions that bladeenc.dll so I just rebuild your C/C++ project changing the name of the library to load.
I think the sound quality is better.
I hope you can do a decoder soon.
May 9th, 2002, 10:08 PM
I'm trying for days to get the mpglib.dll to work, but it crashes everytime I try to decode.... I think the DLL is accessing memory outside of the array I pass it to....
Well.... if anyone finds a DLL to decode for MP3, even if it's in C/C++, please post a message where i can get it from.... I will write the code so it can be used in VB.....
May 10th, 2002, 06:12 PM
Can you send me what you've done with the mpglib.dll please ?
May 10th, 2002, 06:16 PM
But it will crash your VB....
Originally posted by matt3011
Can you send me what you've done with the mpglib.dll please ?
May 11th, 2002, 05:51 AM
I don't care, I want to try before saying we can't do anything with it.
If it crashes VB, no matter, you restart VB. It won't crash my computer.
May 11th, 2002, 04:48 PM
Send it my way also and I will help you work it out.
May 11th, 2002, 06:59 PM
I wanted to make a DLL for both Encode and Decode, but the decode crashes when I use the function DecDecodeChunk (decodeMP3 in DLL). It does not crash the first time I call it, but after 2 to 5 calls.... I named the functions (for VB) different so there is an obvious distinction between encode functions, and decode functions...
I have Windows 2000, so my windows does not crash, but if you have Windows 98, 95 I think it will crash windows too...
I don't really like the sound of that....
WARNING: If decodeMP3 returns MP3_ERR you should instantly reinitialize the mpglib. Otherwise it could crash. Originally the mpglib exits if a heavy error occurs. This is disabled in the mpglib.dll (#define BE_QUIET) to force playback of corrupted MP3 files.
When I try to decode, the decodeMP3 function returns MP3_ERR every time after the first call....
By the way.... the Lame Encoder.... I looked on the net for example code in C/C++, and I could not find any, but I looked in the DLL, and it has a couple more functions, and it seems that it can do more than just encoding.... but not sure since I don't any samples how to use it....
I'm thinking to add in InitializeEncodeDLL a parameter to what DLL you want to use. I did not do that yet, since I don't know for sure how to use it.
Last edited by CVMichael; May 16th, 2002 at 02:57 AM.
May 11th, 2002, 08:24 PM
If you want I have a nice mp3 encoder someone made in vb that uses the lame dll. I don't remember his name but I downloaded it from planet source code. I don't know if it is still their or not. LMK and I could put it on my webpage and give you a link to download it from.
May 11th, 2002, 08:30 PM
Sure... Only if you have the code....
May 11th, 2002, 08:33 PM
Of course I have the code. Let me find it.
May 11th, 2002, 08:50 PM
Ok I'm assuming you got it downloaded. I removed the link for bandwidth reasons. BTW your welcome
Last edited by formulav8; May 12th, 2002 at 01:56 PM.
May 15th, 2002, 04:33 PM
May 15th, 2002, 07:15 PM
You talking to me or him?
May 16th, 2002, 02:46 AM
Well, if your talking to me.....
No, nothing new...
I've looked over the net for days, and nothing.... most of the decode DLLs i found I can't get them to work.... lots and lots of errors and crashes.... and all kinds of weird stuff
And mpglib.dll, I still did not get it to work... keeps crashing my VB
You were saying that you are gonna look at my attempts to make it work..... Did you had any success ?
Last edited by CVMichael; May 16th, 2002 at 02:55 AM.
May 16th, 2002, 05:17 AM
I didn't make it work. Even if I just Send one frame of the mp3file, it crashes.
May 17th, 2002, 06:28 PM
Have a loof at www.fmod.org. I'm sure something can be done with tis dll.
I didn't look so far at the moment. So, I don't know how it works, I've just look the examples in VB. They don't use in memory translation but I'm sure this can be done.
Click Here to Expand Forum to Full Width