Converting audio file data to Float32
Converting audio file data to Float32
- Subject: Converting audio file data to Float32
- From: "E. Tejkowski" <email@hidden>
- Date: Mon, 9 Nov 2009 02:20:18 -0600
Hi,
I'm having problems loading an audio file (uncompressed AIFF and WAV
just for starters) and converting the file to a Float32 buffer. I have
code that loads the file and converts it. And indeed my buffer looks
different after the conversion.
However, unless I'm misunderstanding something fundamental, I'm not
seeing data values in the buffer that lie within the standard -1 to +1
range that I was expecting. I'm using ExtAudioFileRead in a while loop
and filling up the buffer just like code I've pieced together from the
web. The two audio files I'm loading contain a couple cycles of
identical sine wave data (one in WAV format, one AIFF). The buffer
values look really large when I spit them to the console like this:
NSLog(@"buffer[i] = %f", buffer[i]);
I can see a definite pattern in the data values (a segment of which
you can see pasted below… sorry for the large copy/paste, but it
illustrates what I'm talking about).
Any idea what I'm missing here?
Thanks,
Erick
buffer[0] = 0.000000
buffer[1] = 0.000000
buffer[2] = 0.000000
buffer[3] = 0.000000
buffer[4] = 0.000006
buffer[5] = 10.389666
buffer[6] = 4334332.000000
buffer[7] = 393650274304.000000
buffer[8] = 5535811801972736.000000
buffer[9] = 11194976705364099072.000000
buffer[10] = 2866256310144889520128.000000
buffer[11] = 83463500526199001579520.000000
buffer[12] = 272007275386817120043008.000000
buffer[13] = 97044213288925789159424.000000
buffer[14] = 3715049168965453479936.000000
buffer[15] = 16168351471794913280.000000
buffer[16] = 8703301327519744.000000
buffer[17] = 710124568576.000000
buffer[18] = 8671036.000000
buffer[19] = 22.784424
buffer[20] = 0.000013
buffer[21] = 0.000000
buffer[22] = 0.000000
buffer[23] = 0.000000
buffer[24] = 0.000000
buffer[25] = -270003140560408578541368307299123200.000000
buffer[26] = -5684961270525776161237106688.000000
buffer[27] = -184356187752550629376.000000
buffer[28] = -11603677282304.000000
buffer[29] = -1817069.125000
buffer[30] = -0.917061
buffer[31] = -0.000002
buffer[32] = -0.000000
buffer[33] = -0.000000
buffer[34] = -0.000000
buffer[35] = -0.000000
buffer[36] = -0.000000
buffer[37] = -0.000000
buffer[38] = -0.000000
buffer[39] = -0.000000
buffer[40] = -0.000000
buffer[41] = -0.000000
buffer[42] = -0.000000
buffer[43] = -0.000000
buffer[44] = -0.092150
buffer[45] = -135947.015625
buffer[46] = -746476994560.000000
buffer[47] = -10005037942784917504.000000
buffer[48] = -287597708170215727508226048.000000
buffer[49] = -13138484179962930082094711929044992.000000
buffer[50] = 0.000000
buffer[51] = 0.000000
buffer[52] = 0.000000
buffer[53] = 0.000000
buffer[54] = 0.000001
buffer[55] = 2.081719
buffer[56] = 1067164.625000
buffer[57] = 116127342592.000000
buffer[58] = 2026040629133312.000000
buffer[59] = 5165053178256818176.000000
buffer[60] = 1728259312490683301888.000000
buffer[61] = 64752958104316223160320.000000
buffer[62] = 267284422515187718815744.000000
buffer[63] = 123017409088693932654592.000000
buffer[64] = 6028182380075953422336.000000
buffer[65] = 33057522975550472192.000000
buffer[66] = 23554539101618176.000000
buffer[67] = 2167599267840.000000
buffer[68] = 33898648.000000
buffer[69] = 105.139748
buffer[70] = 0.000073
buffer[71] = 0.000000
buffer[72] = 0.000000
buffer[73] = 0.000000
buffer[74] = 0.000000
buffer[75] = -2045853856261063090227795510024994816.000000
buffer[76] = -40839167014851177897399418880.000000
buffer[77] = -1225869685471087427584.000000
buffer[78] = -69505912930304.000000
buffer[79] = -10211507.000000
buffer[80] = -4.430386
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden