🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #889

Re: Simultaneous Sound Recording & Playback via builtin mic

#889
From: jolly
Date: Sat, 29 Aug 1992 17:20
64 lines
2515 bytes
In article <1992Aug20.072214.22387@morrow.stanford.edu> hinds@cmgm.Stanford  
(Alexander Scott Hinds) writes:
> Hi-
> 
> 	I'd like to write a program that would play back the sound being  
> digitized by the builtin mic at the same time as the digitization (a  
> slight delay would be acceptable).  Is this possible?  If so, how??  Note,  
> I'm no DSP whiz (and don't really want to be, either), so any sample code  
> would be QUITE appreciated.  Thanks in advance!
> 
> --X


Hiho and a bottle rum B)

I can t mail to Scott B( So i have to use this device for replying.

There is the possibility to record and playback sound at the same time.

How to build an example :
Take the NeXTDeveloper/Examples/Sound/recordchaintest.c and paste
 the following
*********************************************---- ( copied from playtest.c)
play(int none)
{
    int size, err, i=1000;
    SNDSoundStruct *s;
    
    //
    // read each soundfile and queue it up for playing. The termination
    // function will free the sound
    //
    {
	err = SNDReadSoundfile(SNDFILE,&s);
	if (err)
	    fprintf(stderr,"playtest : Cannot read soundfile\n");
	else {
	    err = SNDStartPlaying(s,i,0,0,0,(SNDNotificationFun)SNDFree);
	    if (err)
		fprintf(stderr,"playtest : Cannot play soundfile \n");
	}
    }
    //
    // wait for the sounds to finish
    // Note that a tag of 0 means 'wait for all'
    //
    SNDWait(i);

    cthread_exit(0);
}
***********************************************

define the following:
#define SECONDS 20.0 // more time to see that it works B)
#define SNDFILE "your soundfile.snd"

and insert the following line in the main()
	cthread_detach(cthread_fork((cthread_fn_t)play,(any_t)0));


But I have problems in recoding and playing sounds under the NeXTStep  
Environment.It works a while ( btw. 0- 60 Seconds ), but then I get a " Can t  
require hardware resources ".
 			                                Jolly  B)
Technical Details
Message-ID: <1992Aug29.172013.12663@news.lrz-muenchen.de>
Path: arc1-ca.pugleaf.net!sparky!uunet!math.fu-berlin.de!informatik.tu-muenchen.de!LRZnews!news
References: <1992Aug20.072214.22387@morrow.stanford.edu>

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!math.fu-berlin.de!informatik.tu-muenchen.de!LRZnews!news
From: jolly@next2.cis.uni-muenchen.de ()
Subject: Re: Simultaneous Sound Recording & Playback via builtin mic
Message-ID: <1992Aug29.172013.12663@news.lrz-muenchen.de>
Keywords: Sound DSP
Sender: news@news.lrz-muenchen.de (Mr. News)
Organization: Leibniz-Rechenzentrum, Muenchen (Germany)
References: <1992Aug20.072214.22387@morrow.stanford.edu>
Date: Sat, 29 Aug 1992 17:20:13 GMT
Lines: 67