Re: core audio cfplugin driver examples
Re: core audio cfplugin driver examples
- Subject: Re: core audio cfplugin driver examples
- From: Alexis Zbik <email@hidden>
- Date: Fri, 06 Jul 2012 10:50:06 +0200
If you want to get the audio buffer, the best place to hold them is in the method PreProcessOutputData in SHP_Device.h
put this inside
AudioBufferList* bufferList = inIOProc.GetAudioBufferList(false);
will help you to get a buffer list
and you can get each buffer of this list by using this:
for (unsigned long buf = 0; buf < bufferList->mNumberBuffers; buf++) {
//Get the current buffer
const AudioBuffer currentBuff = bufferList->mBuffers[buf];
//Get the float value
AudioSampleType* out = (AudioSampleType *)currentBuff.mData;
//Process (e.g add a gain to your audio signal)
for (size_t i = 0; i < mIOBufferFrameSize * currentBuff.mNumberChannels; i++) out[i] = out[i]*m_fGain;
}
Cause your Hardware Plugin is not a physical device it provides no sound! It just hold the buffers.
Portaudio help me to send these buffers to a physical device.
You can find anything you want about portaudio here:
http://www.portaudio.com/By the way, if you want to transform your SampleHardwarePlugin into a reflector (as the kext does) maybe you should copy these buffers to the input. I never tried this.
2012/7/5 Tuviah Snyder
<email@hidden>
Hi Alex,
So I configured SampleHardwarePlugin as default output device and sent some audio to it using GarageBand. But it appears there is no audio coming from using it as a microphone.
You mention PortAudio. Where can I find information about this call? Can you post or email off list some code on how to make SampleHardwarePlugin operate like AudioReflector kernel mode sample does?
best,
Tuviah
On Jul 5, 2012, at 1:56 AM, Alexis Zbik wrote:
Hi Tuviah.
I don't find any complete documentation for Hardware Plugin. Only the core audio mail list help me to understand the process.
Are you suggesting that SampleHardwarePlugin will mirror the output sent to it as an output device when acting as an input device?
Something like this. If you set your Hardware Plugin as the general audio output in Audio/Midi Setup, your instance in each app will be able to hold the stream.
I use PortAudio in my Hardware Plugin to reflect this stream into an other device.
But maybe i'm wrong.
2012/7/4 Tuviah Snyder <email@hidden<mailto:email@hidden>>
Hi Alex,
Is there any documentation you can find for the HPBase classes and/or core audio cfplugin drivers in general?
Are you suggesting that SampleHardwarePlugin will mirror the output sent to it as an output device when acting as an input device?
Best
Tuviah
Sent from my iPad
On Jul 4, 2012, at 1:24 AM, "Alexis Zbik" <
email@hidden<mailto:
email@hidden><mailto:
email@hidden<mailto:
email@hidden>>> wrote:
I'm currently working on SampleHardwarePlugin too.
I'm not sure but to get the strems from application who instantiate your plugin you need to set your device as a output device (or input) of your application. You can also set it as your system output/input.
Just don't forget to overload the CanBeDefaultDevice() in SHP_Plugin class and returning true.
2012/7/3 Tuviah Snyder <email@hidden<mailto:email@hidden><mailto:email@hidden<mailto:email@hidden>>>
I'm looking at SampleHardwarePlugin as an example of how to write a user mode audio driver. It displays as a device in all the applications I need to target for my virtual audio device, but doesn't actually deliver any streams? Would anyone on this list have any sample code or projects they can point me to which are more complete?
best,
Tuviah
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden<mailto:email@hidden><mailto:email@hidden<mailto:email@hidden>>)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden<mailto:email@hidden><mailto:email@hidden<mailto:email@hidden>>
--
Alexis ZBIK
Mac & Audio Developer
A-Volute
25, rue Corneille
59100, Roubaix, France
email@hidden<mailto:email@hidden><mailto:email@hidden<mailto:email@hidden>>
--
Alexis ZBIK
Mac & Audio Developer
A-Volute
25, rue Corneille
59100, Roubaix, France
email@hidden<mailto:
email@hidden>
--
Alexis ZBIKMac & Audio DeveloperA-Volute
25, rue Corneille
59100, Roubaix, France
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