[Stk] RtAudio and Stk interface

Gary Scavone gary at ccrma.Stanford.EDU
Fri Sep 26 06:56:47 PDT 2008


Hi Alpana,

You are having problems with learning to use Xcode, which is not an  
issue for this list.  Perhaps you can find some tutorials online to  
help or another list specifically related to using Xcode.

Regards,

--gary

On 26-Sep-08, at 3:52 AM, alpana jui wrote:

> Dear Gary,
>
>
> Thank you very much.
>
>
> I check this and this is working well in the terminal and result of
> stk-4.3.1 audioprobe is
>
>
> Compiled APIs:
>  OS-X Core Audio
>
> Current API: OS-X Core Audio
>
> Found 3 device(s) ...
>
> Device Name = Apple Inc.: Built-in Microphone
> Probe Status = Successful
> Output Channels = 0
> Input Channels = 2
> Duplex Channels = 0
> This is NOT the default output device.
> This is the default input device.
> Natively supported data formats:
>  32-bit float
> Supported sample rates = 44100 48000 88200 96000
>
> Device Name = Apple Inc.: Built-in Input
> Probe Status = Successful
> Output Channels = 0
> Input Channels = 2
> Duplex Channels = 0
> This is NOT the default output device.
> This is NOT the default input device.
> Natively supported data formats:
>  32-bit float
> Supported sample rates = 44100 48000 88200 96000
>
> Device Name = Apple Inc.: Built-in Output
> Probe Status = Successful
> Output Channels = 2
> Input Channels = 0
> Duplex Channels = 0
> This is the default output device.
> This is NOT the default input device.
> Natively supported data formats:
>  32-bit float
> Supported sample rates = 44100 48000 88200 96000
>
>
> But I could not manage the same on the Xcode IDE and always find
> RtAudio Dummy API. I set the preprocessor direcitve, i.e.,
>
> #ifndef __MACOSX_CORE__
> #define __MACOSX_CORE__
> #endif
>
> Still it does not work but RtAPI Dummy with no functionality. I tried
> some simple examples using terminal in differnent directory, I can
> compile this, but no output or could not run.
>
>
> Is there any procedure to follow when I try to use STK-4.3.1 on Xcode
> to set up the audio so that no dummy functionality appears. I am sure
> that my audio device has functional ability since this works with
> music.
>
> I will appreciate the help  to use  STK-4.3.1 on Xcode 3.1.  I need to
> read  and write several disk wav files ( 20 or more ) for sample
> computation and further processing  and some simple command recording
> for its reading and writing on the disk for signal analysis.  I can
> use some sine examples that is in the tutorial on the Xcode to write
> samples from sine wav file. But I do not need sine wav for my
> application, I need to use some other spoken wav files that are on my
> disk.
>
>
>
> If you use XCode IDE, could you let me know what I can do to use this
> Stk-4.3.1 for my purpose.
>
>
> Look forward to hearing from you.
>
> Thank you,
> Jui
>
> On Fri, Sep 26, 2008 at 2:45 AM, Gary Scavone  
> <gary at ccrma.stanford.edu> wrote:
>> Hi Alpana,
>>
>> I have 10.5.5 and an Intel Mac and I haven't had problems with Stk  
>> 4.3.1.
>> What version of g++ are you using?  Download the current version, run
>> "configure" in the root directory of the distribution, then go to the
>> "projects/examples" directory and type "make audioprobe".  Then run  
>> the
>> compiled application to see what devices and capabilities RtAudio is
>> finding.
>>
>> Regards,
>>
>> --gary
>>
>> On 25-Sep-08, at 8:15 PM, alpana jui wrote:
>>
>>> Dear Everybody,
>>>
>>>
>>> I can only use at present 4.2.1 stk for my MACOX core audio. The
>>> recent version is not configuring  my device, Mac 10.5.5 yet.
>>>
>>>
>>> I will appreciate this if  anybody could please check my attached
>>> parameters in this  setting. The purpose to use Stk  in my  
>>> application
>>> is  to disk wav files and also to be able to  record some commands
>>> for signal analysis.  I am using Stk- 4.2.1 and StkX.
>>>
>>>
>>> I have RtAudioStream status is not declared or set error. I presume
>>> 4.3.1 an 4.2.1 have some difference in the API  settings. I just  
>>> need
>>> to use this properly for the time being.
>>>
>>>
>>> In main.cpp
>>>
>>>
>>> _rec_status(false),
>>> _adc(new RtAudio(RtAudio::MACOSX_CORE)),
>>> _sampleRate(44100),//Hz
>>> _bufferFrames(1024),//number of samples per cycle
>>> _DCcoeffs ( *(new wxClientDC (panel_FT) ) ),
>>> _scale_x (512), _scale_y(512), // dimension of panel_FT
>>> _x ( new Signal), // needed for callbackfunction - RtAudio
>>> _calls (0),//callback-counter
>>> _cost (Entropy),
>>> _costpar (0.1),
>>> _fixed_analyze_size (8192),
>>> _fb_counter (0),
>>>
>>>
>>>
>>>
>>>       assert(_adc);
>>>       assert(_x);
>>>       assert(_fixed_buffer);
>>>       _x->RtAudioInterface(_fixed_buffer, _fixed_analyze_size);
>>>
>>>       //_COUT.open("/Users/Desktop/tu/_cout");
>>>
>>>
>>> _adc->getCurrentApi();
>>>       if ( _adc -> getDeviceCount() < 1 ) {
>>>               wxMessageBox ( _("No audio devices found!"));
>>>
>>>               button_rec -> Enable(false);
>>>
>>>
>>> unsigned deviceId = 3; /
>>>
>>>       _deviceinfo=_adc->getDeviceInfo(deviceId);/
>>>
>>>       _parameters.deviceId = deviceId;
>>>       _parameters.nChannels = 1;//_deviceinfo.inputChannels;// 
>>> should be
>>> == 16
>>>       _parameters.firstChannel = 0;
>>>
>>>
>>> In RtAudio.cpp:
>>> int RtAudioInterface( void *outputBuffer,
>>>                                        void *inputBuffer,
>>>                                        unsigned int nBufferFrames,
>>>                                        double streamTime,
>>>                                        RtAudioStreamStatus status,
>>>                                        void *callbackdata )
>>> {
>>>
>>>
>>> But I am contnously having
>>> RtAudioStreamStatus status is not declared or set error.
>>>
>>>
>>> Is this APi used in STK: 4.3.1? If not , could you let me know which
>>> API I should use for this ?
>>>
>>>
>>> In Signal.cpp
>>>
>>>
>>> int Signal::RtAudioInterface( real* inputBuffer, C::index  
>>> nBufferFrames)
>>>
>>>
>>> For disk wav files reading and computing  as well as writing speech
>>> samples:
>>>
>>> FileWvIn input("test.wav");
>>> input.tick();
>>>
>>> Are all the above parameters are set and used properly when I am  
>>> using
>>> STK-42.1 for recording  speech command and using disk wav files  
>>> since
>>> who some of these API were written earlier following 4.3.1. But I  
>>> can
>>> only manage so far 4.2.1 on Mac Xcode and there I would like to use
>>> 4.2.1.
>>>
>>>
>>> I will appreciate very much your advice and the directions on my
>>> concerns and problems.
>>>
>>>
>>> Look forward to hearing from you.
>>>
>>> With sincere thanks,
>>> Jui
>>>
>>> _______________________________________________
>>> Stk mailing list
>>> Stk at ccrma.stanford.edu
>>> http://ccrma-mail.stanford.edu/mailman/listinfo/stk
>>
>>



More information about the Stk mailing list