[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Recording wav; formatting

Posted on 1998-12-16
7
Medium Priority
?
475 Views
Last Modified: 2012-05-04
How can I change formatting for recording of a wave file.
For example sample rate, number of bits, etc.

I am using mciSendString function, and I can record wave file, but only with 11.025 kHz, 8-bit mono.

Thanks.
0
Comment
Question by:idjurek
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 4

Expert Comment

by:Chizl
ID: 1450507
I have never tried recording my own Wav file, but would be interested in the code you have so far.
0
 
LVL 2

Expert Comment

by:trillo
ID: 1450508
I could put here a whole bunch of code without knowing what you exactly want, so I'll please ask you to answer these questions.
1) I asume you're using high level API functions ("mciSendString").. Am I right?
2) Do you already know how to record?
3) Do you want to change the parameters before recording some sound?
It'll be a pleasure answering your questions if you answer mine.

Trillo
0
 

Author Comment

by:idjurek
ID: 1450509
Edited text of question
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:idjurek
ID: 1450510
I am using mciSendString function from API WinMM.dll, but only can record with 11.025 kHz and 8-bit mono. I would like to change it for example, to 44.1 kHz and 16-bit stereo.
0
 
LVL 2

Accepted Solution

by:
trillo earned 200 total points
ID: 1450511
Here it is... You shoul use the mciSendString function with the "set" keyword... look a t the following example.

-------------Begin of code-----------------
Private Declare Function mciSendString Lib "winMM.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Integer, ByVal hWndCallback As Integer) As Long

Private Sub Command1_Click()
Me.Print mciSendString("open new type waveaudio alias myaudio", 0, 0, 0)
Me.Print mciSendString("set myaudio channels 2 samplespersec 44100", 0, 0, 0)
Me.Print mciSendString("record myaudio", 0, 0, 0)
End Sub

Private Sub Command2_Click()
Me.Print mciSendString("stop myaudio", 0, 0, 0)
End Sub

Private Sub Command3_Click()
Me.Print mciSendString("save myaudio d:\text2.wav", 0, 0, 0)
Me.Print mciSendString("close myaudio", 0, 0, 0)
End Sub

--------------end of code-------------------
YOu can see the usage in the click event for command1. You can use the following parameters for waveaudio recording:
    alignment integer
    any input
    any output
    audio all off
    audio all on
    audio left off
    audio left on
    audio right off
    audio right on
    bitspersample bit_count
    bytespersec byte_rate
    channels channel_count
    door closed
    door open
    format tag pcm
    format tag tag
    input integer
    output integer
    samplespersec integer
    time format bytes
    time format milliseconds
    time format samples

Trillo.
0
 

Expert Comment

by:squeaksvolvo
ID: 13025551
What is the "input integer" setting? See my question at http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_21270770.html if you can help.
0
 
LVL 4

Expert Comment

by:Chizl
ID: 13027813
WOW..  7 years later, I still get an email for this question.. lol
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question