Thread View: comp.sys.next.programmer
2 messages
2 total messages
Started by joemann
Mon, 02 Nov 1992 17:22
(failing to) read Audio Data from CDROM
Author: joemann
Date: Mon, 02 Nov 1992 17:22
Date: Mon, 02 Nov 1992 17:22
51 lines
2555 bytes
2555 bytes
After installing 3.0 on all our machines the CD-ROM drive wasn't used too much
anymore. And to prevent it from being misused by installing NT on PCs (argh!) I
thought it could be a good idea to play back audio CDs. But unfortunately we
don't have an amplifier and speakers here, so I tried to read the data directly
off the CD and play it using the DSP. I wrote the following program which
constantly failed working when I inserted audio CDs. However, it works fine
with data CDs although the "music" isn't too enjoyable...
struct timeval tv;
struct esense_reply esense;
int fd,err,length=10,firstBlock=1024;
SNDSoundStruct *snd;
char *buf;
fd=open("/dev/rsd1h",O_RDONLY,0);
SNDAlloc(&snd,length*2048,SND_FORMAT_LINEAR_16,SND_RATE_HIGH,2,0);
buf=(char *)snd+snd->dataLocation;
bzero(buf,length*2048);
err=do_read2(fd,firstBlock,length,buf,&tv,&esense);
SNDStartPlaying(snd,1,2,NO,SND_NULL_FUN,SND_NULL_FUN);
do_read2 is a modification of the do_read function in
/NextDeveloper/Examples/UNIX/SCSI_CD/scsi_commands.c. I replaced the following
lines to really read the data into a buffer:
sr.sr_addr = buf;
sr.sr_dma_max = 256;
sr.sr_ioto = 5;
sr.sr_dma_dir = SR_DMA_RD;
The following messages showed up in the Console window:
sd1 (6,0): ERROR op:0x8 sd_state:4 scsi status:0x0
sd1 (6,0): sense key:0x5 additional sense code:0x64
SCSI Block in error = 1024 (no valid label)
Is this due to the fact that (a) the disk doesn't have a label (I thought those
"live" partitions were introduced for such cases) or (b) "something" in the
CD-ROM drive ensures that no digital copies of audio CDs can be made?
Erik Doernenburg
___________________________________________________________________
AMG Industrie Consulting GmbH (NeXT mail) erik@amg.de
Universitaet Dortmund knight06@pandora.informatik.uni-dortmund.de
--
Johannes 5 Joemann
Wissenschaftsladen Dortmund, Lindemannstr.84, D(W)-4600 Dortmund 1
Tel. 0231-104002 (ggf. Anrufbeantworter)
WILADO@DOO.ZER, joemann@anarch.do.open.de
Re: (failing to) read Audio Data from CDROM
Author: Sean Lamont
Date: Tue, 03 Nov 1992 08:12
Date: Tue, 03 Nov 1992 08:12
21 lines
1494 bytes
1494 bytes
In article <1992Nov2.172257.14250@anarch.do.open.de> erik@amg.de writes: > >constantly failed working when I inserted audio CDs. However, it works fine >with data CDs although the "music" isn't too enjoyable... There is a fundamental problem with your entire strategy. CD disks are built with an encoding written onto the disk which specifies whether you can read data off the disk in digital format or not. on CD-rom disks are obviously set to "true", with audio CDs having the bit set to "false" The implementor of the drive, of course, is free to ignore this specification. However, the only one I've heard of that does is the one shipped by SGI. -- Sean T. Lamont | "Don't oppress me, It's zeno@genetics.washington.edu | 'computer of color!' " lamont@abstractsoft.com |_______________________________ Abstract Software
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads