Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,16 @@ set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "" SUFFIX ".node")

# Essential include files to build a node addon,
# You should add this line in every CMake.js based project
#target_include_directories(${PROJECT_NAME} )
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_JS_INC})

# Include N-API wrappers
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_JS_INC} PRIVATE "${CMAKE_SOURCE_DIR}/node_modules/node-addon-api")
execute_process(COMMAND node -p "require('node-addon-api').include"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE NODE_ADDON_API_DIR
)
string(REPLACE "\n" "" NODE_ADDON_API_DIR ${NODE_ADDON_API_DIR})
string(REPLACE "\"" "" NODE_ADDON_API_DIR ${NODE_ADDON_API_DIR})
target_include_directories(${PROJECT_NAME} PRIVATE ${NODE_ADDON_API_DIR})

# Essential library files to link to a node addon
# You should add this line in every CMake.js based project
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ where options is an object of the form:
```javascript
let options = {
// Value can be from 0 to 4 or using enum. 0 is the best quality and the slowest.
type: SampleRate.SRC_SINC_MEDIUM_QALITY,
type: SampleRate.SRC_SINC_MEDIUM_QUALITY,
// Stereo
channels: 2,
// Sample rate of source
Expand Down Expand Up @@ -59,4 +59,4 @@ If recording from `arecord`, `sox` or similar, use format `raw`.

### Altering playback speed

This is possible by modifying the converter ratio, which can be done on the fly using the `setRatio` method. e.g. `resample.setRatio(0.5)`. Depending upon timing, this will most likely take effect at the next buffer load. If fine grained modifications to playback speed are required, then a small value for `highWaterMark` on the input stream will be needed.
This is possible by modifying the converter ratio, which can be done on the fly using the `setRatio` method. e.g. `resample.setRatio(0.5)`. Depending upon timing, this will most likely take effect at the next buffer load. If fine grained modifications to playback speed are required, then a small value for `highWaterMark` on the input stream will be needed.
Loading