# 廣播 ## 小組成員與負責事項 - 108321036 莊才賢(portaudio) - 108321038 丘世宇(socket) ## 程式說明 ### portaudio 聲音擷取 * 初始化要 callback 的data(recordSamples、currentSoundIdx)、現在傳送的 Frame 的 index(currentSendFrameIdx) * 初始化 stream,並開啟 stream * main 會用 while(1) 偵測 currentSendFrameIdx != data.currentSoundIdx,推斷是否需要發送 #### 程式架構  #### portaudio 聲音擷取流程 1.  1.  1.  <style> img[alt="t"]{ width: 50% } </style> ### portaudio 聲音播出 * 初始化要 callback 的data(recordSamples、currentSoundIdx)、現在傳送的 Frame 的 index(currentGetFrameIdx) * 初始化 stream,並開啟 stream * main 會用 while(1) 偵測 currentSendFrameIdx != data.currentSoundIdx,推斷是否需要接收 #### 程式架構  #### portaudio 聲音擷取流程 1.  1.  1.  1.  ### socket #### speaker - 等待 listener 連線 - 若有資料可發送 就將資料分送給所有連接的 listener #### listener - 連上 speaker 後用 while(1) 中寫著 recv 等待 speaker 傳資料過來 ## 遭遇問題 - 如何 include 外部 library - 右鍵 solution explorer > solution - 左鍵 properities - C/C++ > General > Addition Include Directory 放入有 .h 檔的路徑 - Linker > Input> Addition dependencies 放入 .lib 檔的路徑 - 在執行 exe 的目錄底下放 portaudio.dll - 如果在 callback function 裡面放入 socket 程式,聲音會變很奇怪,callback function 裡面感覺只能放不會延遲太久的計算 - 改成放到 main 進行傳送/接收 - 對 socket 概念不熟,程式邏輯改了又改 - 多查多看,想辦法把想法畫成圖
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up