[Stk] mo_audio recording internal sound

Ariel Elkin arielelkin at gmail.com
Tue Nov 29 15:40:19 PST 2011


Hi list, 

I am also having trouble recording sound with momu_stk.... 

I read the tutorial on using STK's FileWvOut class to write WAV files, https://ccrma.stanford.edu/software/stk/hello.html
so I'm importing FileWvOut.h and added this code in my viewController.mm's viewDidLoad method:

audioData.myOutput = new stk::FileWvOut();
audioData.myOutput->openFile( "hellosine.wav", 1, FileWrite::FILE_WAV, Stk::STK_FLOAT32 );

However this throws this error at runtime:

FileWrite: could not create WAV file: hellosine.wav
terminate called after throwing an instance of 'stk::StkError'

Mo_Audio defines a sample as a Float32 by default (see mo_def.h), so I don't think that's where the error is.... It's probably due to a call to fopen (in FileWrite.cpp line 215) that doesn't get along well with the iOS SDK... Any thoughts?

Ariel

On 24 Nov 2011, at 11:42am, Davide Cairo wrote:

> 
> Hi everyone!
> I'm making an app that play samples that i load in a buffer. i'm using mo_audio to play buffers, but i need to record ,what the user is doing , on a sound file, i don't want to use iphone mic , i need to save all the sounds in a buffer and create a file.
> Is this possible using momu stk? can i write an audio file using internal soundsource?
> 
> 
> _______________________________________________
> Stk mailing list
> Stk at ccrma.stanford.edu
> http://ccrma-mail.stanford.edu/mailman/listinfo/stk




More information about the Stk mailing list