Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: VDIG and sound



Hello All,
I have a VDIG that does video capture (this part seems to work)
but no sound. Not surprisingly, SGNewChannel(,SoundMediaType,)
on my component returns -9405 (couldntGetRequiredComponent).


Hello Slava...some thoughts,

I'm not sure if you're doing this but you don't call SGNewChannel with an instance of your VDig component, you call it with an instance of a SeqGrabComponent.

If your VDig doesn't have an audio driver (KEXT) associated with it you can still use another audio device to capture audio. SoftVDigX for example doesn't implement GetSoundInputDriver so whatever the default Audio input is, that is will be used during capture.

If you do have a preferred audio device, then implement GetSoundInputDriver and simply return the name of your input driver as a Pascal String.

Here's a sample implementation:

//***
// GetSoundInputDriver()
//      This allows a digitizer client to retrieve the digitizer's preferred sound input
//      driver.
//
//             <- soundDriverName     The name of digitizers associated sound input driver.
//***
pascal VideoDigitizerError MyCoolVDIG_GetSoundInputDriver(MyVDStorage *storage, Str255 soundDriverName)
{
        static Str31 driverName = "\pMyAudioDriverName";

        StringCopy(driverName, soundDriverName);

        return noErr;
}

You'll also want to implement GetSoundInputSource.

//***
// GetSoundInputSource()
//***
VideoDigitizerError MyCoolVDIG_GetSoundInputSource(MyVDStorage *storage, SInt32 videoInput, SInt32 *soundInput)
{
        // a single sound input source eh?
        *soundInput = 1;

        return noErr;
}

This is the best you can do until there's a way to return an AudioDeviceUID from a VDig.

A sample audio driver called "PhantomAudioDriver" can be found in the Developer Examples folder /Kernel/IOKit/Audio/ if you've installed the developer tools.
 
A final note, the use of SoundMediaType is no longer recommended with QT 7. Use the new SGAudioMediaType as demonstrated in WhackedTV (this is the replacement for HackTVCarbon).

http://developer.apple.com/samplecode/WhackedTV/WhackedTV.html

regards,
edward

 Edward Agabeg
 WWDR Engineer
 QuickTime and Audio
 Worldwide Developer Relations
 Apple

 http://www.apple.com/developer
 http://www.apple.com/quicktime

-- This message was sent from a personal account --
-- All views are mine and not necessarily shared by my employer --
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-API mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quicktime-api/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.