BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Using Soundcard

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Multimedia
View previous topic :: View next topic  
Author Message
Dennis
Guest





PostPosted: Tue May 18, 2004 1:41 pm    Post subject: Using Soundcard Reply with quote



Hi

How do I read from the Soundcard on my Asus board (P4P800)?

I want to use it with a microphone and make an application in Delphi to
manipulate the signal and then output in on the speakers again.

Regards
Dennis




Back to top
Vincent
Guest





PostPosted: Sat Jul 03, 2004 8:27 am    Post subject: Re: Using Soundcard Reply with quote




"Dennis" <marianndkc (AT) home3 (DOT) gvdnet.dk> wrote:
Quote:
Hi

How do I read from the Soundcard on my Asus board (P4P800)?

I want to use it with a microphone and make an application in Delphi to
manipulate the signal and then output in on the speakers again.

Regards
Dennis





Hi Dennis,

This is a typical code for recording wave input in array "tab":

var
Form1: TForm1;
mot:string;
a,b,c,d,e,f,co: longint;
er,calh,calb:integer;
eb: byte;
tab:array[1..5000000]of Smallint;
waveconf: Twaveformatex;
bufconf: Twavehdr;


with waveconf do
begin
WFormatTag := WAVE_FORMAT_PCM; {PCM format - the only option!}
NChannels:=1; {mono}
NSamplesPerSec:=44100; {sampling}
NAvgBytesPerSec:=88200;
NBlockAlign:=2;
wBitsPerSample:=16;
cbSize:=0;
end;

with bufconf do
begin
lpdata:=@tab;
dwbufferlength:=sizeof(tab);
dwbytesrecorded:=0;
dwUser:=0;
dwflags:=0;
dwloops:=0;
end;

res:=waveInOpen(@hwi,WAVE_MAPPER,@waveconf,0,0,WAVE_ALLOWSYNC);test;
res:=waveInPrepareHeader(hwi,@bufconf,sizeof(wavehdr));test;
res:=waveInAddBuffer(hwi,@bufconf,sizeof(wavehdr));test;
res:=waveInStart(hwi);test;waveinstop(hwi);

res:=waveInUnprepareHeader(hwi,@bufconf,sizeof(wavehdr));test;
res:=waveInPrepareHeader(hwi,@bufconf,sizeof(wavehdr));test;
res:=waveInAddBuffer(hwi,@bufconf,sizeof(wavehdr));test;
res:=waveInStart(hwi);test;

repeat until bufconf.dwBytesRecorded=sizeof(tab);
waveInstop(hwi);


Back to top
Alain N.S
Guest





PostPosted: Wed Jul 07, 2004 12:16 pm    Post subject: Re: Using Soundcard Reply with quote



Hello, Vincent

It seems that you are familiar in working with soundcard.
I need some help, and I hope you can help me.
I heard that using direct sound can be more efficient in reading from or
playing sound to a soundcard.
Is this true?
What are the advantages and the disadvantage of using direct sound?
Is the code you below using direct sound? (If I'm not mistaken the code
below is not using direct sound. Am I right?)
So...., could you tell me how to record sound using direct sound?

Thanks.
Alain

"Vincent" <vchavanne (AT) libertysurf (DOT) fr> wrote

Quote:

"Dennis" <marianndkc (AT) home3 (DOT) gvdnet.dk> wrote:
Hi

How do I read from the Soundcard on my Asus board (P4P800)?

I want to use it with a microphone and make an application in Delphi to
manipulate the signal and then output in on the speakers again.

Regards
Dennis





Hi Dennis,

This is a typical code for recording wave input in array "tab":

var
Form1: TForm1;
mot:string;
a,b,c,d,e,f,co: longint;
er,calh,calb:integer;
eb: byte;
tab:array[1..5000000]of Smallint;
waveconf: Twaveformatex;
bufconf: Twavehdr;


with waveconf do
begin
WFormatTag := WAVE_FORMAT_PCM; {PCM format - the only option!}
NChannels:=1; {mono}
NSamplesPerSec:=44100; {sampling}
NAvgBytesPerSec:=88200;
NBlockAlign:=2;
wBitsPerSample:=16;
cbSize:=0;
end;

with bufconf do
begin
lpdata:=@tab;
dwbufferlength:=sizeof(tab);
dwbytesrecorded:=0;
dwUser:=0;
dwflags:=0;
dwloops:=0;
end;

res:=waveInOpen(@hwi,WAVE_MAPPER,@waveconf,0,0,WAVE_ALLOWSYNC);test;
res:=waveInPrepareHeader(hwi,@bufconf,sizeof(wavehdr));test;
res:=waveInAddBuffer(hwi,@bufconf,sizeof(wavehdr));test;
res:=waveInStart(hwi);test;waveinstop(hwi);

res:=waveInUnprepareHeader(hwi,@bufconf,sizeof(wavehdr));test;
res:=waveInPrepareHeader(hwi,@bufconf,sizeof(wavehdr));test;
res:=waveInAddBuffer(hwi,@bufconf,sizeof(wavehdr));test;
res:=waveInStart(hwi);test;

repeat until bufconf.dwBytesRecorded=sizeof(tab);
waveInstop(hwi);




Back to top
Robby Tanner
Guest





PostPosted: Wed Nov 10, 2004 4:17 pm    Post subject: Re: Using Soundcard Reply with quote

Would it be simpler to use MCI? I'm not sure how all these different
mechanisms differ. Is there someplace I can read up on them and compare?

Rob


"Vincent" <vchavanne (AT) libertysurf (DOT) fr> wrote

Quote:

"Dennis" <marianndkc (AT) home3 (DOT) gvdnet.dk> wrote:
Hi

How do I read from the Soundcard on my Asus board (P4P800)?

I want to use it with a microphone and make an application in Delphi to
manipulate the signal and then output in on the speakers again.

Regards
Dennis





Hi Dennis,

This is a typical code for recording wave input in array "tab":

var
Form1: TForm1;
mot:string;
a,b,c,d,e,f,co: longint;
er,calh,calb:integer;
eb: byte;
tab:array[1..5000000]of Smallint;
waveconf: Twaveformatex;
bufconf: Twavehdr;


with waveconf do
begin
WFormatTag := WAVE_FORMAT_PCM; {PCM format - the only option!}
NChannels:=1; {mono}
NSamplesPerSec:=44100; {sampling}
NAvgBytesPerSec:=88200;
NBlockAlign:=2;
wBitsPerSample:=16;
cbSize:=0;
end;

with bufconf do
begin
lpdata:=@tab;
dwbufferlength:=sizeof(tab);
dwbytesrecorded:=0;
dwUser:=0;
dwflags:=0;
dwloops:=0;
end;

res:=waveInOpen(@hwi,WAVE_MAPPER,@waveconf,0,0,WAVE_ALLOWSYNC);test;
res:=waveInPrepareHeader(hwi,@bufconf,sizeof(wavehdr));test;
res:=waveInAddBuffer(hwi,@bufconf,sizeof(wavehdr));test;
res:=waveInStart(hwi);test;waveinstop(hwi);

res:=waveInUnprepareHeader(hwi,@bufconf,sizeof(wavehdr));test;
res:=waveInPrepareHeader(hwi,@bufconf,sizeof(wavehdr));test;
res:=waveInAddBuffer(hwi,@bufconf,sizeof(wavehdr));test;
res:=waveInStart(hwi);test;

repeat until bufconf.dwBytesRecorded=sizeof(tab);
waveInstop(hwi);




Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.