libcm is a C development framework with an emphasis on audio signal processing applications.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

cmAudioBuf.h 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #ifndef cmAudioBuf_h
  2. #define cmAudioBuf_h
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. //( {file_desc: "Obsolete audio buffer class. This class is superceded by cmApBuf."}
  7. enum
  8. {
  9. kOkBaRC = cmOkRC
  10. kBufOverunBaRC,
  11. kBufUnderunBaRC
  12. };
  13. enum
  14. {
  15. kInBaFl = 0x01,
  16. kOutBaFl = 0x02
  17. };
  18. typedef cmRC_t cmBaRC_t;
  19. cmBaRC_t cmAudioBufInit( cmCtx_t* ctx, unsigned devCnt );
  20. cmBaRC_t cmAudioBufFinal();
  21. cmBaRC_t cmAudioBufSetup(
  22. unsigned devIdx,
  23. unsigned cycleCnt,
  24. unsigned inSubDevCnt,
  25. unsigned inChCnt,
  26. unsigned inFrameCnt,
  27. unsigned outChCnt,
  28. unsigned outFrameCnt,
  29. unsigned outSubDevCnt );
  30. // Called from the audio driver within incoming samples to store (inPktArray)
  31. // and empty buffers (outPktArray) to fill with outgoin samples.
  32. cmBaRC_t cmAudioBufUpdate(
  33. cmApAudioPacket_t* inPktArray, ///< full audio packets from incoming audio (from ADC)
  34. unsigned inPktCnt, ///< count of incoming audio packets
  35. cmApAudioPacket_t* outPktArray, ///< empty audio packet for outgoing audio (to DAC)
  36. unsigned outPktCnt ///< count of outgoing audio packets
  37. );
  38. bool cmAudioBufIsDeviceReady( unsigned devIdx, unsigned flags );
  39. cmBaRC_t cmAudioBufGet(
  40. unsigned devIdx,
  41. unsigned flags,
  42. cmApAudioPacket_t* pktArray[],
  43. unsigned pktCnt );
  44. cmBaRC_t cmAudioBufAdvance( unsigned devIdx, unsigned flags );
  45. //)
  46. #ifdef __cplusplus
  47. }
  48. #endif
  49. #endif