bool writeaudiodata(const char* pfilepath, char* pdata, int ulen, int usamplerate, int uchannels)
; pfile = fopen(pfilepath, "ab+");
if (pfile)
adtsheader[0] = 0xff;
adtsheader[1] = 0xf1;
if (usamplerate == 48000)
else if (usamplerate == 44100)
else if (usamplerate == 32000)
else if (usamplerate == 24000)
if (uchannels == 2)
else
adtsheader[4] = (ulen+7) >> 3;
adtsheader[5] = ((ulen+7) & 0x7) << 5;
adtsheader[6] = 0xfc;
if (7 != fwrite(adtsheader, 1, 7, pfile))
if (ulen != fwrite(pdata, 1, ulen, pfile))
return true;
}
c語言實現鏈式儲存
h ifndef linklist h define linklist h define crt secure no warnings include include include 節點結構體 typedef struct linknode linknode typedef struct link...
單鏈表資料儲存結構 c語言實現
1.list.h ifndef list h define list h typedef struct node node typedef struct list list initlist int insertlist list l,void data,int size node findnode...
稀疏矩陣壓縮儲存(C語言實現)
在乙個矩陣中,如果非0元素遠遠少於0元素,那麼這個矩陣就是稀疏矩陣,在實際應用中,計算機會耗費大量的空間儲存這些無意義的0元素,如果能夠壓縮一下,將會減少計算機的開銷。本篇文章以五子棋的棋局儲存為背景,用c語言實現原始稀疏矩陣轉換為壓縮矩陣並且儲存為檔案,棋局覆盤則讀取檔案將壓縮矩陣轉換為原始稀疏矩...