Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reading bytes from an audio file



Brian,

How big is the file? The byte count returned from AudioFileGetProperty() is a SInt64 value but you have to pass a UInt32 * for the size of your buffer for AudioFIleReadBytes(). You wouldn't be able to read all the bytes in one pass if the byte count is larger than a UInt32 value. Sure you aren't passing 0 bytes for your size?

bob aron



On Sep 22, 2003, at 2:15 PM, B&L wrote:

Hello

I am trying to load the audio bytes from a WAV file.

I am doing this by first reading the size property of the audio file using the function AudioFileGetProperty().

Using this size I try to read the audio bytes using the function AudioFileReadBytes, into an array of the same size, which is allocated through malloc(sizeof(char) * theAudioDataSize).

This keeps giving an kAudioFileUnspecifiedError! If I just try to read in 1024 bytes there is no error!

Anybody out there who knows if and what I am doing wrong?

The functions and error codes are all declared in the header file AudioFile.h.

Thanks

Brian
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.

References: 
 >Reading bytes from an audio file (From: B&L <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.