开发者

Alternative for DWORD in Objective C

开发者 https://www.devze.com 2023-01-22 00:47 出处:网络
I am trying opening a audio file (.wav) and retrieve the raw data. I got the below code from the link. When I am trying to implement the code DWORD is not suppo开发者_Python百科rted in Objective c.

I am trying opening a audio file (.wav) and retrieve the raw data. I got the below code from the link. When I am trying to implement the code DWORD is not suppo开发者_Python百科rted in Objective c.

How can I implement this?

FILE *fp;
fp = fopen("sound.wav","rb");
if (fp)
{
    BYTE id[4]; //four bytes to hold 'RIFF'
    DWORD size; //32 bit value to hold file size

    fread(id,sizeof(BYTE),4,fp); //read in first four bytes
    if (!strcmp(id,"RIFF"))
    { //we had 'RIFF' let's continue
        fread(size,sizeof(DWORD),1,fp);
        //read in 32bit size value
    }
}


You could use any 32-bit unsigned integer value for DWORD, e.g. uint32_t.

#include <stdint.h>
typedef uint32_t DWORD;
...
0

精彩评论

暂无评论...
验证码 换一张
取 消