This app, records sound with DirectXSound, and encodes it REAL TIME to an MP3 file, no other files in between...
You can record to MP3 in Mono or Stereo, sample rates of 48000, 44100 and 32000, and with those bitrates: 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256 and 320
First of all, download the BladeEnc.dll from this website: http://home.swipnet.se/~w-82625/skeleton/DL.html
This is the website I found by searching on the net, there are probaly many other places where you will also find the dll.
Unzip the dll in your system folder
From the ZIP attached, place the BladeEncVB\Release\BladeEncVB.dll in the system folder also.
I made the BladeEncVB.dll because you cannot reference the BladeEnc.dll directly from Visual Basic, so I had to make something in between.
I also added a digital volume, and will amplify the sound up to however much you like, in the app i made the limit up to 600%, but you can change the code to amplify much more than that.
Now you can run the application, record away !
Last edited by CVMichael; Jul 26th, 2006 at 12:22 PM.
The code/files within this thread (submitted: 03-07-2004) have been checked for malware by a moderator.
Disclaimer: This does not necessarily mean that any compiled files (DLL/EXE/OCX etc) are completely safe, but any supplied code does not contain any obvious malware. It also does not imply that code is error free, or that it performs exactly as described.
It is recommended that you manually check any code before running it, and/or use an automated tool such as Source Search by Minnow (available here or here).
If you find any serious issues (ie: the code causes damage or some sort), please contact a moderator of this forum.
Usage of any code/software posted on this forum is at your own risk.
Michael, I followed this post & link which brought me here. http://www.vbforums.com/showthread.p...ht=sound+event
While I realize that these are very old posts of yours, I'm interested in doing the same thing that the OP wanted to do. Namely. I want to trigger an event when audio level from the mic input is above a predetermined level.
One is BladeEnc082.zip and BladeDLL-082-intel.zip. Which of these files should I download, or is it both?
Thanks
<--- Did someone help you? Please rate their post. The little green squares make us feel really smart!
If topic has been resolved, please pull down the Thread Tools & mark it Resolved.
Is VB consuming your life, and is that a bad thing??
For your last question... I don't remember... I made this project a while ago, I don't remember having as many options as there are listed now
I would go for: BladeDLL-082-intel.zip and if it does not work, then try the other one, you don't have to install the DLL, therefore, if it does not work, you can just delete it, and try the other one. I will try it myself later....
To encode to MP3 I now use the Lame ACM codec, I don't use the BladeEncoder anymore. I did not have time to make a project to put it in the CodeBank (or tutorial) using the Lame ACM.
Anyways....
But for your first question... you don't need to encode to MP3 in order to get the sound level... you only need DirectX... At the time I posted in the thread
"How get voice-key event in VB6?" I did not have my sound tutorial.
Here's what to do:
Download the attachment from Post #5 from my sound tutorial: From Here
This code is a "clean" code on how to record, just remove the code where it saves to the wav file.
Now replace the DisplayWaveData16 from the tutorial with the ShowWAVData16Bit from the MP3Encoder, of course you will have to make a few modifications to make it work.
What you need is the LAve & RAve from the ShowWAVData16Bit sub.
In fact you can strip all the code from the function except where the LAve is calculated.
Or... you could see how LAve is calculated, and just modify the code in the tutorial to calculate the LAve.....
LAve stands for Left channel average, and RAve stans for Right channel average. But since you will record in Mono (microphone is mono), you only need the "LAve".
Now all you have to do is something like:
If LAve > your_threashold Then RaiseEvent...
I did not do this for you because I think it will help you understand what is going on in the project better, since your gonna work with the code.
But if you have any problems, I will make a project for you that does what you need.
Michael, it's 0130hrs and I need to get to bed, but I wanted to get this posted befor I hit the sack. What can I say .... IT'S GREAT!! I love it! I won't pretend to understand all the code but I'm just dangerous enough to plod through others code to make it do what I want. I added this test code in the Private Sub DisplayWaveData16(DataBuff() loop.
Code:
Label1.Caption = RY ' Display input level digitaly
If RY >= 0.8 Then Label2.Caption = "Threshold Reached" 'Display Threshold level reached
Ultimately I will be including a timer that will be enabled by an input level that is greater than my threshold value and be disabled when a second audio value exceeds a similar value.
Thank you so much for your knowledge and skill.
Chris
<--- Did someone help you? Please rate their post. The little green squares make us feel really smart!
If topic has been resolved, please pull down the Thread Tools & mark it Resolved.
Is VB consuming your life, and is that a bad thing??
Ow... I now understand what you wanted... I was telling you to basicaly get the average of the whole buffer, and check the peek of that... but you actually want to see if any sample within the buffer is over the peek....
For your last question... I don't remember... I made this project a while ago, I don't remember having as many options as there are listed now
I would go for: BladeDLL-082-intel.zip and if it does not work, then try the other one, you don't have to install the DLL, therefore, if it does not work, you can just delete it, and try the other one. I will try it myself later....
To encode to MP3 I now use the Lame ACM codec, I don't use the BladeEncoder anymore. I did not have time to make a project to put it in the CodeBank (or tutorial) using the Lame ACM.
Anyways....
But for your first question... you don't need to encode to MP3 in order to get the sound level... you only need DirectX... At the time I posted in the thread
"How get voice-key event in VB6?" I did not have my sound tutorial.
Here's what to do:
Download the attachment from Post #5 from my sound tutorial: From Here
This code is a "clean" code on how to record, just remove the code where it saves to the wav file.
Now replace the DisplayWaveData16 from the tutorial with the ShowWAVData16Bit from the MP3Encoder, of course you will have to make a few modifications to make it work.
What you need is the LAve & RAve from the ShowWAVData16Bit sub.
In fact you can strip all the code from the function except where the LAve is calculated.
Or... you could see how LAve is calculated, and just modify the code in the tutorial to calculate the LAve.....
LAve stands for Left channel average, and RAve stans for Right channel average. But since you will record in Mono (microphone is mono), you only need the "LAve".
Now all you have to do is something like:
If LAve > your_threashold Then RaiseEvent...
I did not do this for you because I think it will help you understand what is going on in the project better, since your gonna work with the code.
But if you have any problems, I will make a project for you that does what you need.
CVMichael,
I know that some time ago but you do not program in VB6, but help me, change your project using the Lame ACM MP3 and WAV to please.
This app, records sound with DirectXSound, and encodes it REAL TIME to an MP3 file, no other files in between...
You can record to MP3 in Mono or Stereo, sample rates of 48000, 44100 and 32000, and with those bitrates: 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256 and 320
First of all, download the BladeEnc.dll from this website: http://home.swipnet.se/~w-82625/skeleton/DL.html
This is the website I found by searching on the net, there are probaly many other places where you will also find the dll.
Unzip the dll in your system folder
From the ZIP attached, place the BladeEncVB\Release\BladeEncVB.dll in the system folder also.
I made the BladeEncVB.dll because you cannot reference the BladeEnc.dll directly from Visual Basic, so I had to make something in between.
I also added a digital volume, and will amplify the sound up to however much you like, in the app i made the limit up to 600%, but you can change the code to amplify much more than that.
Now you can run the application, record away !
Michael,
I wish your project utilized the "Lame ACM" and not "Blade encoder", you have to change, please?