Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27153

VS 2008 record audio using mcisendstring in vb 2008

$
0
0
I made a program to record audio from the line input of my soundcard using vb 2008. I've got the bitspersample set to 16. The samplespersec set 44100. Channels is set to 1 for mono. All that works just fine. But the kbps are very low. 88kbps for the last one I recorded. If I put that file in cool edit and resave it with the same file name it changes to over 700kbps. Is there code for vb to make it save the audio file with a higher kbps than 88kbps? I have included the code I have below.

mciSendString("open new Type waveaudio Alias capture", "", 0, 0)
mciSendString("set capture bitspersample 16", 0&, 0, 0)
mciSendString("set capture samplespersec 44100", 0&, 0, 0)
mciSendString("set capture channels 1", 0&, 0, 0)
mciSendString("record capture", "", 0, 0)


mciSendString("save capture c:\test.wav", "", 0, 0)
mciSendString("close capture", "", 0, 0)

I also made a player app to play the recorded files. If I use

my.computer.audio.play("c:\test.wav")

it works, but when I try to add the AxWindowsMediaPlayer1 control to the form and play the audio file it doesn't work. If I put that audio file in cool edit and resave it then it plays using the AxWindowsMediaPlayer1 control.

Does anyone know how to record audio with a higher kbps without resaving it in cool edit first?

Viewing all articles
Browse latest Browse all 27153

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>