home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / next / programm / 5860 < prev    next >
Encoding:
Text File  |  1992-08-29  |  2.4 KB  |  80 lines

  1. Newsgroups: comp.sys.next.programmer
  2. Path: sparky!uunet!math.fu-berlin.de!informatik.tu-muenchen.de!LRZnews!news
  3. From: jolly@next2.cis.uni-muenchen.de ()
  4. Subject: Re: Simultaneous Sound Recording & Playback via builtin mic
  5. Message-ID: <1992Aug29.172013.12663@news.lrz-muenchen.de>
  6. Keywords: Sound DSP
  7. Sender: news@news.lrz-muenchen.de (Mr. News)
  8. Organization: Leibniz-Rechenzentrum, Muenchen (Germany)
  9. References: <1992Aug20.072214.22387@morrow.stanford.edu>
  10. Date: Sat, 29 Aug 1992 17:20:13 GMT
  11. Lines: 67
  12.  
  13. In article <1992Aug20.072214.22387@morrow.stanford.edu> hinds@cmgm.Stanford  
  14. (Alexander Scott Hinds) writes:
  15. > Hi-
  16. >     I'd like to write a program that would play back the sound being  
  17. > digitized by the builtin mic at the same time as the digitization (a  
  18. > slight delay would be acceptable).  Is this possible?  If so, how??  Note,  
  19. > I'm no DSP whiz (and don't really want to be, either), so any sample code  
  20. > would be QUITE appreciated.  Thanks in advance!
  21. > --X
  22.  
  23.  
  24. Hiho and a bottle rum B)
  25.  
  26. I can t mail to Scott B( So i have to use this device for replying.
  27.  
  28. There is the possibility to record and playback sound at the same time.
  29.  
  30. How to build an example :
  31. Take the NeXTDeveloper/Examples/Sound/recordchaintest.c and paste
  32.  the following
  33. *********************************************---- ( copied from playtest.c)
  34. play(int none)
  35. {
  36.     int size, err, i=1000;
  37.     SNDSoundStruct *s;
  38.     
  39.     //
  40.     // read each soundfile and queue it up for playing. The termination
  41.     // function will free the sound
  42.     //
  43.     {
  44.     err = SNDReadSoundfile(SNDFILE,&s);
  45.     if (err)
  46.         fprintf(stderr,"playtest : Cannot read soundfile\n");
  47.     else {
  48.         err = SNDStartPlaying(s,i,0,0,0,(SNDNotificationFun)SNDFree);
  49.         if (err)
  50.         fprintf(stderr,"playtest : Cannot play soundfile \n");
  51.     }
  52.     }
  53.     //
  54.     // wait for the sounds to finish
  55.     // Note that a tag of 0 means 'wait for all'
  56.     //
  57.     SNDWait(i);
  58.  
  59.     cthread_exit(0);
  60. }
  61. ***********************************************
  62.  
  63. define the following:
  64. #define SECONDS 20.0 // more time to see that it works B)
  65. #define SNDFILE "your soundfile.snd"
  66.  
  67. and insert the following line in the main()
  68.     cthread_detach(cthread_fork((cthread_fn_t)play,(any_t)0));
  69.  
  70.  
  71. But I have problems in recoding and playing sounds under the NeXTStep  
  72. Environment.It works a while ( btw. 0- 60 Seconds ), but then I get a " Can t  
  73. require hardware resources ".
  74.                                              Jolly  B)
  75.  
  76.  
  77.  
  78.