Re: Get selectRecordInput to show output channels in "input" pop-up
Re: Get selectRecordInput to show output channels in "input" pop-up
- Subject: Re: Get selectRecordInput to show output channels in "input" pop-up
- From: Brad Ford <email@hidden>
- Date: Sun, 4 Dec 2005 18:41:32 -0800
(Cross posting this to the QuickTime API list as well, as WhackedTV
uses Sequence Grabber, which is QuickTime API, not CoreAudio API).
You can't record from "Line Out" because it's an output. CoreAudio
HAL devices can support input only (recording), output only
(playback), or both input and output. Some devices which are
physically one piece of hardware still show up as separate input and
output devices (i.e. USB devices). So you can only record from a
device that supports recording. What you are trying to do would be
akin to plugging a line input into the speaker-out jack on a Mac, and
expecting to be able to record. You can't. That jack only plays
audio out to speakers.
Now if I understand correctly what you are trying to do, you're
trying to play a sound using one program, then loop that in as an
input so you can save it as a file. You can do that. Plug your line
output jack into your line input jack. However, you'll want to turn
off audio preview in sequence grabber (or assign audio preview to a
different output device), otherwise you'll get a feedback loop.
-Brad
On Dec 4, 2005, at 2:19 PM, James Udo Ludtke wrote:
I created a Xcode application that creates sound sequences using
HAL. The programme runs fine with the sound sequences appearing at
the Line Out. I now want to add a feature to save a sound sequence
to a sound file using CoreAudio.
To get familiar with CoreAudio, I have been playing around with
WhackedTV, which works fine.
I can create a sound file with WhackedTV, when my application and
WhackedTV are running at the same time, AND I connect the headphone
jack to Line In jack with a patch cord on my Dual 1.25 GHz G4.
My idea was to get WhackedTV to work from the Line Out, then to
write the code in my application based on portions from WhackedTV.
However, all my efforts to modify WhackedTV to get Line Out into
the Record Settings Line Input popup button ended in failure,
showing my lack of knowledge of CoreAudio. I also noted that when
the single item (Line In) in the input popup button is selected,
the (unmodified) selectRecordInputmethod ends up in the bail
section of the code.
I added some NSLog staments to the selectRecordInput method as
follows:
// ---------------
- (IBAction)selectRecordInput:(id)sender
{
OSStatus err = noErr;
NSArray * list = nil;
NSLog (@"arrived in selectRecordInput"); // <- NSLog
BAILSETERR([mChan getPropertyWithClass:
kQTPropertyClass_SGAudioRecordDevice
id:
kQTSGAudioPropertyID_OutputListWithAttributes
size: sizeof(list)
address: &list
sizeUsed: NULL]);
if (list)
{
NSDictionary * selDict = [list objectAtIndex:[sender
indexOfSelectedItem]];
UInt32 newSel =
[(NSNumber*)[selDict objectForKey:(id)
kQTAudioDeviceAttribute_DeviceInputID]
unsignedIntValue];
BAILSETERR(
[self setSGAudioPropertyWithClass:
kQTPropertyClass_SGAudioRecordDevice
id:
kQTSGAudioPropertyID_InputSelection
size: sizeof(newSel)
address: &newSel] ); //
this is line 556 referenced in ERR message
}
bail:
NSLog (@"arrived in selectRecordInput - bail:"); // <- NSLog
[list release];
return;
}
// ---------------
When I select the only input item in the "Line In" popup button, I
get the following log output:
[Session started at 2005-11-28 00:55:08 -0500.]
2005-11-28 00:55:22.487 WhackedTV[1106] arrived in selectRecordInput
SGAudioSettings.mm:556:-[SGAudioSettings selectRecordInput:] ###
Err -2195
2005-11-28 00:55:22.488 WhackedTV[1106] arrived in
selectRecordInput - bail:
Is this intentional considering that there are really no options on
the Line In popup button, or is this a bug.
Any hints how to code other source option onto the Line Input popup
button in WhackedTV would be appreciated.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden