0

Ok, maybe I'm tired but have some trouble when try to passing "float value" from an C array style to NSarray across NSNumber and obtain identical data. What I would like achieve is pass this value in other class for plotting audio Waveform.

assuming:

   //needed range from -1.0 to 1.0
   monoFloatDataLeft[i] = (float)left / 32768.0;
   monoFloatDataRight[i] = (float)right / 32768.0;


   ArraySx = &monoFloatDataLeft[i];
   ArrayDx = &monoFloatDataRight[i]; 
   NSLog(@"right %f\n",ArrayDx);

   [self floatSx:*(ArraySx) floatDx:*(ArrayDx)];

Output: right -0.000061

Now in function...

  -(void)floatSx: (float)left floatDx: (float) right{

 NSLog (@"Left in function  %f\n", left);
 NSLog (@"right in function  %f\n", right);

 NSArray *cannelLeftArray = [NSArray arrayWithObjects:[NSNumber numberWithFloat:left], nil];
 NSLog (@"cannelLeftArray  %@\n", canaleSinistroArray);

 NSArray *channelRightArray = [NSArray arrayWithObjects:[NSNumber numberWithFloat:right], nil];
 NSLog (@"channelRightArray  %@\n", canaleDestroArray);

}

Output:
Left in function  -0.000061
right in function  -0.000153

cannelLeftArray("-0.0001525879")

channelRightArray("-6.103516e-05")

Ok, what i need is populate the array with the same float value style like left and right in function...

Hope enough clear.

Thanks in advance

sundsx
  • 588
  • 9
  • 27
  • So basically you just need some values within `[-1.0, +1.0]`? –  Apr 15 '13 at 18:29
  • Yes, like this: (Left in function -0.000061) (right in function -0.000153). This value is in C Array and i need passing this value to another class in the same format as example. – sundsx Apr 16 '13 at 08:05

0 Answers0