Thread View: comp.sys.next.programmer
1 messages
1 total messages
Started by Lo Shih
Sat, 19 Dec 1992 04:10
recording from DSP problems
Author: Lo Shih
Date: Sat, 19 Dec 1992 04:10
Date: Sat, 19 Dec 1992 04:10
78 lines
2550 bytes
2550 bytes
We are building a Sound App and we're having problems recording
from the DSP. We're using a MetaResearch Digital Ears to sample
our sound into the Next standard Sound structure.
We know that the Digital Ears works because we can issue a "sndrecord -d"
command from the terminal with success.
We're setting the data format of our Sound to SND_FORMAT_DSP_DATA_16
when recording and changing the data format to SND_FORMAT_LINEAR_16
when playing (which is recommended by the GeneralRef/AppKit docs).
We know that we've filled the Sound struct with some data. We get a
logical value for duration sampleCount and dataSize.
However, when we send the sound a play message, nothing is played
and an error code "18" is returned. We put some of our code at the
end of this article.
Please help us if you can.
- Lo Shih
- Chris Miller
our code:
- record:sender
{
/*
* If ready, initialize the sound struct and record
*/
if ([theSound status] == NX_SoundStopped) {
[self setSoundSize];
sndError = [theSound record];
[self printError];
}
return self;
}
- setSoundSize
{
/*
* if the NXRadio is on MIC then record from microphone
* otherwise record from the DSP
*/
if ([micRadio state]) {
[theSound setDataSize:(int)9000000
dataFormat:(int)SND_FORMAT_MULAW_8
samplingRate:(int)SND_RATE_CODEC
channelCount:(int)1
infoSize:(int)4];
}
else {
[theSound setDataSize:(int)9000000
dataFormat:(int)SND_FORMAT_DSP_DATA_16
samplingRate:(int)SND_RATE_HIGH
channelCount:(int)2
infoSize:(int)4];
}
}
- play:sender
{
if (([theSound status] == NX_SoundStopped) ||
([theSound status] == NX_SoundPlayingPaused)) {
if (![theSound isPlayable]) {
[theSound convertToFormat:(int)SND_FORMAT_LINEAR_16];
}
sndError = [theSound play];
[self printError];
}
return self;
}
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