MCI recording silence, but Sound Recorder records OK.

Hello everybody,

This code using MCI is working fine in many PCs, but one (in which only a 
long silence is recorded):

 //
 // OPEN
 //
 sMsg.Format("open new type waveaudio alias %s", m_sWavName);
 mciError = mciSendString(sMsg, lpszReturnString, 256, NULL);
 (...)
 sMsg.Format("status %s mode wait", m_sWavName);
 mciError = mciSendString(sMsg, lpszReturnString, 256, NULL);

 (...)
 sMsg.Format("set %s format tag PCM", m_sWavName);
 mciError = mciSendString(sMsg, lpszReturnString, 256, NULL);
 (...)
 sMsg.Format("set %s channels 1", m_sWavName);
 mciError = mciSendString(sMsg, lpszReturnString, 256, NULL);
 (...)
 sMsg.Format("set %s samplespersec 11025", m_sWavName);
 mciError = mciSendString(sMsg, lpszReturnString, 256, NULL);
 (...)
 sMsg.Format("set %s bytespersec 11025", m_sWavName);
 mciError = mciSendString(sMsg, lpszReturnString, 256, NULL);
 (...)
 sMsg.Format("set %s alignment 1", m_sWavName);
 mciError = mciSendString(sMsg, lpszReturnString, 256, NULL);
 (...)
 sMsg.Format("set %s bitspersample 8", m_sWavName);
 mciError = mciSendString(sMsg, lpszReturnString, 256, NULL);
 (...)

 //
 // RECORD
 //
 sMsg.Format("record %s", m_sWavName);
 mciError = mciSendString(sMsg, lpszReturnString, 256, NULL);
 (...)
 sMsg.Format("status %s mode wait", m_sWavName);
 mciError = mciSendString(sMsg, lpszReturnString, 256, NULL);
 (...)

 //
 // Stop capture
 //
 sMsg.Format("stop %s", m_sWavName);
 mciError = mciSendString(sMsg, szReturnString, 256, NULL);
(...)

 //
 // Save capture
 //
 CString sWavTmp = m_sWavName;
 sMsg.Format("save %s \"%s.wav\"", m_sWavName, sWavTmp);
 mciError = mciSendString(sMsg, szReturnString, 256, NULL);
(...)

 //
 // Close capture
 //
 sMsg.Format("close %s wait", m_sWavName);
 mciError = mciSendString(sMsg, szReturnString, 256, NULL);
(...)
 sMsg.Format("close all wait", m_sWavName);
 mciError = mciSendString(sMsg, szReturnString, 256, NULL);


Each value returned by mciSendString is checked, to see if everything is 
going OK.

As I said, this code is working fine in every PCs (a lot of them), but one.
On this PC, the return values of mciSendString are also OK.
But when you listen to the recording it is only a long silence. Just as it 
would happen if no mic was plugged in. But there is a mic. And if I try to 
record via Start | All programs | Accessories | Entertainment | Sound 
Recorder, it records perfectly!
What could be different in this PC so that my code does not work? It has a 
quite complete sound card (many holes, but I've tried them all! and a 
glamorous sound control software): 'Realtek High Definition Audio'.

Any ideas on why Sound Recorder records and my code does not on this PC?
Any hints on how should I change my code in order to get it recording?

Thank you!

Ricardo V�zquez
Madrid.


0
rvazquez (38)
9/11/2007 10:54:05 AM
vc.mfc 33608 articles. 0 followers. Follow

5 Replies
1056 Views

Similar Articles

[PageSpeed] 16

"Ricardo Vazquez" <rvazquez@dummy.com> wrote in message 
news:%23%23PPWIG9HHA.4200@TK2MSFTNGP04.phx.gbl...

> This code using MCI is working fine in many PCs, but one (in which only a 
> long silence is recorded):

Ricardo, I haven't tried using the MCI interface since the days of Windows 
3.1 and so I probably wouldn't detect any errors.

But here's a comment with a very remote chance of being relevant:   I do 
play short sounds from my own wav files with the PlaySound() API.   Suddenly 
I found this was working on all computers but one.

The sound files in question were ones I had recorded many years ago.   It 
turned out that they were "8bit mono" wav files, and that the new 
Soundblaster X-Fi card does not recognise those,  I converted them to 
"16bit-mono" and all was well.

Is it possible that the hardware is choking on some parameter you have set? 
Eg:  I have no deep understanding your line

> sMsg.Format("set %s bitspersample 8", m_sWavName);

but it reminded me of my recent problems.

Dave
-- 
David Webber
Author of 'Mozart the Music Processor'
http://www.mozart.co.uk
For discussion/support see
http://www.mozart.co.uk/mzusers/mailinglist.htm

 

0
dave9996 (486)
9/11/2007 2:15:56 PM
Very interesting, Dave! Thank you!
I'm going to ask for one of the files recorded  to see if they really are 
full of 0s inside. If not, then the problem wouldn't be of recording, but of 
playing, maybe due to a too old format...
I'll also check out how does MCI behaves on that PC if I ask it to record at 
a higher quality format (the 16bit you pointed out, for instance).

Anyway, I wanted to ask you:
If some applications of yours record sound, what API do you use? What API 
would you, please, recommend for me to use? As you see, what I need to do is 
pretty simple: to record the line-in or the mic, into a low quality wave 
file; nothing more.

Thank you very much!

Ricardo.

"David Webber" <dave@musical-dot-demon-dot-co.uk> escribi� en el mensaje 
news:eJe7r5H9HHA.3916@TK2MSFTNGP02.phx.gbl...
>
> "Ricardo Vazquez" <rvazquez@dummy.com> wrote in message 
> news:%23%23PPWIG9HHA.4200@TK2MSFTNGP04.phx.gbl...
>
>> This code using MCI is working fine in many PCs, but one (in which only a 
>> long silence is recorded):
>
> Ricardo, I haven't tried using the MCI interface since the days of Windows 
> 3.1 and so I probably wouldn't detect any errors.
>
> But here's a comment with a very remote chance of being relevant:   I do 
> play short sounds from my own wav files with the PlaySound() API. 
> Suddenly I found this was working on all computers but one.
>
> The sound files in question were ones I had recorded many years ago.   It 
> turned out that they were "8bit mono" wav files, and that the new 
> Soundblaster X-Fi card does not recognise those,  I converted them to 
> "16bit-mono" and all was well.
>
> Is it possible that the hardware is choking on some parameter you have 
> set? Eg:  I have no deep understanding your line
>
>> sMsg.Format("set %s bitspersample 8", m_sWavName);
>
> but it reminded me of my recent problems.
>
> Dave
> -- 
> David Webber
> Author of 'Mozart the Music Processor'
> http://www.mozart.co.uk
> For discussion/support see
> http://www.mozart.co.uk/mzusers/mailinglist.htm
>
>
> 


0
rvazquez (38)
9/11/2007 3:46:48 PM
"Ricardo Vazquez" <rvazquez@dummy.com> wrote in message 
news:emiW9rI9HHA.464@TK2MSFTNGP02.phx.gbl...

>...
> Anyway, I wanted to ask you:
> If some applications of yours record sound, what API do you use?

I don't record sound.  I use the multimedia midi functions to listen to the 
midi in port (as I'm discussing in a neighbouring thread).  And i play midi 
back.

I use the PlaySound() function to provide a metronome sound while people 
play music in.   For this I recorded the actual "tock" sound of one of those 
old pyramid-shaped clockwork metronomes as nothing else sounds so 
authentic - not even a modern electronic metronome ;-)

Dave
-- 
David Webber
Author of 'Mozart the Music Processor'
http://www.mozart.co.uk
For discussion/support see
http://www.mozart.co.uk/mzusers/mailinglist.htm

0
dave9996 (486)
9/11/2007 4:08:42 PM
From: "Ricardo Vazquez"

> Anyway, I wanted to ask you:
> If some applications of yours record sound, what API do
> you use? What API would you, please, recommend for me to
> use? As you see, what I need to do is pretty simple: to
> record the line-in or the mic, into a low quality wave
> file; nothing more.

Current APIs to record audio are waveIn (in the Windows SDK) 
and DirectSound (in the DirectX SDK), as well as others, 
which will let you receive the audio stream. You will have 
to write the WAV file yourself using your own code (easiest 
way), or you can use the mmio*() functions or the AVIFile*() 
ones or the CWaveFile class in 
"<DXSDK>\Samples\C++\Common\DXUTsound.*" or the CWaveFile 
class on 
<http://www.codeguru.com/Cpp/G-M/multimedia/audio/article.php/c4739>. 
The "<DXSDK>\Samples\C++\DirectSound\CaptureSound" sample 
shows how to capture a WAV using DirectSound and the 
following article explains how: 
<http://msdn2.microsoft.com/en-US/library/bb219826.aspx>.

A higher level API is DirectShow (Windows SDK), which will 
use waveIn and/or DirectSound and create the WAV for you 
(using the WAVDest sample).

Better places to ask are 
<news:microsoft.public.win32.programmer.mmedia> if you use 
waveIn, 
<news:microsoft.public.win32.programmer.directx.audio> if 
you use DirectSound and 
<news:microsoft.public.win32.programmer.directx.video> if 
you use DirectShow.

-- 
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm 


0
9/11/2007 4:16:42 PM
Have checked to ensure that input is not muted?

I don't know much about sound but there are settings that could be 
overlooked.


"Ricardo Vazquez" <rvazquez@dummy.com> wrote in message 
news:%23%23PPWIG9HHA.4200@TK2MSFTNGP04.phx.gbl...
> Hello everybody,
>
> This code using MCI is working fine in many PCs, but one (in which only a 
> long silence is recorded):


0
samuel7119 (33)
9/11/2007 4:28:10 PM
Reply:

Similar Artilces:

Reassign Records
Does the reassign records action reassign ALL records to the new user or only ACTIVE records? I have tried to find some information about this but I see posts that indicate both scenarios. We have some users that are no longer here. Ideally I want to reassign all of their active records (cases, contacts, accounts...) to another user before disabling them but leave their closed records alone. But we still need to be able to see the users old activities like cases when we look up an account or contact. Is this the way it works? Thanks Greg ...

Append only new records/entire record makes unique identifier
Hello,   I have been searching the existing posts for an answer to my issue.  Many have similar suggestions, but none of them quite fit my problem, so I apologize if you feel this is redundant.  Here we go:   The ultimate goal is to append new records (and new records only) to an existing table.  When the query runs to append records which do not already exist in the table, I need the query to compare the entire record in the table to the entire record in the query (as opposed to one field where an unmatched query would be useful).  My reason f...

Select Record in query, save as New Record then edit New Record
Hi, I have a Select Query with a Split Form attached to it. Access 2007. I print out single page Lab Test Certificates that are sent out to Customers. This is done through a Report also attached to the same Query. When you click on a record visible in the bottom of the Split Form, it shows in the fields (test boxes) in the upper portion of the form. The report is created using this active record that is showing in the form. Sometimes the same Certificate (record) is used again and only certain fields need changing to create a new one. I would like to keep the old record ...

Deleting records in Access 2007 Runtime
I run my application in Access 2007 Runtime, but I can not delete any records. How can I delete records in Access 2007 Runtime? How can I make all the menus concerning data manipulation available in Access 2007 Runtime? The runtime is free but stripped-down version of access. The menus are one thing that are not available in the rutime. You will need to build your own menus to use in the runtime. Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia "alex" <alex@discussions.microsoft.com> wrote in message news:16B9B95A-327B-47B3-884D-7AA64D88AB3...

Not able to open associated records
Dear all, I am not able to open associated records in a custom entity. One custom entity is associated with system entity (accounts),when i go to accounts and than opena arecors and than try to open a record of custom entity from there than it wont open(it simply wont double click!!!!!). The problem seems to be with one custom attribute of custom entity.If i remove that attribute from associative view than the records are opening but since i need that attribute to be displayed in associative view, i need to sort it out.Please help. I am having similar issues tying an item to Cases... ...

Midi and MCI
I am using MCI command to play a midi file and I need the program to know when the midi is finished with playing. how do I do it? thx "wanwan" <ericwan78@yahoo.com> ha scritto nel messaggio news:c13162c8-3ef9-46c5-b138-659724ba9f62@a17g2000prm.googlegroups.com... >I am using MCI command to play a midi file and I need the program to > know when the midi is finished with playing. > > how do I do it? You may find interesting this MSDN documentation: Using an Event Callback to Manage Buffered Playback http://msdn.microsoft.com/en-us/library/ms712866.aspx I reca...

Current Record Showing Up
I have 3 tables, Vendor,Departments, & Person. I have a 1 to many relationship between Vendor and Departments, and a 1 to many relationship between Departments & Person. I used the wizard to create a form to input data. ‘Vendor Name’ in the vendor table is a text field, I changed it on the form to a combo box. My thinking is that when I change from one vendor to another the records in both the departments & people table change, but it doesn’t. Can someone tell me what I’m doing wrong? Thanks Your combo box is bound to a field in a record. When you change i...

problem--this employee already has a history record for this date
Hi: To see what I'm seeing, go to the Employee Maintenance window in HR (or Payroll). Change the employee's position code and save. Now, in the "Reason for Change" window that comes up, give a reason. Now, do this again for this same employee on the same day but change him to yet another position code. You will not be able to give that employee a reason using today's date. You will have to change the date to tomorrow's date or some other date in order to give a reason. (This causes a discrepancy in history reporting, if you think about it.) When you try ...

Spin-off recording
using small business 2004 and trying to record a spin-off. I get an error message that the operation can't be completed. "Help" tells me to run the file repair tool which I have done. -both the Quick repair tool and the Standard to no avail. "help" also tells me that there is a download available for the latest version of the "Standard file tool". I can't seem to find this download on microsoft's site after an eshaustive search. Any ideas?? Charley ...

record from table based on record from other table
I'm sure this isn't too hard but it's killing me! If a customer has a pricing level of 1, how do I call pricelevel1 from the products table? This should also be the case if the customer has a price level of 2, then pricelevel2 should be called and a price level of 3 should call pricelevel3. The resulting pricelevel is referred to as UnitPrice. eg UnitPrice:IIf((Customers.PriceLevel)=1, Products.PriceLevel1, IIf(Customers.PriceLevel)=2, Products.PriceLevel2,Products.PriceLevel3)). This is not working in a query. Thanks in advance I think it a metter of brackets, try: UnitPrice:...

VBA problem when recording sound using Sound Recorder (> 4 Gig mem
I jave a VBA application in Word that records sound using Sound recorder. UNFORTUNATELY Sound Recorder does not work correctrly in a machine which has more than 4 Gig of memory http://support.microsoft.com/default.aspx/kb/284893?p=1 Can I test the amount of memory using VBA in Word so that I can give the user an appropriate message? Any assistance very gratefully received, PeterEvans Peter wrote: > Can I test the amount of memory using VBA in Word so that I can give the > user an appropriate message? Absolutely, using the GlobalMemoryStatusEx API. See: http:/...

How can I loop through fields in a known record
Hi my question is this how can I loop through a Known record ( same record every time) and store each field into a variable Somthing like this - (dont use this as it dont work) Dim Deft(i) as variant For i = 1 To 20 Deft(i) = DLookup(Fields(i), "tblSetupLocal", "[SID]=1") Next i So I can manipulate the variables and then send each variable value back to the correct field in the rocord the same way. it would be very helpfull if I could do this. Steve - From a land down under On Thu, 3 Jan 2008 21:07:01 -0800, Steve <Steve@discussions.microsoft.com> wrote: >...

automation of sharing records
Anyone know whether the automation of sharing records in CRM is possible in 1.0? Doesn't look to me like it can be done in Workflow. Would like Account and Lead records to be shared to certain users when record's owner condition is met. Thanks, --d. It can be done with Post-Callouts Mike "Davi" <davida.arnold@datareturn.com> wrote in message news:%23M5qjXZxDHA.3116@tk2msftngp13.phx.gbl... > Anyone know whether the automation of sharing records in CRM is possible in > 1.0? Doesn't look to me like it can be done in Workflow. Would like > Account an...

how do i remove the recorded voicemail
Originally it had a greeting that says my name. However I made a recording of my own voice, and now I want to revert back to the original greeting. How do I do this? I'm guessing that this is not a SharePoint question, so you might have better luck posting this in whatever group this is meant for. -- Daniel A. Galant Imagine what we could be... if we could just imagine. "Suki" <Suki@discussions.microsoft.com> wrote in message news:3ACFDF34-6D54-4CA9-88B9-B68BB7055DB7@microsoft.com... > Originally it had a greeting that says my name. However I made a...

Can't add a record because a record is required in the subform
Hi Folks, In a database of mine I have a form with a few text boxes (first name, last name ...) and some subforms for additional information. When I try and register a new person and have typed in what is required in the form, I move to the first subform. Then Access says that it can't add a new record (in the form, as I understand it) because a record is required in the first subform. Have you any idea what this is and how I fix it? If you have please let me know. Thank you very much in advance. Jo On Jan 25, 4:46 am, Jo Gjessing <JoGjess...@discussions.microsoft.com> wrote: >...

Update on master record when click onto subform of detail
Hello, I am using Access 2000 (my company doesn't believe in upgrades :) ) and using Oracle as a back-end. I have a form with a subform representing a master detail relationship where Attribute table attrib_id, Name, Mandatory, default_ AttributeValues table attribval_id, attrib_id, Value_ These are referenced by a projects table. I won't get into those tables. For attributes which are mandatory I need to allow the user to assign a default. The way I have done this on the form is to place a unbound radio button on each record of subform. Then place a tran...

Show record numbers on subforms
Hi, I have a form consisting of 3 tabbed pages. The 1st tab contains the main form with 2 sub forms on a the other tabs. I am trying to display the record number on all of forms but do not want to use the record navigation buttons. I have used the following code in the On Current event of all 3 forms to do this; If Me.NewRecord Then Me!lblTotal.Caption = "New Record" Else With Me.RecordsetClone .Bookmark = Me.Bookmark Me!lblTotal.Caption = "Record " & _ .AbsolutePosition + 1 _ ...

Copy Record
I have a form with a subform. I want to copy information in the main form (at the top) from a previous record. When I use the wizard to duplicate a record, all I get is a blank record as if I clicked on New Record. The copied record should generate a new ID and the subform should be blank ready to key in new data. Is there something I'm doing wrong or can you not copy a record that has a subform? Thanks! JS ...

sales record and receipts
I have to keep a track of the sales and see if i get the payment. Payment is received according to the invoice numbers. Eg invoice no 1 dated 1/1/2005. payment will be expected after 45 days, say 16/2/2005. so now when i feed in the invoice number i want it to find in the whole list of various invoice numbers the particular invoice no, tally the value, if not true then mention the +/- value.. so how do i do that Take a look at the SUMIF() function. For the plus / minus value, you could return (in a different cell) the amount expected, and subtract the expected amount from the amount rec...

Record count 03-12-08
I have form (master form) and sub form What I want : I want when selecting some record in the subform (text box in the master form display number of records) Notes: There are no related between records so I can't make query or filter "a" <a@a.net> wrote in message news:%23lSQxr0gIHA.5780@TK2MSFTNGP06.phx.gbl... >I have form (master form) and sub form > > What I want : > > I want when selecting some record in the subform (text box in the master > form display number of records) > > Notes: > > There are no related between records so I...

MCI and DirectShow
Hi I am new to multimedia programming. Can anyone plz explain the difference between MCI and DirectShow. When do I have to use each of them? Thank c ...

Can one silence that stupid "Extend Services" reminder?
I know that MS Money is dead, but want to keep using it (at least for while...). What I find most annoying recently is this most superfluous "Extend Services" reminder each time I want to quit Money. I would already find such an intrusive reminder most infuriating even if it were still valid (I might have chosen NOT to renew, why is there no "don't show me this again" checkbox?), but now that the service isn't even extensible, so that reminder is doubly superfluous. How can I get rid of that and silence this annoyance once and for all? M. Just ...

How do I add a record counter to my form
I would like to add my own record counter, like "Record # of #", to my form. How can I do this? Private Sub Form_Load() DoCmd.GoToRecord , , acNext DoCmd.GoToRecord , , acFirst End Sub Private Sub Form_Current() Me.Caption = "Record " & CurrentRecord & " Of " & RecordsetClone.RecordCount & " Records" End Sub This code places the info in the form's title area. To place it in a Label, substitute Me.LableName.Caption for Me.Caption. To place it in a TextBox, substitute Me.TextBoxName.Va...

Record recording
I need help in creating an automatic record form a file to an individual record. Example: You would make a work order for three different employees the first employees work order enter name, date, location, time, cost, and then this information would automatically be recorded to a permanent work sheet record specific to that employee. I have tried to manipulate VLOOKUP for this but to no avail. Any clue or help would be greatly appreciated. -- cdixon ------------------------------------------------------------------------ cdixon's Profile: http://www.excelforum.com/member.php?action=ge...

OK to retain a printer DC?
I've been programming since the days when Device Contexts were a scarce commodity, and you always had to delete them when you'd finished using them, and I still do that. But for reasons that I won't go into, my application needs a printer DC every time I paint. Usually that is not a problem, but one user has recently complained that when he uses a given printer, the application becomes sluggish - it seems that for some reason, getting a CD for his printer is really slow. So, I am now thinking about creating a printer DC at startup and re-using it every time I paint. My...