Re: Cocoa and Port Audio!
Re: Cocoa and Port Audio!
- Subject: Re: Cocoa and Port Audio!
- From: email@hidden
- Date: Thu, 17 Oct 2002 08:50:48 +0200
Thank you all for the answers I got!!
I will try to specify the problem a bit more. This function I was
referring to
>
static int jontesCallback(void* inputBuffer, void* outputBuffer,
>
unsigned long framesPerBuffer, PATimestamp outTime, void* userData)
>
{/../}
is only writing the audio buffer. But so far I believe you're with me.
There's another function call though which opens the audio stream with
a declaration that looks something like this:
err = Pa_OpenDefaultStream(
&stream,
0, /* no input channels */
2, /* stereo output */
paFloat32, /* 32 bit floating point output */
SAMPLE_RATE,
256, /* frames per buffer */
0, /* number of buffers, if zero then use
default minimum*/
jontesCallback,
&data );
This function was no problem to put in an IBAction method connected to
the start-button. But as you can see you're supposed to send the name
of the jontesCallback-function as an argument for the
Pa_OpenDefaultStream. I have declared my MyDocument file as an .mm-fil
to provide support for Objective-C++.
I've also tried to keep the function as it is but instead of calling
[pitchSlide floatValue] inside the function I added a float-variable in
MyDocument.h called pitch. I than let the slider trig an IBAction which
changed the value on the pitch variable. This was how the critical part
of jontesCallback looked like:
data->left_phase += (pitch * 0.01f);
Same problem here. The compiler tells me the "pitch"-function isn't
declared.
Is there any way of declaring the function jontesCallback() as an
Obj.-C method of the MyDocument object and still beeing able to send it
to the Pa_OpenDefaultStream() as an argument? Or is there any other
solution?
/Jont Olof
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.