Code: Select all
void GrabaWAV(char *name,int size){
int tamanno = size;
int tamannoHeader = size + 36;
int sstg = sceIoOpen(name, PSP_O_WRONLY | PSP_O_CREAT , 0777);
printf("\nDescriptor abierto. Size = %d\n", size);
sceIoWrite(sstg, "RIFF",4*sizeof(char));
sceIoWrite(sstg, &tamannoHeader,sizeof(int));
sceIoWrite(sstg, "WAVE",4*sizeof(char));
printf("RIFF chunk descriptor escrito\n");
sceIoWrite(sstg, "fmt ",4*sizeof(char));
sceIoWrite(sstg, "16",sizeof(int));
sceIoWrite(sstg, "1",sizeof(short));
sceIoWrite(sstg, "1",sizeof(short));
sceIoWrite(sstg, "44100",sizeof(int));
sceIoWrite(sstg, "88200",sizeof(int));
sceIoWrite(sstg, "2",sizeof(short));
sceIoWrite(sstg, "16",sizeof(short));
printf("fmt sub-chunk descriptor escrito\n");
sceIoWrite(sstg, "data",4*sizeof(char));
sceIoWrite(sstg, &tamanno,sizeof(int));
printf("data sub-chunk descriptor escrito\n");
sceIoWrite(sstg, bigbuffer, &tamanno);
printf("Datos escritos\n");
sceIoClose(sstg);
}//GrabaWAV
Edit: Sorry, the program is correct. It was a problem with the memory stick