Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Gael
15
Years of Service
User Offline
Joined: 27th Sep 2010
Location: Athens .
Posted: 19th Oct 2010 17:31
Hello
I've been messing around with mci lately,using the "call dll" commang after loading "winmm.dll"
Heres my predicament
There are several ways to call an Mci function


The issue (mine):
ive typed this code to record sound and save it


the above will record anything you hear(if thats your device setting) , and save it on a wave file , once you hit space.

that does not differ from the DB command record sound.

When it comes to altering the sound quality though
the program either crashes -when mciSendStringW is used
or the output file cant be played after its saved-when mciExecute is used

Here is the setting_sound_quality_so_excited calls.

A have a suspicion that im not saving the parameters correctly , so the my_fault might be , that i need to pass integers and not string to the mci
If you have an idea on what im missing , id like to hear
Thanks
(second coffee)


Gael
15
Years of Service
User Offline
Joined: 27th Sep 2010
Location: Athens .
Posted: 19th Oct 2010 20:08
Okay fixed it.
Apparently
A.i had to follow this order in setting the quality
(1) Format tag
(2) Bits Per Sample
(3) Channels
(4) Alignment
(5) SampleRate
(6) BytesPerSecond
B.to set the quality , save , open , and record using the same command.-if opened with <mciExecute> do everything with this command etc...

C.in order to utilize the MCI send string command (for any use)
,the syntax you should follow is this.


i managed to record at high quality using this quatro of commands


the above its displayed as a command referense .
The actual result of this code would be ... exiting
enjoy .
^3


Gael
15
Years of Service
User Offline
Joined: 27th Sep 2010
Location: Athens .
Posted: 19th Oct 2010 20:10
Heres some .wav documentation as well

https://ccrma.stanford.edu/courses/422/projects/WaveFormat/


Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 19th Oct 2010 23:04
Hello Gael,

Is there any way to grab the byte data as it's being recorded and save it to a memory buffer so that something like a frequency vu meter could be made in real time?

Do your demos record from any source? Say, a cd is playing or maybe a sound file in DB. The goal would be to capture this audio, send it to a buffer and use the bytes to create the meter in real time.

Enjoy your day.
Gael
15
Years of Service
User Offline
Joined: 27th Sep 2010
Location: Athens .
Posted: 22nd Oct 2010 16:43
Latch Hello .

Im working on arming MCI on dark basic completely.
There are several issues though.
For instance.At this moment im coding around , simply returning the position of the record.The command freezes DarkBasic compiler , which (from past MCI headaches ) translates to "Passing Variables or requesting them , the wrong way , or the wrong type"
errors 261,264,292 occur.meaning , out of memory(?) cant recognize command , cant recognize deviceID.
Heres how i attempt to get a value returned from MCI





Gael
15
Years of Service
User Offline
Joined: 27th Sep 2010
Location: Athens .
Posted: 22nd Oct 2010 19:10
The following gets return values from mci
Create a C:\test.wav .
@ latch : your required data extraction includes changing "position" to "level".
Latest issue "level" doesnt respond . !So far






Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 22nd Oct 2010 19:52 Edited at: 22nd Oct 2010 19:55
@Gael

Thanks for your work on this.

I did a little bit of MCI work a while ago. Maybe this link contains some helpful information: Audio Dll

Has the copy command been successful for you with audio? If it has, that sounds like it might be a way to get that information. And if the copy range can be limited to TO and FROM positions, then the sampled section size can be controlled - maybe making it easier to do the frequency analysis.

There's a buffer that's manually or automatically created when Open is called. I think chunks of data are stored here before being sent to disk. I wonder if there is some way to access this. I haven't been able to find any info on this.

Enjoy your day.
Gael
15
Years of Service
User Offline
Joined: 27th Sep 2010
Location: Athens .
Posted: 22nd Oct 2010 20:10 Edited at: 22nd Oct 2010 20:13
@Latch , found it
.The remaining issue(-god-bless-you-microsofts-easy-to-understand-not-documentation-if-it-exists) is that
a.need to set the input on the file.
0 for the currently selected playback device
1 for the second sound device
2 and last the microsoft mapper
b.when you set the input , you hear nothing , but you can see the
signal
c.if you dont set the input you can hear the sound but mci returns error 322 which translatest to "device in use"



forgot this
couldnt find any info either.
many people have been tortured by mci "complexity"
Another issue . I think mci was up to winXP .They've replaced it
if im not misinformed.


Login to post a reply

Server time is: 2026-07-22 03:51:43
Your offset time is: 2026-07-22 03:51:43