flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > 'com_invoke' macro

Author
Thread Post new topic Reply to topic
ManOfSteel



Joined: 02 Feb 2005
Posts: 1154
ManOfSteel 23 Apr 2007, 06:13
Hello,

I've got this MASM program and a "com_invoke" macro is used in important parts for calling DirectSound API as you can notice.

It is used like that:
Code:
com_invoke IDirectSound, SetCooperativeLevel, pDS, hWnd, DSSCL_NORMAL
...
com_invoke IDirectSound, CreateSoundBuffer, pDS, ADDR desc, ADDR pDSB, 0
...
com_invoke IDirectSoundBuffer, Stop, pDSB
    


According to some comments, it seems to be a "macro to call COM functions given a struct of function ptr's."

So, does anyone know what this "com_invoke" macro MAY really do, because it's not very helpful like that?

thanks in advance for your replies.
Post 23 Apr 2007, 06:13
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 23 Apr 2007, 08:14
see "INCLUDE/COM32" in FASM directory
Post 23 Apr 2007, 08:14
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
farrier



Joined: 26 Aug 2004
Posts: 274
Location: North Central Mississippi
farrier 24 Apr 2007, 09:15
ManOfSteel,

Attached is a RadASM project using DirectSound to record from an iMic USB sound card, write to a .wav file, and then play back the recorded sound from the DirectSound buffer. It just records 8 seconds, but should show you how things work. It uses an include file from a package madmatt provided, link is inlcuded. Thanks madmatt!!!

If I get time, I plan to modify the program to record continuously and then as the sound is recorded, convert to mp3 using LAME.

hth,

farrier


Description:
Download
Filename: DSRecord.zip
Filesize: 5.47 KB
Downloaded: 485 Time(s)


_________________
Some Assembly Required
It's a good day to code!
U.S.Constitution; Bill of Rights; Amendment 1:
... the right of the people peaceably to assemble, ...
The code is dark, and full of errors!
Post 24 Apr 2007, 09:15
View user's profile Send private message Reply with quote
ManOfSteel



Joined: 02 Feb 2005
Posts: 1154
ManOfSteel 26 Apr 2007, 09:51
vid,
thanks, I didn't even know such thing existed in FASM. I guess I'll have to re-read the manual.

farrier,
thanks for sharing. I'll check it out as soon as I can.
Why did you say it was for recording from a "iMic USB sound card"? Does it work for other cards?
Post 26 Apr 2007, 09:51
View user's profile Send private message Reply with quote
farrier



Joined: 26 Aug 2004
Posts: 274
Location: North Central Mississippi
farrier 26 Apr 2007, 16:56
ManOfSteel,

The code I included let me choose the iMic as the Capture device on my notebook system, which has no Line-In. Otherwise, the default sound card is used. If you use my code "as-is", it should use your default device.

Also, change the size of the capture buffer size as follows:
Code:
    mov     [dscbd.dwBufferBytes], 1764000          ;= WaveEx.nAvgBytesPerSec * 10
    


I found an occasional problem trying to record 8 "sleep" seconds of data in an 8 second buffer. Sometimes, it "slept" to long, and recorded too much.

hth,

farrier

_________________
Some Assembly Required
It's a good day to code!
U.S.Constitution; Bill of Rights; Amendment 1:
... the right of the people peaceably to assemble, ...
The code is dark, and full of errors!
Post 26 Apr 2007, 16:56
View user's profile Send private message Reply with quote
ManOfSteel



Joined: 02 Feb 2005
Posts: 1154
ManOfSteel 27 Apr 2007, 07:54
Hello,
and thanks again.
Could you upload the DirectX include files that are needed for audio processing (those you have in "\Program Files\fasm\include\directx\")? I can't find them anywhere.
Do they also contain the interfaces identifiers (or whatever they are called?)
Post 27 Apr 2007, 07:54
View user's profile Send private message Reply with quote
farrier



Joined: 26 Aug 2004
Posts: 274
Location: North Central Mississippi
farrier 27 Apr 2007, 13:48
ManOfSteel,

The link to madmatt's DirectX includes is in this source code, on the same lines where the .inc file is "included"

farrier

_________________
Some Assembly Required
It's a good day to code!
U.S.Constitution; Bill of Rights; Amendment 1:
... the right of the people peaceably to assemble, ...
The code is dark, and full of errors!
Post 27 Apr 2007, 13:48
View user's profile Send private message Reply with quote
ManOfSteel



Joined: 02 Feb 2005
Posts: 1154
ManOfSteel 28 Apr 2007, 07:40
oops, sorry, there are so many tabs before the link that it was off-screen and I missed it. Embarassed
Post 28 Apr 2007, 07:40
View user's profile Send private message Reply with quote
farrier



Joined: 26 Aug 2004
Posts: 274
Location: North Central Mississippi
farrier 28 Apr 2007, 08:03
Here is part 2 of my project:

This one again records 8 seconds of sound using DirectSound, then writes that data to a .wav file, then converts the raw data into an MP3 file using LAME. I used the lame_enc.dll file obtained from:

http://rarewares.org/mp3.html

Main LAME site:

www.mp3dev.org

Seems to work pretty well. After I play with the quality settings, I plan to do continuous recording with DirectSound, and then continuous recording and streaming conversion to MP3

Fun so far!

farrier


Description:
Download
Filename: DSRecConv.zip
Filesize: 9.98 KB
Downloaded: 455 Time(s)


_________________
Some Assembly Required
It's a good day to code!
U.S.Constitution; Bill of Rights; Amendment 1:
... the right of the people peaceably to assemble, ...
The code is dark, and full of errors!
Post 28 Apr 2007, 08:03
View user's profile Send private message Reply with quote
ManOfSteel



Joined: 02 Feb 2005
Posts: 1154
ManOfSteel 29 Apr 2007, 05:37
Very nice. Keep up with the good work!
Post 29 Apr 2007, 05:37
View user's profile Send private message Reply with quote
farrier



Joined: 26 Aug 2004
Posts: 274
Location: North Central Mississippi
farrier 09 May 2007, 01:11
Here is the next version, will record continuously to a wav file from a default--or in my case an external USB sound card--until a user set--in .inc file--number of milliseconds expires. Next step, acquire PCM data and immediately convert this stream to an mp3 file, bypassing .wav file entirely.

farrier


Description:
Download
Filename: DSRecCont.zip
Filesize: 7.31 KB
Downloaded: 471 Time(s)


_________________
Some Assembly Required
It's a good day to code!
U.S.Constitution; Bill of Rights; Amendment 1:
... the right of the people peaceably to assemble, ...
The code is dark, and full of errors!
Post 09 May 2007, 01:11
View user's profile Send private message Reply with quote
ManOfSteel



Joined: 02 Feb 2005
Posts: 1154
ManOfSteel 13 May 2007, 17:32
It's getting very good. Thanks for sharing. If it was just a little more user friendly (record/play control buttons and the like) you would be competing with some commercial recording utilities.
And by the way, I like the icon!
Post 13 May 2007, 17:32
View user's profile Send private message Reply with quote
dead_body



Joined: 21 Sep 2005
Posts: 187
Location: Ukraine,Kharkov
dead_body 13 May 2007, 20:54
hm... "enum" - is macro?

"ENUM DSFX_I3DL2_MATERIAL_PRESET_SINGLEWINDOW,\
..."

in dsound.inc

where I can find enum macro?
Post 13 May 2007, 20:54
View user's profile Send private message Reply with quote
farrier



Joined: 26 Aug 2004
Posts: 274
Location: North Central Mississippi
farrier 14 May 2007, 16:59

_________________
Some Assembly Required
It's a good day to code!
U.S.Constitution; Bill of Rights; Amendment 1:
... the right of the people peaceably to assemble, ...
The code is dark, and full of errors!
Post 14 May 2007, 16:59
View user's profile Send private message Reply with quote
xiaolaba



Joined: 31 Jan 2015
Posts: 15
xiaolaba 31 Oct 2023, 04:16
hello,

this is not active link for the download following, anyone could help please share if you have copy cached. thanks.

;include 'dsound.inc' ;get from madmatt's post in:

https://board.flatassembler.net/topic.php?t=3911

https://board.flatassembler.net/topic.php?t=3662
Post 31 Oct 2023, 04:16
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20451
Location: In your JS exploiting you and your system
revolution 31 Oct 2023, 09:18
I might have it.
Code:
~ zipinfo FASMW64_from.madmatt.zip | grep -i dsound
-rw-a--     2.0 fat  1320208 b- defN 99-Sep-09 06:00 FASMW64/DLL/dsound3d.dll
-rw-a--     2.0 fat    30363 t- defN 12-Jan-13 12:02 FASMW64/V7INCLUDE32/EQUATES/DIRECTX/DSOUND8.INC
-rw-a--     2.0 fat      226 t- defN 08-Aug-29 11:20 FASMW64/V7INCLUDE32/PCOUNT/DIRECTX/DSOUND.INC
-rw-a--     2.0 fat      559 t- defN 05-Oct-15 14:15 FASMW64/V7INCLUDE32/VAPIA/DIRECTX/DSOUND.INC
-rw-a--     2.0 fat      562 t- defN 05-Oct-15 14:08 FASMW64/V7INCLUDE32/VAPIA/DIRECTX/DSOUND8.INC
-rw-a--     2.0 fat      559 t- defN 07-Sep-14 18:52 FASMW64/V7INCLUDE32/VAPIW/DIRECTX/DSOUND8.INC
-rw-a--     2.0 fat      562 t- defN 05-Oct-15 14:08 FASMW64/V7INCLUDE64/APIA/DIRECTX/DSOUND8.INC
-rw-a--     2.0 fat      559 t- defN 07-Sep-14 18:52 FASMW64/V7INCLUDE64/APIW/DIRECTX/DSOUND8.INC
-rw-a--     2.0 fat    30275 t- defN 12-Jan-19 09:03 FASMW64/V7INCLUDE64/EQUATES/DIRECTX/DSOUND8.INC
-rw-a--     2.0 fat      226 t- defN 08-Aug-29 11:20 FASMW64/V7INCLUDE64/PCOUNT/DIRECTX/DSOUND.INC    
Is that what you are looking for?
Post 31 Oct 2023, 09:18
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4073
Location: vpcmpistri
bitRAKE 31 Oct 2023, 13:26
https://app.box.com/s/jeik2wmv8r4rqyb2h0dprc3e9gtsdult

... is the lastest copy of Matt's work I have online.
Post 31 Oct 2023, 13:26
View user's profile Send private message Visit poster's website Reply with quote
xiaolaba



Joined: 31 Jan 2015
Posts: 15
xiaolaba 01 Nov 2023, 07:16
revolution wrote:
I might have it.[code]~ zipinfo FASMW64_from.madmatt.zip | grep -i dsound
-rw-a-- ?


hi, we would like to build and test the farrier's codes to learn something new for our case, so there is no explicit or sure what is looking for exactly. Try on those .inc will be good attempts anyway.

_________________
best regards,
xiao
Post 01 Nov 2023, 07:16
View user's profile Send private message Visit poster's website Reply with quote
xiaolaba



Joined: 31 Jan 2015
Posts: 15
xiaolaba 01 Nov 2023, 07:18
bitRAKE wrote:
https://app.box.com/s/jeik2wmv8r4rqyb2h0dprc3e9gtsdult

... is the lastest copy of Matt's work I have online.


give you a salute

_________________
best regards,
xiao
Post 01 Nov 2023, 07:18
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.