Reputation: 16921
I have written samples from microphone input into a Float32
array, and now I want to turn that array of samples into a WAV file.
Apparently a good way to do it is to use a utility class from the DIRAC library, as its EAFWrite
class has a writeFloats
method that should do the trick.
When I call the EAFWrite's writeFloats method I get a "Cannot convert 'float' to float**" error. Here's the call:
[mWriter writeFloats:128 fromArray:mySession];
The array was initialised thus:
Float32 mySession[10000000] = {0};
What do you think is wrong? Is this a problem about pointers?
Upvotes: 2
Views: 226
Reputation: 385610
A peek at the writeFloats:fromArray:
source code (it's included in the library, doncha kno) reveals that the data
parameter should actually be an array of array pointers, with one array pointer per channel. Presumably you specified one channel in some previous message to mWriter
, so now you can just do this:
Float32 *channelsData[1] = { mySession };
[mWriter writeFloats:128 fromArray:channelsData];
or if you want to get really tricky:
[mWriter writeFloats:128 fromArray:(Float32 *[]){ mySession }];
Upvotes: 1