Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
b114de5f1d | |||
d13298acf9 | |||
a5ca43b7dd | |||
abc2ce6a49 | |||
6a2e12c2ad | |||
7d38eb190d | |||
bc47714cff | |||
6ecf73bb11 | |||
417845abc2 | |||
5acf1ead90 | |||
e80670fd0c | |||
77241b828d |
94
.travis.yml
94
.travis.yml
@@ -1,11 +1,7 @@
|
|||||||
language:
|
language: cpp
|
||||||
- cpp
|
|
||||||
|
|
||||||
sudo: false
|
sudo: required
|
||||||
|
dist: trusty
|
||||||
os:
|
|
||||||
- linux
|
|
||||||
- osx
|
|
||||||
|
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
@@ -18,39 +14,83 @@ addons:
|
|||||||
- ubuntu-toolchain-r-test
|
- ubuntu-toolchain-r-test
|
||||||
packages:
|
packages:
|
||||||
- g++-4.9
|
- g++-4.9
|
||||||
|
- expect
|
||||||
|
- binutils-mingw-w64-x86-64 # 64bit MinGW
|
||||||
|
- gcc-mingw-w64-x86-64
|
||||||
|
- g++-mingw-w64-x86-64
|
||||||
|
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: linux
|
||||||
|
env: CONF=release BUILDER=gcc TARGET=Linux TAG=Linux COMPILATOR_OPTION="--compilator-version=4.9" GCOV=--gcov
|
||||||
|
compiler: gcc
|
||||||
|
- os: linux
|
||||||
|
env: CONF=debug BUILDER=clang TARGET=Linux
|
||||||
|
compiler: clang
|
||||||
|
- os: linux
|
||||||
|
env: CONF=release BUILDER=gcc TARGET=Windows TAG=Mingw
|
||||||
|
compiler: x86_64-w64-mingw32-gcc
|
||||||
|
- os: linux
|
||||||
|
env: CONF=release BUILDER=gcc TARGET=Android TAG=Android DISABLE_PACKAGE=-p
|
||||||
|
compiler: gcc
|
||||||
|
- os: osx
|
||||||
|
env: CONF=release BUILDER=clang TARGET=MacOs TAG=MacOs
|
||||||
|
compiler: clang
|
||||||
|
- os: osx
|
||||||
|
env: CONF=release BUILDER=clang TARGET=IOs TAG=IOs
|
||||||
|
compiler: clang
|
||||||
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
|
- cd ..
|
||||||
- pip install --user lutin
|
- pip install --user lutin
|
||||||
|
- if [ "$TAG" == "Android" ]; then
|
||||||
env:
|
git clone --depth 1 --branch master https://github.com/HeeroYui/android-download-tool;
|
||||||
- CONF=debug BOARD=Linux BUILDER=clang GCOV=
|
./android-download-tool/dl-android.sh;
|
||||||
- CONF=release BOARD=Linux BUILDER=clang GCOV=
|
fi
|
||||||
- CONF=debug BOARD=Linux BUILDER=gcc GCOV=
|
- git clone --depth 1 --branch master https://github.com/atria-soft/ci.git
|
||||||
- CONF=release BOARD=Linux BUILDER=gcc GCOV=
|
- cd -
|
||||||
- CONF=debug BOARD=Linux BUILDER=gcc GCOV=--gcov
|
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- cd ..
|
- cd ..
|
||||||
- wget http://atria-soft.com/ci/coverage_send.py
|
- git clone https://github.com/atria-soft/etk.git -b $TRAVIS_BRANCH
|
||||||
- wget http://atria-soft.com/ci/test_send.py
|
- git clone https://github.com/atria-soft/elog.git -b $TRAVIS_BRANCH
|
||||||
- wget http://atria-soft.com/ci/warning_send.py
|
- git clone https://github.com/atria-soft/ememory.git -b $TRAVIS_BRANCH
|
||||||
|
- git clone https://github.com/atria-soft/echrono.git -b $TRAVIS_BRANCH
|
||||||
|
- git clone https://github.com/atria-soft/ethread.git -b $TRAVIS_BRANCH
|
||||||
|
- git clone https://github.com/atria-soft/ejson.git -b $TRAVIS_BRANCH
|
||||||
|
- git clone https://github.com/atria-soft/jvm-basics.git -b $TRAVIS_BRANCH
|
||||||
|
- git clone https://github.com/musicdsp/audio.git -b $TRAVIS_BRANCH
|
||||||
|
- git clone https://github.com/musicdsp/audio-algo-drain.git -b $TRAVIS_BRANCH
|
||||||
|
- git clone https://github.com/musicdsp/audio-algo-river.git -b $TRAVIS_BRANCH
|
||||||
|
- git clone https://github.com/musicdsp/audio-algo-speex.git -b $TRAVIS_BRANCH
|
||||||
|
- git clone https://github.com/musicdsp/audio-drain.git -b $TRAVIS_BRANCH
|
||||||
|
- git clone https://github.com/musicdsp/audio-orchestra.git -b $TRAVIS_BRANCH
|
||||||
- git clone https://github.com/generic-library/gtest-lutin.git --recursive
|
- git clone https://github.com/generic-library/gtest-lutin.git --recursive
|
||||||
- git clone https://github.com/generic-library/speex-dsp-lutin.git --recursive
|
|
||||||
- git clone https://github.com/generic-library/z-lutin.git --recursive
|
- git clone https://github.com/generic-library/z-lutin.git --recursive
|
||||||
- git clone https://github.com/atria-soft/etk.git
|
- git clone https://github.com/generic-library/speex-dsp-lutin.git --recursive
|
||||||
- git clone https://github.com/atria-soft/ejson.git
|
|
||||||
- git clone https://github.com/musicdsp/audio.git
|
|
||||||
- git clone https://github.com/musicdsp/audio-algo-drain.git
|
|
||||||
- git clone https://github.com/musicdsp/audio-drain.git
|
|
||||||
- git clone https://github.com/musicdsp/audio-orchestra.git
|
|
||||||
- pwd
|
- pwd
|
||||||
- ls -l
|
- ls -l
|
||||||
- if [ "$BUILDER" == "gcc" ]; then COMPILATOR_OPTION="--compilator-version=4.9"; else COMPILATOR_OPTION=""; fi
|
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
|
||||||
|
export PATH=$PATH:/Users/travis/Library/Python/2.7/bin/;
|
||||||
|
fi
|
||||||
|
- ./ci/build_send.py --tag=$TAG --status=START;
|
||||||
|
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- lutin -w -j4 -C -P -c $BUILDER $COMPILATOR_OPTION -m $CONF $GCOV -p audio-river-test
|
- lutin -w -j4 -C -P -t$TARGET -c $BUILDER $COMPILATOR_OPTION $BUS -m $CONF $GCOV $DISABLE_PACKAGE audio-river-test*; STATUS=$?
|
||||||
# - ./out/Linux_x86_64/$CONF/staging/$BUILDER/audio-river-test/usr/bin/audio-river-test -l6
|
- ./ci/build_send.py --tag=$TAG --status="$STATUS";
|
||||||
|
|
||||||
|
after_script:
|
||||||
|
- if [ "$GCOV" != "" ]; then
|
||||||
|
./ci/warning_send.py --find-path ./out/Linux_x86_64/$CONF/build/$BUILDER/audio-river/;
|
||||||
|
fi
|
||||||
|
#- lutin -w -j4 -C -P -t$TARGET -c $BUILDER $COMPILATOR_OPTION $BUS -m $CONF $GCOV $DISABLE_PACKAGE audio-river-test?run:--elog-level=3 | tee out_test.txt
|
||||||
|
#- if [ "$GCOV" != "" ]; then
|
||||||
|
# ./ci/test_send.py --file=out_test.txt;
|
||||||
|
# lutin -C -P -t $TARGET -c $BUILDER $COMPILATOR_OPTION $BUS -m $CONF -p audio-river?gcov;
|
||||||
|
# ./ci/coverage_send.py --json=out/Linux_x86_64/$CONF/build/$BUILDER/audio-river/audio-river_coverage.json;
|
||||||
|
# fi
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
email:
|
email:
|
||||||
|
88
README.md
88
README.md
@@ -1,4 +1,88 @@
|
|||||||
# audio-river
|
audio-river
|
||||||
(APACHE v2.0) audio: virtualisation of hardware interface
|
=====
|
||||||
|
|
||||||
|
`audio-river` is a High level hardware audio interface that connect to orchestra (multi-platform backend)
|
||||||
|
|
||||||
|
Release (master)
|
||||||
|
----------------
|
||||||
|
|
||||||
[](https://travis-ci.org/musicdsp/audio-river)
|
[](https://travis-ci.org/musicdsp/audio-river)
|
||||||
|
[](http://musicdsp.com/ci/musicdsp/audio-river)
|
||||||
|
[](http://musicdsp.com/ci/musicdsp/audio-river)
|
||||||
|
[](http://musicdsp.com/ci/musicdsp/audio-river)
|
||||||
|
|
||||||
|
[](http://musicdsp.com/ci/musicdsp/audio-river)
|
||||||
|
[](http://musicdsp.com/ci/musicdsp/audio-river)
|
||||||
|
[](http://musicdsp.com/ci/musicdsp/audio-river)
|
||||||
|
|
||||||
|
[](http://musicdsp.com/ci/musicdsp/audio-river)
|
||||||
|
[](http://musicdsp.com/ci/musicdsp/audio-river)
|
||||||
|
|
||||||
|
Developement (dev)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
[](https://travis-ci.org/musicdsp/audio-river)
|
||||||
|
[](http://musicdsp.com/ci/musicdsp/audio-river)
|
||||||
|
[](http://musicdsp.com/ci/musicdsp/audio-river)
|
||||||
|
[](http://musicdsp.com/ci/musicdsp/audio-river)
|
||||||
|
|
||||||
|
[](http://musicdsp.com/ci/musicdsp/audio-river)
|
||||||
|
[](http://musicdsp.com/ci/musicdsp/audio-river)
|
||||||
|
[](http://musicdsp.com/ci/musicdsp/audio-river)
|
||||||
|
|
||||||
|
[](http://musicdsp.com/ci/musicdsp/audio-river)
|
||||||
|
[](http://musicdsp.com/ci/musicdsp/audio-river)
|
||||||
|
|
||||||
|
|
||||||
|
Instructions
|
||||||
|
============
|
||||||
|
|
||||||
|
download Build system:
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
sudo pip install lutin
|
||||||
|
sudo pip install pillow
|
||||||
|
|
||||||
|
download the software:
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
mkdir WORKING_DIRECTORY
|
||||||
|
cd WORKING_DIRECTORY
|
||||||
|
git clone https://github.com/atria-soft/etk.git
|
||||||
|
git clone https://github.com/atria-soft/elog.git
|
||||||
|
git clone https://github.com/atria-soft/ememory.git
|
||||||
|
git clone https://github.com/atria-soft/ethread.git
|
||||||
|
git clone https://github.com/atria-soft/ejson.git
|
||||||
|
git clone https://github.com/musicdsp/audio.git
|
||||||
|
git clone https://github.com/musicdsp/audio-algo-drain.git
|
||||||
|
git clone https://github.com/musicdsp/audio-algo-river.git
|
||||||
|
git clone https://github.com/musicdsp/audio-algo-speex.git
|
||||||
|
git clone https://github.com/musicdsp/audio-drain.git
|
||||||
|
git clone https://github.com/musicdsp/audio-orchestra.git
|
||||||
|
git clone https://github.com/musicdsp/audio-river.git
|
||||||
|
git clone https://github.com/generic-library/gtest-lutin.git --recursive
|
||||||
|
git clone https://github.com/generic-library/z-lutin.git --recursive
|
||||||
|
git clone https://github.com/generic-library/speex-dsp-lutin.git --recursive
|
||||||
|
|
||||||
|
Compile software:
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
cd WORKING_DIRECTORY
|
||||||
|
lutin -C -P audio-river-test?build?run
|
||||||
|
|
||||||
|
License (APACHE v2.0)
|
||||||
|
=====================
|
||||||
|
Copyright audio-river Edouard DUPIN
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
@@ -4,13 +4,13 @@
|
|||||||
* @license APACHE v2.0 (see license file)
|
* @license APACHE v2.0 (see license file)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "debug.h"
|
#include "debug.hpp"
|
||||||
#include "Interface.h"
|
#include "Interface.hpp"
|
||||||
#include "io/Node.h"
|
#include "io/Node.hpp"
|
||||||
#include <audio/drain/EndPointCallback.h>
|
#include <audio/drain/EndPointCallback.hpp>
|
||||||
#include <audio/drain/EndPointWrite.h>
|
#include <audio/drain/EndPointWrite.hpp>
|
||||||
#include <audio/drain/EndPointRead.h>
|
#include <audio/drain/EndPointRead.hpp>
|
||||||
#include <audio/drain/Volume.h>
|
#include <audio/drain/Volume.hpp>
|
||||||
|
|
||||||
audio::river::Interface::Interface(void) :
|
audio::river::Interface::Interface(void) :
|
||||||
m_node(),
|
m_node(),
|
||||||
@@ -252,7 +252,7 @@ std::vector<int16_t> audio::river::Interface::read(size_t _nbChunk) {
|
|||||||
int32_t nbChunkBuffer = m_circularBuffer.size() / m_map.size();
|
int32_t nbChunkBuffer = m_circularBuffer.size() / m_map.size();
|
||||||
m_mutex.unlock();
|
m_mutex.unlock();
|
||||||
while (nbChunkBuffer < _nbChunk) {
|
while (nbChunkBuffer < _nbChunk) {
|
||||||
usleep(1000);
|
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
||||||
nbChunkBuffer = m_circularBuffer.size() / m_map.size();
|
nbChunkBuffer = m_circularBuffer.size() / m_map.size();
|
||||||
}
|
}
|
||||||
m_mutex.lock();
|
m_mutex.lock();
|
||||||
|
@@ -7,19 +7,19 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <stdint.h>
|
#include <cstdint>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <ememory/memory.h>
|
#include <ememory/memory.hpp>
|
||||||
#include <audio/format.h>
|
#include <audio/format.hpp>
|
||||||
#include <audio/channel.h>
|
#include <audio/channel.hpp>
|
||||||
#include <audio/drain/Process.h>
|
#include <audio/drain/Process.hpp>
|
||||||
#include <audio/drain/EndPointCallback.h>
|
#include <audio/drain/EndPointCallback.hpp>
|
||||||
#include <audio/drain/EndPointWrite.h>
|
#include <audio/drain/EndPointWrite.hpp>
|
||||||
#include <ejson/ejson.h>
|
#include <ejson/ejson.hpp>
|
||||||
#include <etk/os/FSNode.h>
|
#include <etk/os/FSNode.hpp>
|
||||||
#include <audio/Time.h>
|
#include <audio/Time.hpp>
|
||||||
|
|
||||||
namespace audio {
|
namespace audio {
|
||||||
namespace river {
|
namespace river {
|
@@ -4,14 +4,14 @@
|
|||||||
* @license APACHE v2.0 (see license file)
|
* @license APACHE v2.0 (see license file)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "Manager.h"
|
#include "Manager.hpp"
|
||||||
#include "Interface.h"
|
#include "Interface.hpp"
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
#include "io/Manager.h"
|
#include "io/Manager.hpp"
|
||||||
#include "io/Node.h"
|
#include "io/Node.hpp"
|
||||||
#include "debug.h"
|
#include "debug.hpp"
|
||||||
#include <ejson/ejson.h>
|
#include <ejson/ejson.hpp>
|
||||||
|
|
||||||
static std::mutex g_mutex;
|
static std::mutex g_mutex;
|
||||||
static std::vector<ememory::WeakPtr<audio::river::Manager> > g_listOfAllManager;
|
static std::vector<ememory::WeakPtr<audio::river::Manager> > g_listOfAllManager;
|
||||||
|
@@ -6,12 +6,12 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <stdint.h>
|
#include <cstdint>
|
||||||
#include <ememory/memory.h>
|
#include <ememory/memory.hpp>
|
||||||
#include <audio/river/Interface.h>
|
#include <audio/river/Interface.hpp>
|
||||||
#include <audio/format.h>
|
#include <audio/format.hpp>
|
||||||
#include <audio/channel.h>
|
#include <audio/channel.hpp>
|
||||||
#include <ejson/ejson.h>
|
#include <ejson/ejson.hpp>
|
||||||
|
|
||||||
namespace audio {
|
namespace audio {
|
||||||
namespace river {
|
namespace river {
|
@@ -4,7 +4,7 @@
|
|||||||
* @license APACHE v2.0 (see license file)
|
* @license APACHE v2.0 (see license file)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <audio/river/debug.h>
|
#include <audio/river/debug.hpp>
|
||||||
|
|
||||||
|
|
||||||
int32_t audio::river::getLogId() {
|
int32_t audio::river::getLogId() {
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <elog/log.h>
|
#include <elog/log.hpp>
|
||||||
|
|
||||||
namespace audio {
|
namespace audio {
|
||||||
namespace river {
|
namespace river {
|
@@ -4,13 +4,13 @@
|
|||||||
* @license APACHE v2.0 (see license file)
|
* @license APACHE v2.0 (see license file)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <audio/river/io/Group.h>
|
#include <audio/river/io/Group.hpp>
|
||||||
#include <audio/river/debug.h>
|
#include <audio/river/debug.hpp>
|
||||||
#include "Node.h"
|
#include "Node.hpp"
|
||||||
#include "NodeAEC.h"
|
#include "NodeAEC.hpp"
|
||||||
#include "NodeOrchestra.h"
|
#include "NodeOrchestra.hpp"
|
||||||
#include "NodePortAudio.h"
|
#include "NodePortAudio.hpp"
|
||||||
#include "Node.h"
|
#include "Node.hpp"
|
||||||
|
|
||||||
void audio::river::io::Group::createFrom(const ejson::Document& _obj, const std::string& _name) {
|
void audio::river::io::Group::createFrom(const ejson::Document& _obj, const std::string& _name) {
|
||||||
RIVER_INFO("Create Group[" << _name << "] (START) ___________________________");
|
RIVER_INFO("Create Group[" << _name << "] (START) ___________________________");
|
||||||
|
@@ -8,8 +8,8 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <ejson/ejson.h>
|
#include <ejson/ejson.hpp>
|
||||||
#include <etk/os/FSNode.h>
|
#include <etk/os/FSNode.hpp>
|
||||||
|
|
||||||
namespace audio {
|
namespace audio {
|
||||||
namespace river {
|
namespace river {
|
@@ -4,17 +4,17 @@
|
|||||||
* @license APACHE v2.0 (see license file)
|
* @license APACHE v2.0 (see license file)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <audio/river/io/Manager.h>
|
#include <audio/river/io/Manager.hpp>
|
||||||
#include <audio/river/debug.h>
|
#include <audio/river/debug.hpp>
|
||||||
#include <audio/river/river.h>
|
#include <audio/river/river.hpp>
|
||||||
#include <audio/river/io/Node.h>
|
#include <audio/river/io/Node.hpp>
|
||||||
#include <audio/river/io/NodeAEC.h>
|
#include <audio/river/io/NodeAEC.hpp>
|
||||||
#include <audio/river/io/NodeMuxer.h>
|
#include <audio/river/io/NodeMuxer.hpp>
|
||||||
#include <audio/river/io/NodeOrchestra.h>
|
#include <audio/river/io/NodeOrchestra.hpp>
|
||||||
#include <audio/river/io/NodePortAudio.h>
|
#include <audio/river/io/NodePortAudio.hpp>
|
||||||
#include <etk/os/FSNode.h>
|
#include <etk/os/FSNode.hpp>
|
||||||
#include <ememory/memory.h>
|
#include <ememory/memory.hpp>
|
||||||
#include <etk/types.h>
|
#include <etk/types.hpp>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#ifdef AUDIO_RIVER_BUILD_PORTAUDIO
|
#ifdef AUDIO_RIVER_BUILD_PORTAUDIO
|
||||||
@@ -34,7 +34,8 @@ static std::string basicAutoConfig =
|
|||||||
" 'front-left', 'front-right'\n"
|
" 'front-left', 'front-right'\n"
|
||||||
" ],\n"
|
" ],\n"
|
||||||
" type:'auto',\n"
|
" type:'auto',\n"
|
||||||
" nb-chunk:1024\n"
|
" nb-chunk:1024,\n"
|
||||||
|
" mux-demux-type:'float'\n"
|
||||||
" },\n"
|
" },\n"
|
||||||
" speaker:{\n"
|
" speaker:{\n"
|
||||||
" io:'output',\n"
|
" io:'output',\n"
|
||||||
@@ -48,7 +49,8 @@ static std::string basicAutoConfig =
|
|||||||
" ],\n"
|
" ],\n"
|
||||||
" type:'auto',\n"
|
" type:'auto',\n"
|
||||||
" nb-chunk:1024,\n"
|
" nb-chunk:1024,\n"
|
||||||
" volume-name:'MASTER'\n"
|
" volume-name:'MASTER',\n"
|
||||||
|
" mux-demux-type:'float'\n"
|
||||||
" }\n"
|
" }\n"
|
||||||
"}\n";
|
"}\n";
|
||||||
|
|
||||||
|
@@ -9,16 +9,16 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <stdint.h>
|
#include <cstdint>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <ememory/memory.h>
|
#include <ememory/memory.hpp>
|
||||||
#include <audio/format.h>
|
#include <audio/format.hpp>
|
||||||
#include <audio/channel.h>
|
#include <audio/channel.hpp>
|
||||||
#include <ejson/ejson.h>
|
#include <ejson/ejson.hpp>
|
||||||
#include <audio/drain/Volume.h>
|
#include <audio/drain/Volume.hpp>
|
||||||
#include <audio/river/io/Group.h>
|
#include <audio/river/io/Group.hpp>
|
||||||
|
|
||||||
namespace audio {
|
namespace audio {
|
||||||
namespace river {
|
namespace river {
|
@@ -4,8 +4,8 @@
|
|||||||
* @license APACHE v2.0 (see license file)
|
* @license APACHE v2.0 (see license file)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "Node.h"
|
#include "Node.hpp"
|
||||||
#include <audio/river/debug.h>
|
#include <audio/river/debug.hpp>
|
||||||
|
|
||||||
audio::river::io::Node::Node(const std::string& _name, const ejson::Object& _config) :
|
audio::river::io::Node::Node(const std::string& _name, const ejson::Object& _config) :
|
||||||
m_config(_config),
|
m_config(_config),
|
||||||
@@ -79,7 +79,12 @@ audio::river::io::Node::Node(const std::string& _name, const ejson::Object& _con
|
|||||||
if (m_isInput == true) {
|
if (m_isInput == true) {
|
||||||
// Support all ...
|
// Support all ...
|
||||||
} else {
|
} else {
|
||||||
if (muxerFormatType != audio::format_int16_on_int32) {
|
if ( muxerFormatType != audio::format_int8_on_int16
|
||||||
|
&& muxerFormatType != audio::format_int16_on_int32
|
||||||
|
&& muxerFormatType != audio::format_int24_on_int32
|
||||||
|
&& muxerFormatType != audio::format_int32_on_int64
|
||||||
|
&& muxerFormatType != audio::format_float
|
||||||
|
&& muxerFormatType != audio::format_double) {
|
||||||
RIVER_CRITICAL("not supported demuxer type ... " << muxerFormatType << " for OUTPUT set in file:" << muxerDemuxerConfig);
|
RIVER_CRITICAL("not supported demuxer type ... " << muxerFormatType << " for OUTPUT set in file:" << muxerDemuxerConfig);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -209,15 +214,22 @@ void audio::river::io::Node::newOutput(void* _outputBuffer,
|
|||||||
if (_outputBuffer == nullptr) {
|
if (_outputBuffer == nullptr) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
std::vector<int32_t> output;
|
enum audio::format muxerFormatType = m_process.getInputConfig().getFormat();
|
||||||
|
std::vector<uint8_t> outputTmp2;
|
||||||
|
uint32_t nbByteTmpBuffer = audio::getFormatBytes(muxerFormatType)*m_process.getInputConfig().getMap().size()*_nbChunk;
|
||||||
|
RIVER_VERBOSE("resize=" << nbByteTmpBuffer);
|
||||||
|
outputTmp2.resize(nbByteTmpBuffer);
|
||||||
|
|
||||||
|
if (muxerFormatType == audio::format_int8_on_int16) {
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// process 16 bits
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// $$$$ change the int16
|
||||||
|
std::vector<int16_t> output;
|
||||||
RIVER_VERBOSE("resize=" << _nbChunk*m_process.getInputConfig().getMap().size());
|
RIVER_VERBOSE("resize=" << _nbChunk*m_process.getInputConfig().getMap().size());
|
||||||
output.resize(_nbChunk*m_process.getInputConfig().getMap().size(), 0);
|
output.resize(_nbChunk*m_process.getInputConfig().getMap().size(), 0);
|
||||||
// TODO : set here the mixer selection ...
|
// $$$$ change the int16
|
||||||
if (true) {
|
const int16_t* outputTmp = nullptr;
|
||||||
const int32_t* outputTmp = nullptr;
|
|
||||||
std::vector<uint8_t> outputTmp2;
|
|
||||||
RIVER_VERBOSE("resize=" << sizeof(int32_t)*m_process.getInputConfig().getMap().size()*_nbChunk);
|
|
||||||
outputTmp2.resize(sizeof(int32_t)*m_process.getInputConfig().getMap().size()*_nbChunk, 0);
|
|
||||||
for (size_t iii=0; iii< m_list.size(); ++iii) {
|
for (size_t iii=0; iii< m_list.size(); ++iii) {
|
||||||
if (m_list[iii] == nullptr) {
|
if (m_list[iii] == nullptr) {
|
||||||
continue;
|
continue;
|
||||||
@@ -227,19 +239,144 @@ void audio::river::io::Node::newOutput(void* _outputBuffer,
|
|||||||
}
|
}
|
||||||
RIVER_VERBOSE(" IO name="<< m_list[iii]->getName() << " " << iii);
|
RIVER_VERBOSE(" IO name="<< m_list[iii]->getName() << " " << iii);
|
||||||
// clear datas ...
|
// clear datas ...
|
||||||
memset(&outputTmp2[0], 0, sizeof(int32_t)*m_process.getInputConfig().getMap().size()*_nbChunk);
|
memset(&outputTmp2[0], 0, nbByteTmpBuffer);
|
||||||
RIVER_VERBOSE(" request Data="<< _nbChunk << " time=" << _time);
|
RIVER_VERBOSE(" request Data="<< _nbChunk << " time=" << _time);
|
||||||
m_list[iii]->systemNeedOutputData(_time, &outputTmp2[0], _nbChunk, sizeof(int32_t)*m_process.getInputConfig().getMap().size());
|
m_list[iii]->systemNeedOutputData(_time, &outputTmp2[0], _nbChunk, audio::getFormatBytes(muxerFormatType)*m_process.getInputConfig().getMap().size());
|
||||||
|
// $$$$ change the int16
|
||||||
|
outputTmp = reinterpret_cast<const int16_t*>(&outputTmp2[0]);
|
||||||
|
RIVER_VERBOSE(" Mix it ...");
|
||||||
|
// Add data to the output tmp buffer:
|
||||||
|
for (size_t kkk=0; kkk<output.size(); ++kkk) {
|
||||||
|
output[kkk] += outputTmp[kkk];
|
||||||
|
}
|
||||||
|
// TODO : if a signal is upper than 256* the maximum of 1 it can create a real problem ...
|
||||||
|
}
|
||||||
|
RIVER_VERBOSE(" End stack process data ...");
|
||||||
|
m_process.processIn(&output[0], _nbChunk, _outputBuffer, _nbChunk);
|
||||||
|
} else if ( muxerFormatType == audio::format_int16_on_int32
|
||||||
|
|| muxerFormatType == audio::format_int24_on_int32) {
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// process 32 bits
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
std::vector<int32_t> output;
|
||||||
|
RIVER_VERBOSE("resize=" << _nbChunk*m_process.getInputConfig().getMap().size());
|
||||||
|
output.resize(_nbChunk*m_process.getInputConfig().getMap().size(), 0);
|
||||||
|
const int32_t* outputTmp = nullptr;
|
||||||
|
for (size_t iii=0; iii< m_list.size(); ++iii) {
|
||||||
|
if (m_list[iii] == nullptr) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (m_list[iii]->getMode() != audio::river::modeInterface_output) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
RIVER_VERBOSE(" IO name="<< m_list[iii]->getName() << " " << iii);
|
||||||
|
// clear datas ...
|
||||||
|
memset(&outputTmp2[0], 0, nbByteTmpBuffer);
|
||||||
|
RIVER_VERBOSE(" request Data="<< _nbChunk << " time=" << _time);
|
||||||
|
m_list[iii]->systemNeedOutputData(_time, &outputTmp2[0], _nbChunk, audio::getFormatBytes(muxerFormatType)*m_process.getInputConfig().getMap().size());
|
||||||
outputTmp = reinterpret_cast<const int32_t*>(&outputTmp2[0]);
|
outputTmp = reinterpret_cast<const int32_t*>(&outputTmp2[0]);
|
||||||
RIVER_VERBOSE(" Mix it ...");
|
RIVER_VERBOSE(" Mix it ...");
|
||||||
// Add data to the output tmp buffer :
|
// Add data to the output tmp buffer:
|
||||||
|
for (size_t kkk=0; kkk<output.size(); ++kkk) {
|
||||||
|
output[kkk] += outputTmp[kkk];
|
||||||
|
}
|
||||||
|
// TODO : if a signal is upper than 256* (for 24 bits) or 65335* (for 16 bits) the maximum of 1 it can create a real problem ...
|
||||||
|
}
|
||||||
|
RIVER_VERBOSE(" End stack process data ...");
|
||||||
|
m_process.processIn(&output[0], _nbChunk, _outputBuffer, _nbChunk);
|
||||||
|
} else if (muxerFormatType == audio::format_int32_on_int64) {
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// process 64 bits
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
std::vector<int64_t> output;
|
||||||
|
RIVER_VERBOSE("resize=" << _nbChunk*m_process.getInputConfig().getMap().size());
|
||||||
|
output.resize(_nbChunk*m_process.getInputConfig().getMap().size(), 0);
|
||||||
|
const int64_t* outputTmp = nullptr;
|
||||||
|
for (size_t iii=0; iii< m_list.size(); ++iii) {
|
||||||
|
if (m_list[iii] == nullptr) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (m_list[iii]->getMode() != audio::river::modeInterface_output) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
RIVER_VERBOSE(" IO name="<< m_list[iii]->getName() << " " << iii);
|
||||||
|
// clear datas ...
|
||||||
|
memset(&outputTmp2[0], 0, nbByteTmpBuffer);
|
||||||
|
RIVER_VERBOSE(" request Data="<< _nbChunk << " time=" << _time);
|
||||||
|
m_list[iii]->systemNeedOutputData(_time, &outputTmp2[0], _nbChunk, audio::getFormatBytes(muxerFormatType)*m_process.getInputConfig().getMap().size());
|
||||||
|
outputTmp = reinterpret_cast<const int64_t*>(&outputTmp2[0]);
|
||||||
|
RIVER_VERBOSE(" Mix it ...");
|
||||||
|
// Add data to the output tmp buffer:
|
||||||
|
for (size_t kkk=0; kkk<output.size(); ++kkk) {
|
||||||
|
output[kkk] += outputTmp[kkk];
|
||||||
|
}
|
||||||
|
// TODO : if a signal is upper than 2000000000* the maximum of 1 it can create a real problem ...
|
||||||
|
}
|
||||||
|
RIVER_VERBOSE(" End stack process data ...");
|
||||||
|
m_process.processIn(&output[0], _nbChunk, _outputBuffer, _nbChunk);
|
||||||
|
} else if (muxerFormatType == audio::format_float) {
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// process 32 bits FLOAT
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
std::vector<float> output;
|
||||||
|
RIVER_VERBOSE("resize=" << _nbChunk*m_process.getInputConfig().getMap().size());
|
||||||
|
output.resize(_nbChunk*m_process.getInputConfig().getMap().size(), 0);
|
||||||
|
const float* outputTmp = nullptr;
|
||||||
|
for (size_t iii=0; iii< m_list.size(); ++iii) {
|
||||||
|
if (m_list[iii] == nullptr) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (m_list[iii]->getMode() != audio::river::modeInterface_output) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
RIVER_VERBOSE(" IO name="<< m_list[iii]->getName() << " " << iii);
|
||||||
|
// clear datas ...
|
||||||
|
memset(&outputTmp2[0], 0, nbByteTmpBuffer);
|
||||||
|
RIVER_VERBOSE(" request Data="<< _nbChunk << " time=" << _time);
|
||||||
|
m_list[iii]->systemNeedOutputData(_time, &outputTmp2[0], _nbChunk, audio::getFormatBytes(muxerFormatType)*m_process.getInputConfig().getMap().size());
|
||||||
|
outputTmp = reinterpret_cast<const float*>(&outputTmp2[0]);
|
||||||
|
RIVER_VERBOSE(" Mix it ...");
|
||||||
|
// Add data to the output tmp buffer:
|
||||||
for (size_t kkk=0; kkk<output.size(); ++kkk) {
|
for (size_t kkk=0; kkk<output.size(); ++kkk) {
|
||||||
output[kkk] += outputTmp[kkk];
|
output[kkk] += outputTmp[kkk];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
RIVER_VERBOSE(" End stack process data ...");
|
||||||
|
m_process.processIn(&output[0], _nbChunk, _outputBuffer, _nbChunk);
|
||||||
|
} else if (muxerFormatType == audio::format_double) {
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// process 64 bits FLOAT
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
std::vector<double> output;
|
||||||
|
RIVER_VERBOSE("resize=" << _nbChunk*m_process.getInputConfig().getMap().size());
|
||||||
|
output.resize(_nbChunk*m_process.getInputConfig().getMap().size(), 0);
|
||||||
|
const double* outputTmp = nullptr;
|
||||||
|
for (size_t iii=0; iii< m_list.size(); ++iii) {
|
||||||
|
if (m_list[iii] == nullptr) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (m_list[iii]->getMode() != audio::river::modeInterface_output) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
RIVER_VERBOSE(" IO name="<< m_list[iii]->getName() << " " << iii);
|
||||||
|
// clear datas ...
|
||||||
|
memset(&outputTmp2[0], 0, nbByteTmpBuffer);
|
||||||
|
RIVER_VERBOSE(" request Data="<< _nbChunk << " time=" << _time);
|
||||||
|
m_list[iii]->systemNeedOutputData(_time, &outputTmp2[0], _nbChunk, audio::getFormatBytes(muxerFormatType)*m_process.getInputConfig().getMap().size());
|
||||||
|
outputTmp = reinterpret_cast<const double*>(&outputTmp2[0]);
|
||||||
|
RIVER_VERBOSE(" Mix it ...");
|
||||||
|
// Add data to the output tmp buffer:
|
||||||
|
for (size_t kkk=0; kkk<output.size(); ++kkk) {
|
||||||
|
output[kkk] += outputTmp[kkk];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
RIVER_VERBOSE(" End stack process data ...");
|
RIVER_VERBOSE(" End stack process data ...");
|
||||||
m_process.processIn(&output[0], _nbChunk, _outputBuffer, _nbChunk);
|
m_process.processIn(&output[0], _nbChunk, _outputBuffer, _nbChunk);
|
||||||
|
} else {
|
||||||
|
RIVER_ERROR("Wrong demuxer type: " << muxerFormatType);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// The feedback get the real output data (after processing ...==> then no nneed to specify for each channels
|
||||||
RIVER_VERBOSE(" Feedback :");
|
RIVER_VERBOSE(" Feedback :");
|
||||||
for (size_t iii=0; iii< m_list.size(); ++iii) {
|
for (size_t iii=0; iii< m_list.size(); ++iii) {
|
||||||
if (m_list[iii] == nullptr) {
|
if (m_list[iii] == nullptr) {
|
||||||
|
@@ -8,17 +8,17 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <stdint.h>
|
#include <cstdint>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <ememory/memory.h>
|
#include <ememory/memory.hpp>
|
||||||
#include <audio/format.h>
|
#include <audio/format.hpp>
|
||||||
#include <audio/channel.h>
|
#include <audio/channel.hpp>
|
||||||
#include "Manager.h"
|
#include "Manager.hpp"
|
||||||
#include <audio/river/Interface.h>
|
#include <audio/river/Interface.hpp>
|
||||||
#include <audio/drain/IOFormatInterface.h>
|
#include <audio/drain/IOFormatInterface.hpp>
|
||||||
#include <audio/drain/Volume.h>
|
#include <audio/drain/Volume.hpp>
|
||||||
#include <etk/os/FSNode.h>
|
#include <etk/os/FSNode.hpp>
|
||||||
|
|
||||||
namespace audio {
|
namespace audio {
|
||||||
namespace river {
|
namespace river {
|
@@ -4,10 +4,10 @@
|
|||||||
* @license APACHE v2.0 (see license file)
|
* @license APACHE v2.0 (see license file)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <audio/river/io/NodeAEC.h>
|
#include <audio/river/io/NodeAEC.hpp>
|
||||||
#include <audio/river/debug.h>
|
#include <audio/river/debug.hpp>
|
||||||
#include <etk/types.h>
|
#include <etk/types.hpp>
|
||||||
#include <ememory/memory.h>
|
#include <ememory/memory.hpp>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
ememory::SharedPtr<audio::river::io::NodeAEC> audio::river::io::NodeAEC::create(const std::string& _name, const ejson::Object& _config) {
|
ememory::SharedPtr<audio::river::io::NodeAEC> audio::river::io::NodeAEC::create(const std::string& _name, const ejson::Object& _config) {
|
||||||
|
@@ -5,9 +5,9 @@
|
|||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <audio/river/io/Node.h>
|
#include <audio/river/io/Node.hpp>
|
||||||
#include <audio/river/Interface.h>
|
#include <audio/river/Interface.hpp>
|
||||||
#include <audio/drain/CircularBuffer.h>
|
#include <audio/drain/CircularBuffer.hpp>
|
||||||
|
|
||||||
namespace audio {
|
namespace audio {
|
||||||
namespace river {
|
namespace river {
|
@@ -6,9 +6,9 @@
|
|||||||
|
|
||||||
#ifdef AUDIO_RIVER_BUILD_FILE
|
#ifdef AUDIO_RIVER_BUILD_FILE
|
||||||
|
|
||||||
#include <audio/river/io/NodeFile.h>
|
#include <audio/river/io/NodeFile.hpp>
|
||||||
#include <audio/river/debug.h>
|
#include <audio/river/debug.hpp>
|
||||||
#include <ememory/memory.h>
|
#include <ememory/memory.hpp>
|
||||||
|
|
||||||
int32_t audio::river::io::NodeFile::recordCallback(const void* _inputBuffer,
|
int32_t audio::river::io::NodeFile::recordCallback(const void* _inputBuffer,
|
||||||
const audio::Time& _timeInput,
|
const audio::Time& _timeInput,
|
||||||
|
@@ -7,8 +7,8 @@
|
|||||||
|
|
||||||
#ifdef AUDIO_RIVER_BUILD_FILE
|
#ifdef AUDIO_RIVER_BUILD_FILE
|
||||||
|
|
||||||
#include <audio/river/io/Node.h>
|
#include <audio/river/io/Node.hpp>
|
||||||
#include <audio/orchestra/Interface.h>
|
#include <audio/orchestra/Interface.hpp>
|
||||||
|
|
||||||
namespace audio {
|
namespace audio {
|
||||||
namespace river {
|
namespace river {
|
@@ -4,10 +4,10 @@
|
|||||||
* @license APACHE v2.0 (see license file)
|
* @license APACHE v2.0 (see license file)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <audio/river/io/NodeMuxer.h>
|
#include <audio/river/io/NodeMuxer.hpp>
|
||||||
#include <audio/river/debug.h>
|
#include <audio/river/debug.hpp>
|
||||||
#include <etk/types.h>
|
#include <etk/types.hpp>
|
||||||
#include <ememory/memory.h>
|
#include <ememory/memory.hpp>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
ememory::SharedPtr<audio::river::io::NodeMuxer> audio::river::io::NodeMuxer::create(const std::string& _name, const ejson::Object& _config) {
|
ememory::SharedPtr<audio::river::io::NodeMuxer> audio::river::io::NodeMuxer::create(const std::string& _name, const ejson::Object& _config) {
|
||||||
|
@@ -5,9 +5,9 @@
|
|||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <audio/river/io/Node.h>
|
#include <audio/river/io/Node.hpp>
|
||||||
#include <audio/river/Interface.h>
|
#include <audio/river/Interface.hpp>
|
||||||
#include <audio/drain/CircularBuffer.h>
|
#include <audio/drain/CircularBuffer.hpp>
|
||||||
|
|
||||||
namespace audio {
|
namespace audio {
|
||||||
namespace river {
|
namespace river {
|
@@ -6,9 +6,9 @@
|
|||||||
|
|
||||||
#ifdef AUDIO_RIVER_BUILD_ORCHESTRA
|
#ifdef AUDIO_RIVER_BUILD_ORCHESTRA
|
||||||
|
|
||||||
#include <audio/river/io/NodeOrchestra.h>
|
#include <audio/river/io/NodeOrchestra.hpp>
|
||||||
#include <audio/river/debug.h>
|
#include <audio/river/debug.hpp>
|
||||||
#include <ememory/memory.h>
|
#include <ememory/memory.hpp>
|
||||||
|
|
||||||
int32_t audio::river::io::NodeOrchestra::recordCallback(const void* _inputBuffer,
|
int32_t audio::river::io::NodeOrchestra::recordCallback(const void* _inputBuffer,
|
||||||
const audio::Time& _timeInput,
|
const audio::Time& _timeInput,
|
||||||
@@ -27,7 +27,7 @@ int32_t audio::river::io::NodeOrchestra::playbackCallback(void* _outputBuffer,
|
|||||||
const std::vector<audio::orchestra::status>& _status) {
|
const std::vector<audio::orchestra::status>& _status) {
|
||||||
std::unique_lock<std::mutex> lock(m_mutex);
|
std::unique_lock<std::mutex> lock(m_mutex);
|
||||||
// TODO : Manage status ...
|
// TODO : Manage status ...
|
||||||
RIVER_VERBOSE("data Output size request :" << _nbChunk << " [BEGIN] status=" << _status << " nbIO=" << m_list.size());
|
RIVER_VERBOSE("data Output size request :" << _nbChunk << " [BEGIN] status=" << _status << " nbIO=" << m_list.size() << " data=" << uint64_t(_outputBuffer));
|
||||||
newOutput(_outputBuffer, _nbChunk, _timeOutput);
|
newOutput(_outputBuffer, _nbChunk, _timeOutput);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -7,8 +7,8 @@
|
|||||||
|
|
||||||
#ifdef AUDIO_RIVER_BUILD_ORCHESTRA
|
#ifdef AUDIO_RIVER_BUILD_ORCHESTRA
|
||||||
|
|
||||||
#include <audio/river/io/Node.h>
|
#include <audio/river/io/Node.hpp>
|
||||||
#include <audio/orchestra/Interface.h>
|
#include <audio/orchestra/Interface.hpp>
|
||||||
|
|
||||||
namespace audio {
|
namespace audio {
|
||||||
namespace river {
|
namespace river {
|
@@ -6,11 +6,11 @@
|
|||||||
|
|
||||||
#ifdef AUDIO_RIVER_BUILD_PORTAUDIO
|
#ifdef AUDIO_RIVER_BUILD_PORTAUDIO
|
||||||
|
|
||||||
#include <audio/river/io/NodePortAudio.h>
|
#include <audio/river/io/NodePortAudio.hpp>
|
||||||
#include <audio/river/debug.h>
|
#include <audio/river/debug.hpp>
|
||||||
#include <ememory/memory.h>
|
#include <ememory/memory.hpp>
|
||||||
#include <audio/Time.h>
|
#include <audio/Time.hpp>
|
||||||
#include <audio/Duration.h>
|
#include <audio/Duration.hpp>
|
||||||
|
|
||||||
static int portAudioStreamCallback(const void *_input,
|
static int portAudioStreamCallback(const void *_input,
|
||||||
void *_output,
|
void *_output,
|
||||||
|
@@ -7,9 +7,9 @@
|
|||||||
|
|
||||||
#ifdef AUDIO_RIVER_BUILD_PORTAUDIO
|
#ifdef AUDIO_RIVER_BUILD_PORTAUDIO
|
||||||
|
|
||||||
#include <audio/river/Interface.h>
|
#include <audio/river/Interface.hpp>
|
||||||
#include <audio/river/io/Node.h>
|
#include <audio/river/io/Node.hpp>
|
||||||
#include <portaudio/portaudio.h>
|
#include <portaudio/portaudio.hpp>
|
||||||
|
|
||||||
namespace audio {
|
namespace audio {
|
||||||
namespace river {
|
namespace river {
|
@@ -4,9 +4,9 @@
|
|||||||
* @license APACHE v2.0 (see license file)
|
* @license APACHE v2.0 (see license file)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <audio/river/river.h>
|
#include <audio/river/river.hpp>
|
||||||
#include <audio/river/debug.h>
|
#include <audio/river/debug.hpp>
|
||||||
#include <audio/river/io/Manager.h>
|
#include <audio/river/io/Manager.hpp>
|
||||||
|
|
||||||
static bool river_isInit = false;
|
static bool river_isInit = false;
|
||||||
static std::string river_configFile = "";
|
static std::string river_configFile = "";
|
||||||
|
@@ -5,9 +5,14 @@
|
|||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <etk/types.h>
|
#include <etk/types.hpp>
|
||||||
|
/**
|
||||||
|
* @brief Audio library namespace
|
||||||
|
*/
|
||||||
namespace audio {
|
namespace audio {
|
||||||
|
/**
|
||||||
|
* @brief Audio-river library namespace
|
||||||
|
*/
|
||||||
namespace river {
|
namespace river {
|
||||||
/**
|
/**
|
||||||
* @brief Initialize the River Library
|
* @brief Initialize the River Library
|
@@ -1,79 +0,0 @@
|
|||||||
cmake_minimum_required(VERSION 2.8.3)
|
|
||||||
project(audio_river)
|
|
||||||
|
|
||||||
set(CMAKE_VERBOSE_MAKEFILE ON)
|
|
||||||
|
|
||||||
## Find catkin macros and libraries
|
|
||||||
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
|
|
||||||
## is used, also find other catkin packages
|
|
||||||
find_package(catkin REQUIRED COMPONENTS
|
|
||||||
audio_drain
|
|
||||||
audio
|
|
||||||
audio_orchestra
|
|
||||||
ejson
|
|
||||||
)
|
|
||||||
|
|
||||||
###################################
|
|
||||||
## catkin specific configuration ##
|
|
||||||
###################################
|
|
||||||
## The catkin_package macro generates cmake config files for your package
|
|
||||||
## Declare things to be passed to dependent projects
|
|
||||||
## INCLUDE_DIRS: uncomment this if you package contains header files
|
|
||||||
## LIBRARIES: libraries you create in this project that dependent projects also need
|
|
||||||
## CATKIN_DEPENDS: catkin_packages dependent projects also need
|
|
||||||
## DEPENDS: system dependencies of this project that dependent projects also need
|
|
||||||
catkin_package(
|
|
||||||
INCLUDE_DIRS ../
|
|
||||||
LIBRARIES ${PROJECT_NAME}
|
|
||||||
CATKIN_DEPENDS audio_orchestra audio audio_drain ejson
|
|
||||||
DEPENDS system_lib
|
|
||||||
)
|
|
||||||
|
|
||||||
###########
|
|
||||||
## Build ##
|
|
||||||
###########
|
|
||||||
|
|
||||||
## Specify additional locations of header files
|
|
||||||
## Your package locations should be listed before other locations
|
|
||||||
include_directories(
|
|
||||||
..
|
|
||||||
${catkin_INCLUDE_DIRS}
|
|
||||||
)
|
|
||||||
|
|
||||||
## Declare a cpp library
|
|
||||||
add_library(${PROJECT_NAME}
|
|
||||||
../audio/river/debug.cpp
|
|
||||||
../audio/river/river.cpp
|
|
||||||
../audio/river/Manager.cpp
|
|
||||||
../audio/river/Interface.cpp
|
|
||||||
../audio/river/io/Group.cpp
|
|
||||||
../audio/river/io/Node.cpp
|
|
||||||
../audio/river/io/NodeOrchestra.cpp
|
|
||||||
../audio/river/io/NodePortAudio.cpp
|
|
||||||
../audio/river/io/NodeAEC.cpp
|
|
||||||
../audio/river/io/NodeMuxer.cpp
|
|
||||||
../audio/river/io/Manager.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
add_definitions(-DAUDIO_RIVER_BUILD_ORCHESTRA)
|
|
||||||
|
|
||||||
## Specify libraries to link a library or executable target against
|
|
||||||
target_link_libraries(${PROJECT_NAME}
|
|
||||||
${catkin_LIBRARIES}
|
|
||||||
)
|
|
||||||
|
|
||||||
#############
|
|
||||||
## Install ##
|
|
||||||
#############
|
|
||||||
|
|
||||||
## Mark executables and/or libraries for installation
|
|
||||||
install(TARGETS ${PROJECT_NAME}
|
|
||||||
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
|
|
||||||
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
|
|
||||||
)
|
|
||||||
|
|
||||||
## Mark cpp header files for installation
|
|
||||||
install(DIRECTORY ../audio/river/
|
|
||||||
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
|
|
||||||
FILES_MATCHING PATTERN "*.h"
|
|
||||||
)
|
|
@@ -1,17 +0,0 @@
|
|||||||
<?xml version="1.0"?>
|
|
||||||
<package>
|
|
||||||
<name>audio_river</name>
|
|
||||||
<version>0.3.0</version>
|
|
||||||
<description>Ewol River Intrerface : Is to multiple acces on different format on Audio IO</description>
|
|
||||||
<maintainer email="yui.heero@gmail.com">Edouard DUPIN</maintainer>
|
|
||||||
<license>Apache-2.0</license>
|
|
||||||
<build_depend>ejson</build_depend>
|
|
||||||
<build_depend>audio</build_depend>
|
|
||||||
<build_depend>audio_orchestra</build_depend>
|
|
||||||
<build_depend>audio_drain</build_depend>
|
|
||||||
<buildtool_depend>catkin</buildtool_depend>
|
|
||||||
<run_depend>ejson</run_depend>
|
|
||||||
<run_depend>audio</run_depend>
|
|
||||||
<run_depend>audio_orchestra</run_depend>
|
|
||||||
<run_depend>audio_drain</run_depend>
|
|
||||||
</package>
|
|
@@ -1,41 +0,0 @@
|
|||||||
=?=RIVER: Bases =?=
|
|
||||||
__________________________________________________
|
|
||||||
[right][tutorial[000_Build | Next: Tutorals]][/right]
|
|
||||||
|
|
||||||
=== Overview:===
|
|
||||||
|
|
||||||
===User requires:===
|
|
||||||
To use ewol you need to know only C++ language. It could be usefull to know:
|
|
||||||
:** [b]Python[/b] for all build tool.
|
|
||||||
:** [b]git[/b] for all version management
|
|
||||||
:** [b]Audio[/b] Basic knowlege of audio streaming af data organisation.
|
|
||||||
|
|
||||||
=== Architecture:===
|
|
||||||
River has been designed to replace the pulseAudio basic asyncronous interface that create
|
|
||||||
more problem that it will solve. The second point is that is not enougth portable to be
|
|
||||||
embended in a proprietary software without distributing all the sources (Ios).
|
|
||||||
|
|
||||||
Start at this point we will have simple objectives :
|
|
||||||
:** manage multiple Low level interface: (done by the [lib[airtaudio | AirTAudio]] interface):
|
|
||||||
::** for linux
|
|
||||||
:::** Alsa
|
|
||||||
:::** Pulse
|
|
||||||
:::** Oss
|
|
||||||
::** for Mac-OsX
|
|
||||||
:::** CoreAudio
|
|
||||||
::** for IOs
|
|
||||||
:::** CoreAudio (embended version)
|
|
||||||
::** for Windows
|
|
||||||
:::** ASIO
|
|
||||||
::** For Android
|
|
||||||
:::** Java (JDK-6)
|
|
||||||
:** Synchronous interface ==> no delay and reduce latency
|
|
||||||
:** Manage the thread priority (need sometimes to be more reactive)
|
|
||||||
:** manage mixing of some flow (2 inputs stereo and the user want 1 input quad)
|
|
||||||
:** AEC Acoustic Echo Cancelation (TODO : in the current implementation we have a simple sound cutter)
|
|
||||||
:** Equalizer (done with [lib[drain | Drain])
|
|
||||||
:** Resmpling (done by the libspeexDSP)
|
|
||||||
:** Correct volume management (and configurable)
|
|
||||||
:** Fade-in and Fade-out (done with [lib[drain | Drain])
|
|
||||||
:** Channel reorganisation (done with [lib[drain | Drain])
|
|
||||||
:** A correct feedback interface
|
|
100
doc/build.md
Normal file
100
doc/build.md
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
Build lib & build sample {#audio_river_build}
|
||||||
|
========================
|
||||||
|
|
||||||
|
@tableofcontents
|
||||||
|
|
||||||
|
Download: {#audio_river_build_download}
|
||||||
|
=========
|
||||||
|
|
||||||
|
ege use some tools to manage source and build it:
|
||||||
|
|
||||||
|
need google repo: {#audio_river_build_download_repo}
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
see: http://source.android.com/source/downloading.html#installing-repo
|
||||||
|
|
||||||
|
On all platform:
|
||||||
|
```{.sh}
|
||||||
|
mkdir ~/.bin
|
||||||
|
PATH=~/.bin:$PATH
|
||||||
|
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/.bin/repo
|
||||||
|
chmod a+x ~/.bin/repo
|
||||||
|
```
|
||||||
|
|
||||||
|
On ubuntu
|
||||||
|
```{.sh}
|
||||||
|
sudo apt-get install repo
|
||||||
|
```
|
||||||
|
|
||||||
|
On archlinux
|
||||||
|
```{.sh}
|
||||||
|
sudo pacman -S repo
|
||||||
|
```
|
||||||
|
|
||||||
|
lutin (build-system): {#audio_river_build_download_lutin}
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
```{.sh}
|
||||||
|
pip install lutin --user
|
||||||
|
# optionnal dependency of lutin (manage image changing size for application release)
|
||||||
|
pip install pillow --user
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
dependency: {#audio_river_build_download_dependency}
|
||||||
|
-----------
|
||||||
|
|
||||||
|
```{.sh}
|
||||||
|
mkdir -p WORKING_DIRECTORY/framework
|
||||||
|
cd WORKING_DIRECTORY/framework
|
||||||
|
repo init -u git://github.com/atria-soft/manifest.git
|
||||||
|
repo sync -j8
|
||||||
|
cd ../..
|
||||||
|
```
|
||||||
|
|
||||||
|
sources: {#audio_river_build_download_sources}
|
||||||
|
--------
|
||||||
|
|
||||||
|
They are already download in the repo manifest in:
|
||||||
|
|
||||||
|
```{.sh}
|
||||||
|
cd WORKING_DIRECTORY/framework/musicdsp/audio-river
|
||||||
|
```
|
||||||
|
|
||||||
|
Build: {#audio_river_build_build}
|
||||||
|
======
|
||||||
|
|
||||||
|
you must stay in zour working directory...
|
||||||
|
```{.sh}
|
||||||
|
cd WORKING_DIRECTORY
|
||||||
|
```
|
||||||
|
|
||||||
|
library: {#audio_river_build_build_library}
|
||||||
|
--------
|
||||||
|
|
||||||
|
```{.sh}
|
||||||
|
lutin -mdebug audio-river
|
||||||
|
```
|
||||||
|
|
||||||
|
Sample: {#audio_river_build_build_sample}
|
||||||
|
-------
|
||||||
|
|
||||||
|
```{.sh}
|
||||||
|
lutin -mdebug audio-river-sample-read?run
|
||||||
|
lutin -mdebug audio-river-sample-write?run
|
||||||
|
```
|
||||||
|
|
||||||
|
A fast way:
|
||||||
|
```{.sh}
|
||||||
|
lutin -mdebug audio-river-*
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Run sample: {#audio_river_build_run_sample}
|
||||||
|
===========
|
||||||
|
|
||||||
|
in distinct bash:
|
||||||
|
```{.sh}
|
||||||
|
lutin -mdebug audio-river-sample-read?run
|
||||||
|
lutin -mdebug audio-river-sample-write?run
|
||||||
|
```
|
77
doc/configFile.md
Normal file
77
doc/configFile.md
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
River configuration file {#audio_river_config_file}
|
||||||
|
========================
|
||||||
|
|
||||||
|
@tableofcontents
|
||||||
|
|
||||||
|
Objectifs: {#audio_river_config_file_objectif}
|
||||||
|
==========
|
||||||
|
|
||||||
|
- Understand the architecture of the configuration file.
|
||||||
|
- all that can be done with it.
|
||||||
|
|
||||||
|
|
||||||
|
Basis: {#audio_river_config_file_bases}
|
||||||
|
======
|
||||||
|
|
||||||
|
The river configuration file is a json file. We use @ref ejson_mainpage_what to parse it then we have some writing facilities.
|
||||||
|
|
||||||
|
|
||||||
|
River provide a list a harware interface and virtual interface.
|
||||||
|
|
||||||
|
|
||||||
|
The hardware interface are provided by @ref audio_orchestra_mainpage_what then we will plug on every platform.
|
||||||
|
|
||||||
|
|
||||||
|
The file is simply architecture around a list of object:
|
||||||
|
|
||||||
|
```{.json}
|
||||||
|
{
|
||||||
|
"speaker":{
|
||||||
|
|
||||||
|
},
|
||||||
|
"microphone":{
|
||||||
|
|
||||||
|
},
|
||||||
|
"mixed-in-out":{
|
||||||
|
|
||||||
|
},
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
With this config we declare 3 interfaces : speaker, microphone and mixed-in-out.
|
||||||
|
|
||||||
|
|
||||||
|
Harware configuration: {#audio_river_config_file_hw_config}
|
||||||
|
======================
|
||||||
|
|
||||||
|
In every interface we need to define some Element:
|
||||||
|
- "io" : Can be input/output/... depending of virtual interface...
|
||||||
|
- "map-on": An object to configure airtaudio interface.
|
||||||
|
- "frequency": 0 to automatic select one. Or the frequency to open harware device
|
||||||
|
- "channel-map": List of all channel in the stream:
|
||||||
|
* "front-left"
|
||||||
|
* "front-center"
|
||||||
|
* "front-right"
|
||||||
|
* "rear-left"
|
||||||
|
* "rear-center"
|
||||||
|
* "rear-right"
|
||||||
|
* "surround-left",
|
||||||
|
* "surround-right",
|
||||||
|
* "sub-woofer",
|
||||||
|
* "lfe"
|
||||||
|
- "type": Fomat to open the stream:
|
||||||
|
* "auto": Detect the best type
|
||||||
|
* "int8",
|
||||||
|
* "int8-on-int16",
|
||||||
|
* "int16",
|
||||||
|
* "int16-on-int32",
|
||||||
|
* "int24",
|
||||||
|
* "int32",
|
||||||
|
* "int32-on-int64",
|
||||||
|
* "int64",
|
||||||
|
* "float",
|
||||||
|
* "double"
|
||||||
|
- "nb-chunk": Number of chunk to open the stream.
|
||||||
|
|
||||||
|
|
||||||
|
|
36
doc/faq.bb
36
doc/faq.bb
@@ -1,36 +0,0 @@
|
|||||||
=?= FAQ =?=
|
|
||||||
|
|
||||||
== What is ewol licence ==
|
|
||||||
|
|
||||||
This is really simple : APACHE-2 :
|
|
||||||
|
|
||||||
Copyright ewol Edouard DUPIN
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
[[http://www.apache.org/licenses/LICENSE-2.0]]
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
== Why we use "DECLARE_FACTORY" Macro ? ==
|
|
||||||
|
|
||||||
For some reason!!! But everything might be clear:
|
|
||||||
:** In ewol we masively use std::shared_ptr<xxx> (I have create my own but it is not "standard" (I like when we use genecic system)).
|
|
||||||
:** The main class : [class[ewol::Object]] herited from [i]std::enable_shared_from_this<Object>[/i] to permit to access at his own [i]std::shared_ptr[/i].
|
|
||||||
:** Acces At his own [i]std::shared_ptr[/i] is not allowed in the class contructor/destructor.
|
|
||||||
:** Many time for meta-widget we need to propagate our [i]std::shared_ptr[/i] in child.
|
|
||||||
|
|
||||||
Then for all these reasons, I have create a simple MACRO that create a static template funtion that create the object and just after
|
|
||||||
creation call the init(...) function to permit to create a complex widget or others with some writing convinience.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@@ -1,25 +1,30 @@
|
|||||||
|
Read stream feedback {#audio_river_feedback}
|
||||||
|
====================
|
||||||
|
|
||||||
=== Objectif ===
|
@tableofcontents
|
||||||
:** Implement a feedback.
|
|
||||||
|
|
||||||
=== Bases: ===
|
Objectifs: {#audio_river_feedback_objectif}
|
||||||
|
==========
|
||||||
|
|
||||||
|
- Implement a feedback.
|
||||||
|
|
||||||
|
Bases: {#audio_river_feedback_base}
|
||||||
|
======
|
||||||
|
|
||||||
A feedback is a stream that is generated by an output.
|
A feedback is a stream that is generated by an output.
|
||||||
|
|
||||||
To get a feedback this is the same implementation of an input and link it on an output.
|
To get a feedback this is the same implementation of an input and link it on an output.
|
||||||
|
|
||||||
|
|
||||||
What change :
|
What change:
|
||||||
|
|
||||||
[code style=c++]
|
```{.cpp}
|
||||||
//Get the generic feedback on speaker:
|
//Get the generic feedback on speaker:
|
||||||
interface = manager->createFeedback(48000,
|
interface = manager->createFeedback(48000,
|
||||||
std::vector<audio::channel>(),
|
std::vector<audio::channel>(),
|
||||||
audio::format_int16,
|
audio::format_int16,
|
||||||
"speaker");
|
"speaker");
|
||||||
[/code]
|
```
|
||||||
|
|
||||||
[note]
|
**Note:** Input interface does not provide feedback.
|
||||||
Input interface does not provide feedback.
|
|
||||||
[/note]
|
|
||||||
|
|
69
doc/index.bb
69
doc/index.bb
@@ -1,69 +0,0 @@
|
|||||||
== [center]RIVER library[/center] ==
|
|
||||||
__________________________________________________
|
|
||||||
|
|
||||||
===What is RIVER, and how can I use it?===
|
|
||||||
RIVER is a multi-platform library to manage the input and output audio flow.
|
|
||||||
It can be compared with PulseAudio or Jack, but at the difference at the 2 interfaces
|
|
||||||
it is designed to be multi-platform and is based on licence that permit to integrate it
|
|
||||||
on every program we want.
|
|
||||||
|
|
||||||
===Where can I use it?===
|
|
||||||
Everywhere! RIVER is cross-platform devolopped to support bases OS:
|
|
||||||
: ** Linux (over Alsa, Pulseaudio, JackD)
|
|
||||||
: ** Windows (over ASIO)
|
|
||||||
: ** MacOs (over CoreAudio)
|
|
||||||
: ** Android (Over Ewol wrapper little complicated need to be change later)
|
|
||||||
: ** IOs (over CoreAudio for ios)
|
|
||||||
|
|
||||||
===What languages are supported?===
|
|
||||||
RIVER is written in C++11 with posibilities to compile it with C++03 + Boost
|
|
||||||
|
|
||||||
===Are there any licensing restrictions?===
|
|
||||||
RIVER is [b]FREE software[/b] and [i]all sub-library are FREE and staticly linkable !!![/i]
|
|
||||||
|
|
||||||
That allow you to use it for every program you want, including those developing proprietary software, without any license fees or royalties.
|
|
||||||
|
|
||||||
[note]The static support is important for some platform like IOs, and this limit the external library use at some license like :
|
|
||||||
:** BSD*
|
|
||||||
:** MIT
|
|
||||||
:** APPACHE-2
|
|
||||||
:** PNG
|
|
||||||
:** ZLIB
|
|
||||||
This exclude the classical extern library with licence:
|
|
||||||
:** L-GPL
|
|
||||||
:** GPL
|
|
||||||
[/note]
|
|
||||||
|
|
||||||
==== License (APACHE 2) ====
|
|
||||||
Copyright ewol Edouard DUPIN
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
[[http://www.apache.org/licenses/LICENSE-2.0]]
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
|
|
||||||
|
|
||||||
==== Depends library: ====
|
|
||||||
===== License: =====
|
|
||||||
:** [b][lib[etk | e-tk]][/b] : APACHE-2
|
|
||||||
:** [b][lib[airtaudio | airtaudio]][/b] : MIT/APACHE-2
|
|
||||||
:** [b][lib[ejson | e-json]][/b] : APACHE-2
|
|
||||||
:** [b][lib[drain | Drain]][/b] : APACHE-2
|
|
||||||
|
|
||||||
|
|
||||||
===== Program Using RIVER =====
|
|
||||||
:** [b][[http://play.google.com/store/apps/details?id=com.edouarddupin.worddown | worddown]][/b] : (Proprietary) Worddown is a simple word game threw [lib[ewolsa | ewol-simple-audio]].
|
|
||||||
|
|
||||||
== Main documentation: ==
|
|
||||||
|
|
||||||
[doc[001_bases | Global Documantation]]
|
|
||||||
|
|
||||||
[tutorial[000_Build | Tutorials]]
|
|
||||||
|
|
92
doc/mainpage.md
Normal file
92
doc/mainpage.md
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
AUDIO-RIVER library {#mainpage}
|
||||||
|
===================
|
||||||
|
|
||||||
|
@tableofcontents
|
||||||
|
|
||||||
|
What is AUDIO-RIVER: {#audio_river_mainpage_what}
|
||||||
|
====================
|
||||||
|
|
||||||
|
AUDIO-RIVER, is a multi-platform library to manage the input and output audio flow.
|
||||||
|
It can be compared with PulseAudio or Jack, but at the difference at the 2 interfaces
|
||||||
|
it is designed to be multi-platform and is based on licence that permit to integrate it
|
||||||
|
on every program we want.
|
||||||
|
|
||||||
|
|
||||||
|
What it does: {#audio_river_mainpage_what_it_does}
|
||||||
|
=============
|
||||||
|
|
||||||
|
Everywhere! RIVER is cross-platform devolopped to support bases OS:
|
||||||
|
: ** Linux (over Alsa, Pulseaudio, JackD)
|
||||||
|
: ** Windows (over ASIO)
|
||||||
|
: ** MacOs (over CoreAudio)
|
||||||
|
: ** Android (Over Ewol wrapper little complicated need to be change later)
|
||||||
|
: ** IOs (over CoreAudio for ios)
|
||||||
|
|
||||||
|
AUDIO-RIVER is dependent of the STL (compatible with MacOs stl (CXX))
|
||||||
|
|
||||||
|
Architecture:
|
||||||
|
-------------
|
||||||
|
|
||||||
|
River has been designed to replace the pulseAudio basic asyncronous interface that create
|
||||||
|
more problem that it will solve. The second point is that is not enougth portable to be
|
||||||
|
embended in a proprietary software without distributing all the sources (Ios).
|
||||||
|
|
||||||
|
Start at this point we will have simple objectives :
|
||||||
|
- Manage multiple Low level interface: @ref audio_orchestra_mainpage_what
|
||||||
|
* for linux (Alsa, Pulse, Oss)
|
||||||
|
* for Mac-OsX (CoreAudio)
|
||||||
|
* for IOs (coreAudio (embended version))
|
||||||
|
* for Windows (ASIO)
|
||||||
|
* For Android (Java (JDK...))
|
||||||
|
- Synchronous interface ==> no delay and reduce latency
|
||||||
|
- Manage the thread priority (need sometimes to be more reactive)
|
||||||
|
- manage mixing of some flow (2 inputs stereo and the user want 1 input quad)
|
||||||
|
- AEC Acoustic Echo Cancelation (TODO : in the current implementation we have a simple sound cutter)
|
||||||
|
- Equalizer (done with @ref audio_drain_mainpage_what)
|
||||||
|
- Resmpling (done by the libspeexDSP)
|
||||||
|
- Correct volume management (and configurable)
|
||||||
|
- Fade-in and Fade-out @ref audio_drain_mainpage_what
|
||||||
|
- Channel reorganisation @ref audio_drain_mainpage_what
|
||||||
|
- A correct feedback interface
|
||||||
|
|
||||||
|
|
||||||
|
What languages are supported? {#audio_river_mainpage_language}
|
||||||
|
=============================
|
||||||
|
|
||||||
|
AUDIO-RIVER is written in C++.
|
||||||
|
|
||||||
|
|
||||||
|
Are there any licensing restrictions? {#audio_river_mainpage_license_restriction}
|
||||||
|
=====================================
|
||||||
|
|
||||||
|
AUDIO-RIVER is **FREE software** and _all sub-library are FREE and staticly linkable !!!_
|
||||||
|
|
||||||
|
|
||||||
|
License (APACHE-2.0) {#audio_river_mainpage_license}
|
||||||
|
====================
|
||||||
|
|
||||||
|
Copyright AUDIO-RIVER Edouard DUPIN
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
<http://www.apache.org/licenses/LICENSE-2.0>
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
|
Other pages {#audio_river_mainpage_sub_page}
|
||||||
|
===========
|
||||||
|
|
||||||
|
- @ref audio_river_build
|
||||||
|
- @ref audio_river_read
|
||||||
|
- @ref audio_river_write
|
||||||
|
- @ref audio_river_feedback
|
||||||
|
- @ref audio_river_config_file
|
||||||
|
- [**ewol coding style**](http://atria-soft.github.io/ewol/ewol_coding_style.html)
|
||||||
|
|
115
doc/read.md
Normal file
115
doc/read.md
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
Read stream form Audio input {#audio_river_read}
|
||||||
|
============================
|
||||||
|
|
||||||
|
@tableofcontents
|
||||||
|
|
||||||
|
Objectifs: {#audio_river_read_objectif}
|
||||||
|
==========
|
||||||
|
|
||||||
|
- Understand basis of river
|
||||||
|
- Create a simple recording interface that print the average of sample absolute value.
|
||||||
|
|
||||||
|
|
||||||
|
When you will create an application based on the river audio interface you need :
|
||||||
|
|
||||||
|
Include: {#audio_river_read_include}
|
||||||
|
========
|
||||||
|
|
||||||
|
Include manager and interface node
|
||||||
|
@snippet read.cpp audio_river_sample_include
|
||||||
|
|
||||||
|
Initilize the River library: {#audio_river_read_init}
|
||||||
|
============================
|
||||||
|
|
||||||
|
We first need to initialize etk sub library (needed to select the log level of sub-libraries and file access abstraction
|
||||||
|
@snippet read.cpp audio_river_sample_init
|
||||||
|
|
||||||
|
Now we will initilaize the river library.
|
||||||
|
To do this We have 2 posibilities:
|
||||||
|
With a file:
|
||||||
|
------------
|
||||||
|
|
||||||
|
```{.cpp}
|
||||||
|
// initialize river interface
|
||||||
|
river::init("DATA:configFileName.json");
|
||||||
|
```
|
||||||
|
|
||||||
|
With a json string:
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
@snippet read.cpp audio_river_sample_read_config_file
|
||||||
|
|
||||||
|
```{.cpp}
|
||||||
|
// initialize river interface
|
||||||
|
river::initString(configurationRiver);
|
||||||
|
```
|
||||||
|
|
||||||
|
For the example we select the second solution (faster to implement example and resource at the same position.
|
||||||
|
|
||||||
|
river::init / river::initString must be called only one time for all the application, this represent the hardware configuration.
|
||||||
|
It is NOT dynamic
|
||||||
|
|
||||||
|
To understand the configuration file Please see @ref audio_river_config_file
|
||||||
|
|
||||||
|
This json is parsed by the @ref {#ejson_mainpage_what} it contain some update like:
|
||||||
|
- Optionnal " in the name of element.
|
||||||
|
- The possibilities to remplace " with '.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Get the river interface manager: {#audio_river_read_river_interface}
|
||||||
|
================================
|
||||||
|
|
||||||
|
An application can have many interface and only one Manager. And a process can contain many application.
|
||||||
|
|
||||||
|
Then, we will get the first application manager handle.
|
||||||
|
@snippet read.cpp audio_river_sample_get_interface
|
||||||
|
|
||||||
|
*Note:* You can get back the application handle when you create a new one with the same name.
|
||||||
|
|
||||||
|
Create your read interface: {#audio_river_read_river_read_interface}
|
||||||
|
===========================
|
||||||
|
|
||||||
|
Generic code:
|
||||||
|
@snippet read.cpp audio_river_sample_create_read_interface
|
||||||
|
|
||||||
|
Here we create an interface with:
|
||||||
|
- The frequency of 48000 Hz.
|
||||||
|
- The default Low level definition channel
|
||||||
|
- A data interface of 16 bits samples coded in [-32768..32767]
|
||||||
|
- Select input interaface name "microphone"
|
||||||
|
|
||||||
|
|
||||||
|
set data callback: {#audio_river_read_get_data}
|
||||||
|
==================
|
||||||
|
|
||||||
|
The best way to get data is to instanciate a simple callback.
|
||||||
|
The callback is called when sample arrive and you have the nbChunk/frequency
|
||||||
|
to process the data, otherwise you can generate error in data stream.
|
||||||
|
|
||||||
|
@snippet read.cpp audio_river_sample_set_callback
|
||||||
|
|
||||||
|
Callback inplementation: {#audio_river_read_callback}
|
||||||
|
========================
|
||||||
|
|
||||||
|
Simply declare your function and do what you want inside.
|
||||||
|
|
||||||
|
@snippet read.cpp audio_river_sample_callback_implement
|
||||||
|
|
||||||
|
start and stop the stream: {#audio_river_read_start_stop}
|
||||||
|
==========================
|
||||||
|
|
||||||
|
@snippet read.cpp audio_river_sample_read_start_stop
|
||||||
|
|
||||||
|
Remove interfaces: {#audio_river_read_reset}
|
||||||
|
==================
|
||||||
|
|
||||||
|
@snippet read.cpp audio_river_sample_read_reset
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Full Sample: {#audio_river_read_full_sample}
|
||||||
|
============
|
||||||
|
|
||||||
|
@snippet read.cpp audio_river_sample_read_all
|
@@ -1,57 +0,0 @@
|
|||||||
=?=River extract and build examples an example=?=
|
|
||||||
|
|
||||||
All developpement software will start by getting the dependency and the sources.
|
|
||||||
|
|
||||||
=== Linux dependency packages ===
|
|
||||||
[code style=shell]
|
|
||||||
sudo apt-get install g++ zlib1g-dev libasound2-dev
|
|
||||||
# if you want to compile with clang :
|
|
||||||
sudo apt-get install clang
|
|
||||||
[/code]
|
|
||||||
|
|
||||||
|
|
||||||
=== Download instructions ===
|
|
||||||
|
|
||||||
Download the software : This is the simple way You really need only a part of the ewol framework
|
|
||||||
[code style=shell]
|
|
||||||
# create a working directory path
|
|
||||||
mkdir your_workspace_path
|
|
||||||
cd your_workspace_path
|
|
||||||
# clone ewol and all sub-library
|
|
||||||
git clone git://github.com/HeeroYui/ewol.git
|
|
||||||
cd ewol
|
|
||||||
git submodule init
|
|
||||||
git submodule update
|
|
||||||
cd ..
|
|
||||||
[/code]
|
|
||||||
|
|
||||||
If you prefer creating with the packege you needed :
|
|
||||||
[code style=shell]
|
|
||||||
mkdir -p your_workspace_path
|
|
||||||
cd your_workspace_path
|
|
||||||
# download all you needs
|
|
||||||
git clone git://github.com/HeeroYui/lutin.git
|
|
||||||
git clone git://github.com/HeeroYui/etk.git
|
|
||||||
git clone git://github.com/HeeroYui/audio.git
|
|
||||||
git clone git://github.com/HeeroYui/ejson.git
|
|
||||||
git clone git://github.com/HeeroYui/airtaudio.git
|
|
||||||
git clone git://github.com/HeeroYui/drain.git
|
|
||||||
git clone git://github.com/HeeroYui/river.git
|
|
||||||
[/code]
|
|
||||||
|
|
||||||
[note]
|
|
||||||
The full build tool documentation is availlable here : [[http://heeroyui.github.io/lutin/ | lutin]]
|
|
||||||
[/note]
|
|
||||||
|
|
||||||
=== Common build instructions ===
|
|
||||||
|
|
||||||
Build the basic examples & test:
|
|
||||||
[code style=shell]
|
|
||||||
./ewol/build/lutin.py -mdebug river_sample_read
|
|
||||||
[/code]
|
|
||||||
|
|
||||||
To run an application you will find it directly on the out 'staging' tree :
|
|
||||||
[code style=shell]
|
|
||||||
./out/Linux/debug/staging/clang/river_sample_read/usr/bin/river_sample_read -l4
|
|
||||||
[/code]
|
|
||||||
|
|
@@ -1,158 +0,0 @@
|
|||||||
|
|
||||||
=== Objectif ===
|
|
||||||
:** Understand basis of river
|
|
||||||
:** Create a simple recording interface that print the average of sample absolute value.
|
|
||||||
|
|
||||||
=== sample source: ===
|
|
||||||
[[http://github.com/HeeroYui/river.git/sample/read/ | sample source]]
|
|
||||||
|
|
||||||
=== Bases: ===
|
|
||||||
|
|
||||||
When you will create an application based on the river audio interface you need :
|
|
||||||
|
|
||||||
==== Include: ====
|
|
||||||
|
|
||||||
Include manager and interface node
|
|
||||||
|
|
||||||
[code style=c++]
|
|
||||||
#include <river/river.h>
|
|
||||||
#include <river/Manager.h>
|
|
||||||
#include <river/Interface.h>
|
|
||||||
[/code]
|
|
||||||
|
|
||||||
==== Initilize the River library: ====
|
|
||||||
|
|
||||||
We first need to initialize etk sub library (needed to select the log level of sub-libraries and file access abstraction
|
|
||||||
[code style=c++]
|
|
||||||
// the only one init for etk:
|
|
||||||
etk::init(_argc, _argv);
|
|
||||||
[/code]
|
|
||||||
|
|
||||||
Now we will initilaize the river library.
|
|
||||||
To do this We have 2 posibilities:
|
|
||||||
:** With a file:
|
|
||||||
[code style=c++]
|
|
||||||
// initialize river interface
|
|
||||||
river::init("DATA:configFileName.json");
|
|
||||||
[/code]
|
|
||||||
:** With a json string:
|
|
||||||
[code style=c++]
|
|
||||||
static const std::string configurationRiver =
|
|
||||||
"{\n"
|
|
||||||
" microphone:{\n"
|
|
||||||
" io:'input',\n"
|
|
||||||
" map-on:{\n"
|
|
||||||
" interface:'auto',\n"
|
|
||||||
" name:'default',\n"
|
|
||||||
" },\n"
|
|
||||||
" frequency:0,\n"
|
|
||||||
" channel-map:['front-left', 'front-right'],\n"
|
|
||||||
" type:'auto',\n"
|
|
||||||
" nb-chunk:1024\n"
|
|
||||||
" }\n"
|
|
||||||
"}\n";
|
|
||||||
// initialize river interface
|
|
||||||
river::initString(configurationRiver);
|
|
||||||
[/code]
|
|
||||||
|
|
||||||
For the example we select the second solution (faster to implement example and resource at the same position.
|
|
||||||
|
|
||||||
river::init / river::initString must be called only one time for all the application, this represent the hardware configuration.
|
|
||||||
It is Nearly not dynamic
|
|
||||||
|
|
||||||
To understand the configuration file Please see [tutorial[004_ConfigurationFile | Configuration file]]
|
|
||||||
|
|
||||||
[note]
|
|
||||||
This json is parsed by the [lib[ejson | e-json library]] it containe some update like:
|
|
||||||
:** Optionnal " in the name of element.
|
|
||||||
:** The possibilities to remplace " with '.
|
|
||||||
[/note]
|
|
||||||
|
|
||||||
|
|
||||||
==== Get the river interface manager: ====
|
|
||||||
|
|
||||||
An application can have many interface and only one Manager, And a process can contain many application.
|
|
||||||
|
|
||||||
Then, we will get the first application manager handle.
|
|
||||||
|
|
||||||
[code style=c++]
|
|
||||||
// Create the River manager for tha application or part of the application.
|
|
||||||
std11::shared_ptr<river::Manager> manager = river::Manager::create("river_sample_read");
|
|
||||||
[/code]
|
|
||||||
|
|
||||||
[note]
|
|
||||||
You can get back the application handle when you create a new one with the same name.
|
|
||||||
[/note]
|
|
||||||
|
|
||||||
==== Create your read interface: ====
|
|
||||||
|
|
||||||
[code style=c++]
|
|
||||||
// create interface:
|
|
||||||
std11::shared_ptr<river::Interface> interface;
|
|
||||||
//Get the generic input:
|
|
||||||
interface = manager->createInput(48000,
|
|
||||||
std::vector<audio::channel>(),
|
|
||||||
audio::format_int16,
|
|
||||||
"microphone");
|
|
||||||
[/code]
|
|
||||||
|
|
||||||
Here we create an interface with:
|
|
||||||
:** The frequency of 48000 Hz.
|
|
||||||
:** The default Low level definition channel
|
|
||||||
:** A data interface of 16 bits samples coded in [-32768..32767]
|
|
||||||
:** Select input interaface name "microphone"
|
|
||||||
|
|
||||||
|
|
||||||
==== Get datas: ====
|
|
||||||
|
|
||||||
The best way to get data is to instanciate a simple callback.
|
|
||||||
The callback is called when sample arrive and you have the nbChunk/frequency
|
|
||||||
to process the data, otherwise you can generate error in data stream.
|
|
||||||
|
|
||||||
|
|
||||||
[code style=c++]
|
|
||||||
// set callback mode ...
|
|
||||||
interface->setInputCallback(std11::bind(&onDataReceived,
|
|
||||||
std11::placeholders::_1,
|
|
||||||
std11::placeholders::_2,
|
|
||||||
std11::placeholders::_3,
|
|
||||||
std11::placeholders::_4,
|
|
||||||
std11::placeholders::_5,
|
|
||||||
std11::placeholders::_6));
|
|
||||||
[/code]
|
|
||||||
|
|
||||||
==== Callback inplementation: ====
|
|
||||||
|
|
||||||
Simply declare your function and do what you want inside.
|
|
||||||
|
|
||||||
[code style=c++]
|
|
||||||
void onDataReceived(const void* _data,
|
|
||||||
const std11::chrono::system_clock::time_point& _time,
|
|
||||||
size_t _nbChunk,
|
|
||||||
enum audio::format _format,
|
|
||||||
uint32_t _frequency,
|
|
||||||
const std::vector<audio::channel>& _map) {
|
|
||||||
if (_format == audio::format_int16) {
|
|
||||||
// stuff here
|
|
||||||
}
|
|
||||||
}
|
|
||||||
[/code]
|
|
||||||
|
|
||||||
==== start and stop: ====
|
|
||||||
|
|
||||||
[code style=c++]
|
|
||||||
// start the stream
|
|
||||||
interface->start();
|
|
||||||
// wait 10 second ...
|
|
||||||
sleep(10);
|
|
||||||
// stop the stream
|
|
||||||
interface->stop();
|
|
||||||
[/code]
|
|
||||||
|
|
||||||
==== Remove interfaces: ====
|
|
||||||
|
|
||||||
[code style=c++]
|
|
||||||
// remove interface and manager.
|
|
||||||
interface.reset();
|
|
||||||
manager.reset();
|
|
||||||
[/code]
|
|
@@ -1,84 +0,0 @@
|
|||||||
|
|
||||||
=== Objectif ===
|
|
||||||
:** Understand write audio stream
|
|
||||||
|
|
||||||
=== sample source: ===
|
|
||||||
[[http://github.com/HeeroYui/river.git/sample/write/ | sample source]]
|
|
||||||
|
|
||||||
=== Bases: ===
|
|
||||||
|
|
||||||
The writing work nearly like the read turoral. Then we will just see what has change.
|
|
||||||
|
|
||||||
==== File configuration: ====
|
|
||||||
|
|
||||||
[code style=c++]
|
|
||||||
static const std::string configurationRiver =
|
|
||||||
"{\n"
|
|
||||||
" speaker:{\n"
|
|
||||||
" io:'output',\n"
|
|
||||||
" map-on:{\n"
|
|
||||||
" interface:'auto',\n"
|
|
||||||
" name:'default',\n"
|
|
||||||
" },\n"
|
|
||||||
" frequency:0,\n"
|
|
||||||
" channel-map:['front-left', 'front-right'],\n"
|
|
||||||
" type:'auto',\n"
|
|
||||||
" nb-chunk:1024,\n"
|
|
||||||
" volume-name:'MASTER'\n"
|
|
||||||
" }\n"
|
|
||||||
"}\n";
|
|
||||||
[/code]
|
|
||||||
|
|
||||||
==== Create your write interface: ====
|
|
||||||
|
|
||||||
[code style=c++]
|
|
||||||
// create interface:
|
|
||||||
std11::shared_ptr<river::Interface> interface;
|
|
||||||
//Get the generic input:
|
|
||||||
interface = manager->createOutput(48000,
|
|
||||||
std::vector<audio::channel>(),
|
|
||||||
audio::format_int16,
|
|
||||||
"speaker");
|
|
||||||
[/code]
|
|
||||||
|
|
||||||
Here we create an interface with:
|
|
||||||
:** The frequency of 48000 Hz.
|
|
||||||
:** The default Low level definition channel
|
|
||||||
:** A data interface of 16 bits samples coded in [-32768..32767]
|
|
||||||
:** Select input interaface name "speaker"
|
|
||||||
|
|
||||||
|
|
||||||
==== write datas: ====
|
|
||||||
|
|
||||||
The best way to get data is to instanciate a simple callback.
|
|
||||||
The callback is called when sample are needed and you have the nbChunk/frequency
|
|
||||||
to generate the data, otherwise you can generate error in data stream.
|
|
||||||
|
|
||||||
|
|
||||||
[code style=c++]
|
|
||||||
// set callback mode ...
|
|
||||||
interface->setOutputCallback(std11::bind(&onDataNeeded,
|
|
||||||
std11::placeholders::_1,
|
|
||||||
std11::placeholders::_2,
|
|
||||||
std11::placeholders::_3,
|
|
||||||
std11::placeholders::_4,
|
|
||||||
std11::placeholders::_5,
|
|
||||||
std11::placeholders::_6));
|
|
||||||
[/code]
|
|
||||||
|
|
||||||
==== Callback inplementation: ====
|
|
||||||
|
|
||||||
Simply declare your function and do what you want inside.
|
|
||||||
|
|
||||||
[code style=c++]
|
|
||||||
void onDataNeeded(void* _data,
|
|
||||||
const std11::chrono::system_clock::time_point& _time,
|
|
||||||
size_t _nbChunk,
|
|
||||||
enum audio::format _format,
|
|
||||||
uint32_t _frequency,
|
|
||||||
const std::vector<audio::channel>& _map) {
|
|
||||||
if (_format == audio::format_int16) {
|
|
||||||
// stuff here
|
|
||||||
}
|
|
||||||
}
|
|
||||||
[/code]
|
|
@@ -1,70 +0,0 @@
|
|||||||
|
|
||||||
=== Objectif ===
|
|
||||||
:** Understand the architecture of the configuration file.
|
|
||||||
:** all that can be done with it.
|
|
||||||
|
|
||||||
|
|
||||||
=== Basis: ===
|
|
||||||
|
|
||||||
The river configuration file is a json file. We use [lib[ejson | e-json library]] to parse it then we have some writing facilities.
|
|
||||||
|
|
||||||
|
|
||||||
River provide a list a harware interface and virtual interface.
|
|
||||||
|
|
||||||
|
|
||||||
The hardware interface are provided by [lib[airtaudio | AirTAudio library]] then we will plug on every platform.
|
|
||||||
|
|
||||||
|
|
||||||
The file is simply architecture around a list of object:
|
|
||||||
|
|
||||||
[code style=json]
|
|
||||||
{
|
|
||||||
"speaker":{
|
|
||||||
|
|
||||||
},
|
|
||||||
"microphone":{
|
|
||||||
|
|
||||||
},
|
|
||||||
"mixed-in-out":{
|
|
||||||
|
|
||||||
},
|
|
||||||
}
|
|
||||||
[/code]
|
|
||||||
|
|
||||||
With this config we declare 3 interfaces : speaker, microphone and mixed-in-out.
|
|
||||||
|
|
||||||
|
|
||||||
=== Harware configuration: ===
|
|
||||||
|
|
||||||
In every interface we need to define some Element:
|
|
||||||
:** "io" :
|
|
||||||
:: Can be input/output/... depending of virtual interface...
|
|
||||||
:** "map-on": An object to configure airtaudio interface.
|
|
||||||
:** "frequency": 0 to automatic select one. Or the frequency to open harware device
|
|
||||||
:** "channel-map": List of all channel in the stream:
|
|
||||||
::** "front-left"
|
|
||||||
::** "front-center"
|
|
||||||
::** "front-right"
|
|
||||||
::** "rear-left"
|
|
||||||
::** "rear-center"
|
|
||||||
::** "rear-right"
|
|
||||||
::** "surround-left",
|
|
||||||
::** "surround-right",
|
|
||||||
::** "sub-woofer",
|
|
||||||
::** "lfe"
|
|
||||||
:** "type": Fomat to open the stream:
|
|
||||||
::** "auto": Detect the best type
|
|
||||||
::** "int8",
|
|
||||||
::** "int8-on-int16",
|
|
||||||
::** "int16",
|
|
||||||
::** "int16-on-int32",
|
|
||||||
::** "int24",
|
|
||||||
::** "int32",
|
|
||||||
::** "int32-on-int64",
|
|
||||||
::** "int64",
|
|
||||||
::** "float",
|
|
||||||
::** "double"
|
|
||||||
:** "nb-chunk": Number of chunk to open the stream.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
53
doc/write.md
Normal file
53
doc/write.md
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
Write stream to Audio output {#audio_river_write}
|
||||||
|
============================
|
||||||
|
|
||||||
|
@tableofcontents
|
||||||
|
|
||||||
|
Objectifs: {#audio_river_write_objectif}
|
||||||
|
==========
|
||||||
|
|
||||||
|
- Understand write audio stream
|
||||||
|
|
||||||
|
The writing work nearly like the read turoral. Then we will just see what has change.
|
||||||
|
|
||||||
|
File configuration: {#audio_river_write_config}
|
||||||
|
===================
|
||||||
|
|
||||||
|
@snippet write.cpp audio_river_sample_write_config_file
|
||||||
|
|
||||||
|
|
||||||
|
Create your write interface: {#audio_river_write_interface}
|
||||||
|
============================
|
||||||
|
|
||||||
|
Generic code:
|
||||||
|
@snippet write.cpp audio_river_sample_create_write_interface
|
||||||
|
|
||||||
|
Here we create an interface with:
|
||||||
|
- The frequency of 48000 Hz.
|
||||||
|
- The default Low level definition channel
|
||||||
|
- A data interface of 16 bits samples coded in [-32768..32767]
|
||||||
|
- Select input interaface name "speaker"
|
||||||
|
|
||||||
|
|
||||||
|
set data callback: {#audio_river_write_get_data}
|
||||||
|
==================
|
||||||
|
|
||||||
|
The best way to get data is to instanciate a simple callback.
|
||||||
|
The callback is called when sample are needed and you have the nbChunk/frequency
|
||||||
|
to generate the data, otherwise you can generate error in data stream.
|
||||||
|
|
||||||
|
@snippet write.cpp audio_river_sample_set_callback
|
||||||
|
|
||||||
|
Callback inplementation: {#audio_river_write_callback}
|
||||||
|
========================
|
||||||
|
|
||||||
|
Simply declare your function and do what you want inside.
|
||||||
|
|
||||||
|
@snippet write.cpp audio_river_sample_callback_implement
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Full Sample: {#audio_river_write_full_sample}
|
||||||
|
============
|
||||||
|
|
||||||
|
@snippet write.cpp audio_river_sample_write_all
|
37
doxy_audio-river.py
Normal file
37
doxy_audio-river.py
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
import os
|
||||||
|
import doxy.module as module
|
||||||
|
import doxy.debug as debug
|
||||||
|
import doxy.tools as tools
|
||||||
|
|
||||||
|
def create(target, module_name):
|
||||||
|
my_module = module.Module(__file__, module_name)
|
||||||
|
my_module.set_version("version.txt")
|
||||||
|
my_module.set_title("audio-river: Multi-nodal audio interface")
|
||||||
|
my_module.set_website("http://musicdsp.github.io/" + module_name)
|
||||||
|
my_module.set_website_sources("http://github.com/musicdsp/" + module_name)
|
||||||
|
my_module.add_path([
|
||||||
|
"audio",
|
||||||
|
"doc"
|
||||||
|
])
|
||||||
|
my_module.add_sample_path([
|
||||||
|
"sample",
|
||||||
|
])
|
||||||
|
my_module.add_depend([
|
||||||
|
'audio',
|
||||||
|
'audio-drain',
|
||||||
|
'audio-orchestra',
|
||||||
|
'ejson'
|
||||||
|
])
|
||||||
|
my_module.add_exclude_symbols([
|
||||||
|
'*operator<<*',
|
||||||
|
])
|
||||||
|
my_module.add_exclude_file([
|
||||||
|
'debug.h',
|
||||||
|
])
|
||||||
|
my_module.add_file_patterns([
|
||||||
|
'*.h',
|
||||||
|
'*.md',
|
||||||
|
])
|
||||||
|
|
||||||
|
return my_module
|
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
import lutin.module as module
|
import lutin.debug as debug
|
||||||
import lutin.tools as tools
|
import lutin.tools as tools
|
||||||
|
|
||||||
|
|
||||||
@@ -24,12 +24,16 @@ def get_compagny_name():
|
|||||||
def get_maintainer():
|
def get_maintainer():
|
||||||
return "authors.txt"
|
return "authors.txt"
|
||||||
|
|
||||||
def create(target, module_name):
|
def configure(target, my_module):
|
||||||
my_module = module.Module(__file__, module_name, get_type())
|
|
||||||
my_module.add_src_file([
|
my_module.add_src_file([
|
||||||
'test/main.cpp'
|
'test/main.cpp'
|
||||||
])
|
])
|
||||||
my_module.add_depend(['audio-river', 'gtest', 'etk', 'test-debug'])
|
my_module.add_depend([
|
||||||
return my_module
|
'audio-river',
|
||||||
|
'gtest',
|
||||||
|
'etk',
|
||||||
|
'test-debug'
|
||||||
|
])
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
import lutin.module as module
|
import lutin.debug as debug
|
||||||
import lutin.tools as tools
|
import lutin.tools as tools
|
||||||
|
|
||||||
|
|
||||||
@@ -24,8 +24,7 @@ def get_maintainer():
|
|||||||
def get_version():
|
def get_version():
|
||||||
return "version.txt"
|
return "version.txt"
|
||||||
|
|
||||||
def create(target, module_name):
|
def configure(target, my_module):
|
||||||
my_module = module.Module(__file__, module_name, get_type())
|
|
||||||
my_module.add_src_file([
|
my_module.add_src_file([
|
||||||
'audio/river/debug.cpp',
|
'audio/river/debug.cpp',
|
||||||
'audio/river/river.cpp',
|
'audio/river/river.cpp',
|
||||||
@@ -40,18 +39,22 @@ def create(target, module_name):
|
|||||||
'audio/river/io/Manager.cpp'
|
'audio/river/io/Manager.cpp'
|
||||||
])
|
])
|
||||||
my_module.add_header_file([
|
my_module.add_header_file([
|
||||||
'audio/river/river.h',
|
'audio/river/river.hpp',
|
||||||
'audio/river/Manager.h',
|
'audio/river/Manager.hpp',
|
||||||
'audio/river/Interface.h',
|
'audio/river/Interface.hpp',
|
||||||
'audio/river/io/Group.h',
|
'audio/river/io/Group.hpp',
|
||||||
'audio/river/io/Node.h',
|
'audio/river/io/Node.hpp',
|
||||||
'audio/river/io/Manager.h'
|
'audio/river/io/Manager.hpp'
|
||||||
])
|
])
|
||||||
my_module.add_optionnal_depend('audio-orchestra', ["c++", "-DAUDIO_RIVER_BUILD_ORCHESTRA"])
|
my_module.add_optionnal_depend('audio-orchestra', ["c++", "-DAUDIO_RIVER_BUILD_ORCHESTRA"])
|
||||||
my_module.add_optionnal_depend('portaudio', ["c++", "-DAUDIO_RIVER_BUILD_PORTAUDIO"])
|
my_module.add_optionnal_depend('portaudio', ["c++", "-DAUDIO_RIVER_BUILD_PORTAUDIO"])
|
||||||
my_module.add_depend(['audio', 'audio-drain', 'ejson'])
|
my_module.add_depend([
|
||||||
my_module.add_path(tools.get_current_path(__file__))
|
'audio',
|
||||||
return my_module
|
'audio-drain',
|
||||||
|
'ejson'
|
||||||
|
])
|
||||||
|
my_module.add_path(".")
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,19 +0,0 @@
|
|||||||
#!/usr/bin/python
|
|
||||||
import monkModule as module
|
|
||||||
import monkTools as tools
|
|
||||||
|
|
||||||
def get_desc():
|
|
||||||
return "river : Multiple flow input output audio"
|
|
||||||
|
|
||||||
|
|
||||||
def create():
|
|
||||||
# module name is 'edn' and type binary.
|
|
||||||
myModule = module.Module(__file__, 'river', 'LIBRARY')
|
|
||||||
# enable doculentation :
|
|
||||||
myModule.set_website("http://heeroyui.github.io/river/")
|
|
||||||
myModule.set_website_sources("http://github.com/heeroyui/river/")
|
|
||||||
myModule.set_path(tools.get_current_path(__file__) + "/river/")
|
|
||||||
myModule.set_path_general_doc(tools.get_current_path(__file__) + "/doc/")
|
|
||||||
# add the currrent module at the
|
|
||||||
return myModule
|
|
||||||
|
|
@@ -4,13 +4,13 @@
|
|||||||
* @license APACHE v2.0 (see license file)
|
* @license APACHE v2.0 (see license file)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <ewol/ewol.h>
|
#include <ewol/ewol.hpp>
|
||||||
#include <appl/debug.h>
|
#include <appl/debug.hpp>
|
||||||
#include <appl/Windows.h>
|
#include <appl/Windows.hpp>
|
||||||
#include <ewol/widget/Label.h>
|
#include <ewol/widget/Label.hpp>
|
||||||
#include <ewol/widget/Button.h>
|
#include <ewol/widget/Button.hpp>
|
||||||
#include <audio/river/widget/TemporalViewer.h>
|
#include <audio/river/widget/TemporalViewer.hpp>
|
||||||
#include <etk/tool.h>
|
#include <etk/tool.hpp>
|
||||||
|
|
||||||
appl::Windows::Windows() :
|
appl::Windows::Windows() :
|
||||||
m_composer(nullptr) {
|
m_composer(nullptr) {
|
||||||
|
@@ -5,8 +5,8 @@
|
|||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <ewol/widget/Windows.h>
|
#include <ewol/widget/Windows.hpp>
|
||||||
#include <ewol/widget/Composer.h>
|
#include <ewol/widget/Composer.hpp>
|
||||||
|
|
||||||
namespace appl {
|
namespace appl {
|
||||||
class Windows : public ewol::widget::Windows {
|
class Windows : public ewol::widget::Windows {
|
@@ -4,7 +4,7 @@
|
|||||||
* @license APACHE v2.0 (see license file)
|
* @license APACHE v2.0 (see license file)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <appl/debug.h>
|
#include <appl/debug.hpp>
|
||||||
|
|
||||||
|
|
||||||
int32_t appl::getLogId() {
|
int32_t appl::getLogId() {
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <elog/log.h>
|
#include <elog/log.hpp>
|
||||||
|
|
||||||
namespace appl {
|
namespace appl {
|
||||||
int32_t getLogId();
|
int32_t getLogId();
|
@@ -5,16 +5,16 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <etk/types.h>
|
#include <etk/types.hpp>
|
||||||
#include <ewol/ewol.h>
|
#include <ewol/ewol.hpp>
|
||||||
#include <gale/context/commandLine.h>
|
#include <gale/context/commandLine.hpp>
|
||||||
|
|
||||||
#include <appl/debug.h>
|
#include <appl/debug.hpp>
|
||||||
#include <appl/Windows.h>
|
#include <appl/Windows.hpp>
|
||||||
#include <ewol/object/Object.h>
|
#include <ewol/object/Object.hpp>
|
||||||
#include <ewol/widget/Manager.h>
|
#include <ewol/widget/Manager.hpp>
|
||||||
#include <ewol/context/Context.h>
|
#include <ewol/context/Context.hpp>
|
||||||
#include <audio/river/widget/TemporalViewer.h>
|
#include <audio/river/widget/TemporalViewer.hpp>
|
||||||
|
|
||||||
static const std::string configurationRiver =
|
static const std::string configurationRiver =
|
||||||
"{\n"
|
"{\n"
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
import lutin.module as module
|
import lutin.debug as debug
|
||||||
import lutin.tools as tools
|
import lutin.tools as tools
|
||||||
import datetime
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
@@ -23,26 +22,18 @@ def get_compagny_name():
|
|||||||
def get_maintainer():
|
def get_maintainer():
|
||||||
return ["Mr DUPIN Edouard <yui.heero@gmail.com>"]
|
return ["Mr DUPIN Edouard <yui.heero@gmail.com>"]
|
||||||
|
|
||||||
def create(target, module_name):
|
def configure(target, my_module):
|
||||||
my_module = module.Module(__file__, module_name, get_type())
|
|
||||||
my_module.add_extra_flags()
|
my_module.add_extra_flags()
|
||||||
my_module.add_src_file([
|
my_module.add_src_file([
|
||||||
'appl/debug.cpp',
|
'appl/debug.cpp',
|
||||||
'appl/main.cpp',
|
'appl/main.cpp',
|
||||||
'appl/Windows.cpp'])
|
'appl/Windows.cpp'])
|
||||||
my_module.add_depend(['ewol', 'audio-river', 'audio-river-widget'])
|
my_module.add_depend(['ewol', 'audio-river', 'audio-river-widget'])
|
||||||
my_module.add_path(tools.get_current_path(__file__))
|
my_module.add_path(".")
|
||||||
# set the package properties :
|
# set the package properties :
|
||||||
my_module.set_pkg("VERSION", "1.0.0")
|
|
||||||
my_module.set_pkg("VERSION_CODE", "1")
|
|
||||||
my_module.set_pkg("COMPAGNY_TYPE", "org")
|
|
||||||
my_module.set_pkg("COMPAGNY_NAME", "Edouard DUPIN")
|
|
||||||
my_module.set_pkg("MAINTAINER", ["Mr DUPIN Edouard <yui.heero@gmail.com>"])
|
|
||||||
my_module.set_pkg("SECTION", ["Development"])
|
my_module.set_pkg("SECTION", ["Development"])
|
||||||
my_module.set_pkg("PRIORITY", "optional")
|
my_module.set_pkg("PRIORITY", "optional")
|
||||||
my_module.set_pkg("DESCRIPTION", "Simple wiewer")
|
|
||||||
my_module.set_pkg("NAME", "ioViewer")
|
|
||||||
|
|
||||||
my_module.add_pkg("RIGHT", "RECORD_AUDIO")
|
my_module.add_pkg("RIGHT", "RECORD_AUDIO")
|
||||||
return my_module
|
return True
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
import lutin.module as module
|
import lutin.debug as debug
|
||||||
import lutin.tools as tools
|
import lutin.tools as tools
|
||||||
|
|
||||||
|
|
||||||
@@ -24,13 +24,15 @@ def get_compagny_name():
|
|||||||
def get_maintainer():
|
def get_maintainer():
|
||||||
return ["Mr DUPIN Edouard <yui.heero@gmail.com>"]
|
return ["Mr DUPIN Edouard <yui.heero@gmail.com>"]
|
||||||
|
|
||||||
def create(target, module_name):
|
def configure(target, my_module):
|
||||||
my_module = module.Module(__file__, module_name, get_type())
|
|
||||||
my_module.add_src_file([
|
my_module.add_src_file([
|
||||||
'main.cpp',
|
'read.cpp',
|
||||||
])
|
])
|
||||||
my_module.add_depend(['audio-river', 'etk'])
|
my_module.add_depend([
|
||||||
return my_module
|
'audio-river',
|
||||||
|
'etk'
|
||||||
|
])
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -4,14 +4,19 @@
|
|||||||
* @license APACHE v2.0 (see license file)
|
* @license APACHE v2.0 (see license file)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <audio/river/river.h>
|
//! [audio_river_sample_read_all]
|
||||||
#include <audio/river/Manager.h>
|
//! [audio_river_sample_include]
|
||||||
#include <audio/river/Interface.h>
|
#include <audio/river/river.hpp>
|
||||||
#include <etk/os/FSNode.h>
|
#include <audio/river/Manager.hpp>
|
||||||
#include <etk/etk.h>
|
#include <audio/river/Interface.hpp>
|
||||||
#include <unistd.h>
|
//! [audio_river_sample_include]
|
||||||
|
#include <etk/os/FSNode.hpp>
|
||||||
|
#include <etk/etk.hpp>
|
||||||
|
#include <thread>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//! [audio_river_sample_read_config_file]
|
||||||
static const std::string configurationRiver =
|
static const std::string configurationRiver =
|
||||||
"{\n"
|
"{\n"
|
||||||
" microphone:{\n"
|
" microphone:{\n"
|
||||||
@@ -27,8 +32,10 @@ static const std::string configurationRiver =
|
|||||||
" nb-chunk:1024\n"
|
" nb-chunk:1024\n"
|
||||||
" }\n"
|
" }\n"
|
||||||
"}\n";
|
"}\n";
|
||||||
|
//! [audio_river_sample_read_config_file]
|
||||||
|
|
||||||
|
|
||||||
|
//! [audio_river_sample_callback_implement]
|
||||||
void onDataReceived(const void* _data,
|
void onDataReceived(const void* _data,
|
||||||
const audio::Time& _time,
|
const audio::Time& _time,
|
||||||
size_t _nbChunk,
|
size_t _nbChunk,
|
||||||
@@ -41,6 +48,7 @@ void onDataReceived(const void* _data,
|
|||||||
std::cout << "[ERROR] call wrong type ... (need int16_t.float)" << std::endl;
|
std::cout << "[ERROR] call wrong type ... (need int16_t.float)" << std::endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
//! [audio_river_sample_callback_implement]
|
||||||
if (_outputNode->fileIsOpen() == false) {
|
if (_outputNode->fileIsOpen() == false) {
|
||||||
if (_format != audio::format_int16) {
|
if (_format != audio::format_int16) {
|
||||||
// get the curent power of the signal.
|
// get the curent power of the signal.
|
||||||
@@ -69,8 +77,10 @@ void onDataReceived(const void* _data,
|
|||||||
}
|
}
|
||||||
|
|
||||||
int main(int _argc, const char **_argv) {
|
int main(int _argc, const char **_argv) {
|
||||||
|
//! [audio_river_sample_init]
|
||||||
// the only one init for etk:
|
// the only one init for etk:
|
||||||
etk::init(_argc, _argv);
|
etk::init(_argc, _argv);
|
||||||
|
//! [audio_river_sample_init]
|
||||||
// local parameter:
|
// local parameter:
|
||||||
std::string configFile;
|
std::string configFile;
|
||||||
std::string ioName="microphone";
|
std::string ioName="microphone";
|
||||||
@@ -101,8 +111,11 @@ int main(int _argc, const char **_argv) {
|
|||||||
} else {
|
} else {
|
||||||
audio::river::init(configFile);
|
audio::river::init(configFile);
|
||||||
}
|
}
|
||||||
|
//! [audio_river_sample_get_interface]
|
||||||
// Create the River manager for tha application or part of the application.
|
// Create the River manager for tha application or part of the application.
|
||||||
ememory::SharedPtr<audio::river::Manager> manager = audio::river::Manager::create("river_sample_read");
|
ememory::SharedPtr<audio::river::Manager> manager = audio::river::Manager::create("river_sample_read");
|
||||||
|
//! [audio_river_sample_get_interface]
|
||||||
|
//! [audio_river_sample_create_read_interface]
|
||||||
// create interface:
|
// create interface:
|
||||||
ememory::SharedPtr<audio::river::Interface> interface;
|
ememory::SharedPtr<audio::river::Interface> interface;
|
||||||
//Get the generic input:
|
//Get the generic input:
|
||||||
@@ -114,12 +127,14 @@ int main(int _argc, const char **_argv) {
|
|||||||
std::cout << "nullptr interface" << std::endl;
|
std::cout << "nullptr interface" << std::endl;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
//! [audio_river_sample_create_read_interface]
|
||||||
etk::FSNode outputNode;
|
etk::FSNode outputNode;
|
||||||
// open output file if needed:
|
// open output file if needed:
|
||||||
if (outputFileName != "") {
|
if (outputFileName != "") {
|
||||||
outputNode.setName(outputFileName);
|
outputNode.setName(outputFileName);
|
||||||
outputNode.fileOpenWrite();
|
outputNode.fileOpenWrite();
|
||||||
}
|
}
|
||||||
|
//! [audio_river_sample_set_callback]
|
||||||
// set callback mode ...
|
// set callback mode ...
|
||||||
interface->setInputCallback(std::bind(&onDataReceived,
|
interface->setInputCallback(std::bind(&onDataReceived,
|
||||||
std::placeholders::_1,
|
std::placeholders::_1,
|
||||||
@@ -129,15 +144,20 @@ int main(int _argc, const char **_argv) {
|
|||||||
std::placeholders::_5,
|
std::placeholders::_5,
|
||||||
std::placeholders::_6,
|
std::placeholders::_6,
|
||||||
&outputNode));
|
&outputNode));
|
||||||
|
//! [audio_river_sample_set_callback]
|
||||||
|
//! [audio_river_sample_read_start_stop]
|
||||||
// start the stream
|
// start the stream
|
||||||
interface->start();
|
interface->start();
|
||||||
// wait 10 second ...
|
// wait 10 second ...
|
||||||
sleep(10);
|
std::this_thread::sleep_for(std::chrono::seconds(10));
|
||||||
// stop the stream
|
// stop the stream
|
||||||
interface->stop();
|
interface->stop();
|
||||||
|
//! [audio_river_sample_read_start_stop]
|
||||||
|
//! [audio_river_sample_read_reset]
|
||||||
// remove interface and manager.
|
// remove interface and manager.
|
||||||
interface.reset();
|
interface.reset();
|
||||||
manager.reset();
|
manager.reset();
|
||||||
|
//! [audio_river_sample_read_reset]
|
||||||
// close the output file
|
// close the output file
|
||||||
if (outputFileName != "") {
|
if (outputFileName != "") {
|
||||||
outputNode.fileClose();
|
outputNode.fileClose();
|
||||||
@@ -145,3 +165,5 @@ int main(int _argc, const char **_argv) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//! [audio_river_sample_read_all]
|
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
import lutin.module as module
|
import lutin.debug as debug
|
||||||
import lutin.tools as tools
|
import lutin.tools as tools
|
||||||
|
|
||||||
|
|
||||||
@@ -24,13 +24,15 @@ def get_compagny_name():
|
|||||||
def get_maintainer():
|
def get_maintainer():
|
||||||
return ["Mr DUPIN Edouard <yui.heero@gmail.com>"]
|
return ["Mr DUPIN Edouard <yui.heero@gmail.com>"]
|
||||||
|
|
||||||
def create(target, module_name):
|
def configure(target, my_module):
|
||||||
my_module = module.Module(__file__, module_name, get_type())
|
|
||||||
my_module.add_src_file([
|
my_module.add_src_file([
|
||||||
'main.cpp',
|
'write.cpp',
|
||||||
])
|
])
|
||||||
my_module.add_depend(['audio-river', 'etk'])
|
my_module.add_depend([
|
||||||
return my_module
|
'audio-river',
|
||||||
|
'etk'
|
||||||
|
])
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -4,13 +4,16 @@
|
|||||||
* @license APACHE v2.0 (see license file)
|
* @license APACHE v2.0 (see license file)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <audio/river/river.h>
|
//! [audio_river_sample_write_all]
|
||||||
#include <audio/river/Manager.h>
|
|
||||||
#include <audio/river/Interface.h>
|
#include <audio/river/river.hpp>
|
||||||
#include <etk/etk.h>
|
#include <audio/river/Manager.hpp>
|
||||||
#include <unistd.h>
|
#include <audio/river/Interface.hpp>
|
||||||
|
#include <etk/etk.hpp>
|
||||||
|
#include <thread>
|
||||||
|
|
||||||
|
|
||||||
|
//! [audio_river_sample_write_config_file]
|
||||||
static const std::string configurationRiver =
|
static const std::string configurationRiver =
|
||||||
"{\n"
|
"{\n"
|
||||||
" speaker:{\n"
|
" speaker:{\n"
|
||||||
@@ -27,9 +30,11 @@ static const std::string configurationRiver =
|
|||||||
" volume-name:'MASTER'\n"
|
" volume-name:'MASTER'\n"
|
||||||
" }\n"
|
" }\n"
|
||||||
"}\n";
|
"}\n";
|
||||||
|
//! [audio_river_sample_write_config_file]
|
||||||
|
|
||||||
static const int32_t nbChannelMax=8;
|
static const int32_t nbChannelMax=8;
|
||||||
|
|
||||||
|
//! [audio_river_sample_callback_implement]
|
||||||
void onDataNeeded(void* _data,
|
void onDataNeeded(void* _data,
|
||||||
const audio::Time& _time,
|
const audio::Time& _time,
|
||||||
size_t _nbChunk,
|
size_t _nbChunk,
|
||||||
@@ -54,6 +59,7 @@ void onDataNeeded(void* _data,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//! [audio_river_sample_callback_implement]
|
||||||
|
|
||||||
int main(int _argc, const char **_argv) {
|
int main(int _argc, const char **_argv) {
|
||||||
// the only one init for etk:
|
// the only one init for etk:
|
||||||
@@ -71,6 +77,7 @@ int main(int _argc, const char **_argv) {
|
|||||||
audio::river::initString(configurationRiver);
|
audio::river::initString(configurationRiver);
|
||||||
// Create the River manager for tha application or part of the application.
|
// Create the River manager for tha application or part of the application.
|
||||||
ememory::SharedPtr<audio::river::Manager> manager = audio::river::Manager::create("river_sample_read");
|
ememory::SharedPtr<audio::river::Manager> manager = audio::river::Manager::create("river_sample_read");
|
||||||
|
//! [audio_river_sample_create_write_interface]
|
||||||
// create interface:
|
// create interface:
|
||||||
ememory::SharedPtr<audio::river::Interface> interface;
|
ememory::SharedPtr<audio::river::Interface> interface;
|
||||||
//Get the generic input:
|
//Get the generic input:
|
||||||
@@ -82,6 +89,8 @@ int main(int _argc, const char **_argv) {
|
|||||||
std::cout << "nullptr interface" << std::endl;
|
std::cout << "nullptr interface" << std::endl;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
//! [audio_river_sample_create_write_interface]
|
||||||
|
//! [audio_river_sample_set_callback]
|
||||||
// set callback mode ...
|
// set callback mode ...
|
||||||
interface->setOutputCallback(std::bind(&onDataNeeded,
|
interface->setOutputCallback(std::bind(&onDataNeeded,
|
||||||
std::placeholders::_1,
|
std::placeholders::_1,
|
||||||
@@ -90,10 +99,11 @@ int main(int _argc, const char **_argv) {
|
|||||||
std::placeholders::_4,
|
std::placeholders::_4,
|
||||||
std::placeholders::_5,
|
std::placeholders::_5,
|
||||||
std::placeholders::_6));
|
std::placeholders::_6));
|
||||||
|
//! [audio_river_sample_set_callback]
|
||||||
// start the stream
|
// start the stream
|
||||||
interface->start();
|
interface->start();
|
||||||
// wait 10 second ...
|
// wait 10 second ...
|
||||||
sleep(10);
|
std::this_thread::sleep_for(std::chrono::seconds(10));
|
||||||
// stop the stream
|
// stop the stream
|
||||||
interface->stop();
|
interface->stop();
|
||||||
// remove interface and manager.
|
// remove interface and manager.
|
||||||
@@ -102,3 +112,5 @@ int main(int _argc, const char **_argv) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//! [audio_river_sample_write_all]
|
||||||
|
|
@@ -1,55 +0,0 @@
|
|||||||
cmake_minimum_required(VERSION 2.8.3)
|
|
||||||
project(audio_river_test)
|
|
||||||
|
|
||||||
set(CMAKE_VERBOSE_MAKEFILE ON)
|
|
||||||
|
|
||||||
## Find catkin macros and libraries
|
|
||||||
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
|
|
||||||
## is used, also find other catkin packages
|
|
||||||
find_package(catkin REQUIRED COMPONENTS
|
|
||||||
audio_river
|
|
||||||
rosconsole
|
|
||||||
)
|
|
||||||
|
|
||||||
###################################
|
|
||||||
## catkin specific configuration ##
|
|
||||||
###################################
|
|
||||||
## The catkin_package macro generates cmake config files for your package
|
|
||||||
## Declare things to be passed to dependent projects
|
|
||||||
## INCLUDE_DIRS: uncomment this if you package contains header files
|
|
||||||
## LIBRARIES: libraries you create in this project that dependent projects also need
|
|
||||||
## CATKIN_DEPENDS: catkin_packages dependent projects also need
|
|
||||||
## DEPENDS: system dependencies of this project that dependent projects also need
|
|
||||||
catkin_package()
|
|
||||||
|
|
||||||
###########
|
|
||||||
## Build ##
|
|
||||||
###########
|
|
||||||
|
|
||||||
## Specify additional locations of header files
|
|
||||||
## Your package locations should be listed before other locations
|
|
||||||
include_directories(
|
|
||||||
..
|
|
||||||
${catkin_INCLUDE_DIRS}
|
|
||||||
)
|
|
||||||
|
|
||||||
## Declare a cpp library
|
|
||||||
catkin_add_gtest(${PROJECT_NAME}
|
|
||||||
../debug.cpp
|
|
||||||
../main.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
## Specify libraries to link a library or executable target against
|
|
||||||
target_link_libraries(${PROJECT_NAME}
|
|
||||||
${catkin_LIBRARIES}
|
|
||||||
)
|
|
||||||
|
|
||||||
#############
|
|
||||||
## Install ##
|
|
||||||
#############
|
|
||||||
|
|
||||||
## Mark executables and/or libraries for installation
|
|
||||||
#install(TARGETS ${PROJECT_NAME}
|
|
||||||
# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
|
|
||||||
#)
|
|
||||||
|
|
@@ -1,13 +0,0 @@
|
|||||||
<?xml version="1.0"?>
|
|
||||||
<package>
|
|
||||||
<name>audio_river_test</name>
|
|
||||||
<version>0.3.0</version>
|
|
||||||
<description>Ewol River test</description>
|
|
||||||
<maintainer email="yui.heero@gmail.com">Edouard DUPIN</maintainer>
|
|
||||||
<license>Apache-2.0</license>
|
|
||||||
<build_depend>gtest</build_depend>
|
|
||||||
<build_depend>audio_river</build_depend>
|
|
||||||
<buildtool_depend>catkin</buildtool_depend>
|
|
||||||
<run_depend>audio_river</run_depend>
|
|
||||||
<run_depend>gtest</run_depend>
|
|
||||||
</package>
|
|
@@ -4,7 +4,7 @@
|
|||||||
* @license APACHE v2.0 (see license file)
|
* @license APACHE v2.0 (see license file)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <test-debug/debug.h>
|
#include <test-debug/debug.hpp>
|
||||||
|
|
||||||
#define TEST_SAVE_FILE_MACRO(type,fileName,dataPointer,nbElement) \
|
#define TEST_SAVE_FILE_MACRO(type,fileName,dataPointer,nbElement) \
|
||||||
do { \
|
do { \
|
||||||
@@ -27,25 +27,25 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <audio/river/river.h>
|
#include <audio/river/river.hpp>
|
||||||
#include <audio/river/Manager.h>
|
#include <audio/river/Manager.hpp>
|
||||||
#include <audio/river/Interface.h>
|
#include <audio/river/Interface.hpp>
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include <etk/etk.h>
|
#include <etk/etk.hpp>
|
||||||
#include <etk/os/FSNode.h>
|
#include <etk/os/FSNode.hpp>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <unistd.h>
|
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include "testAEC.h"
|
#include "testAEC.hpp"
|
||||||
#include "testEchoDelay.h"
|
#include "testEchoDelay.hpp"
|
||||||
#include "testFormat.h"
|
#include "testFormat.hpp"
|
||||||
#include "testMuxer.h"
|
#include "testMuxer.hpp"
|
||||||
#include "testPlaybackCallback.h"
|
#include "testPlaybackCallback.hpp"
|
||||||
#include "testPlaybackWrite.h"
|
#include "testPlaybackWrite.hpp"
|
||||||
#include "testRecordCallback.h"
|
#include "testRecordCallback.hpp"
|
||||||
#include "testRecordRead.h"
|
#include "testRecordRead.hpp"
|
||||||
#include "testVolume.h"
|
#include "testVolume.hpp"
|
||||||
|
|
||||||
int main(int _argc, const char** _argv) {
|
int main(int _argc, const char** _argv) {
|
||||||
// init Google test :
|
// init Google test :
|
||||||
|
@@ -5,6 +5,8 @@
|
|||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <test-debug/debug.hpp>
|
||||||
|
|
||||||
namespace river_test_aec {
|
namespace river_test_aec {
|
||||||
|
|
||||||
class Linker {
|
class Linker {
|
||||||
@@ -201,7 +203,7 @@ namespace river_test_aec {
|
|||||||
ememory::SharedPtr<Linker> processLink2 = ememory::makeShared<Linker>(manager, "microphone", "speaker-test");
|
ememory::SharedPtr<Linker> processLink2 = ememory::makeShared<Linker>(manager, "microphone", "speaker-test");
|
||||||
processLink1->start();
|
processLink1->start();
|
||||||
processLink2->start();
|
processLink2->start();
|
||||||
sleep(30);
|
std::this_thread::sleep_for(std::chrono::seconds(20));
|
||||||
processLink1->stop();
|
processLink1->stop();
|
||||||
processLink2->stop();
|
processLink2->stop();
|
||||||
|
|
@@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <test-debug/debug.h>
|
#include <test-debug/debug.hpp>
|
||||||
|
|
||||||
namespace river_test_echo_delay {
|
namespace river_test_echo_delay {
|
||||||
class TestClass {
|
class TestClass {
|
||||||
@@ -360,9 +360,9 @@ namespace river_test_echo_delay {
|
|||||||
m_interfaceIn->start();
|
m_interfaceIn->start();
|
||||||
//m_interfaceFB->start();
|
//m_interfaceFB->start();
|
||||||
while (m_estimateVolumeInput == true) {
|
while (m_estimateVolumeInput == true) {
|
||||||
usleep(10000);
|
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||||
}
|
}
|
||||||
usleep(10000000);
|
std::this_thread::sleep_for(std::chrono::seconds(10));
|
||||||
//m_interfaceFB->stop();
|
//m_interfaceFB->stop();
|
||||||
m_interfaceIn->stop();
|
m_interfaceIn->stop();
|
||||||
m_interfaceOut->stop();
|
m_interfaceOut->stop();
|
||||||
@@ -418,7 +418,7 @@ namespace river_test_echo_delay {
|
|||||||
ememory::SharedPtr<TestClass> process = ememory::makeShared<TestClass>(manager);
|
ememory::SharedPtr<TestClass> process = ememory::makeShared<TestClass>(manager);
|
||||||
process->run();
|
process->run();
|
||||||
process.reset();
|
process.reset();
|
||||||
usleep(500000);
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
audio::river::unInit();
|
audio::river::unInit();
|
||||||
}
|
}
|
||||||
};
|
};
|
@@ -136,9 +136,9 @@ namespace river_test_format {
|
|||||||
}
|
}
|
||||||
m_interface->start();
|
m_interface->start();
|
||||||
// wait 2 second ...
|
// wait 2 second ...
|
||||||
usleep(1000000);
|
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||||
m_interface->stop();
|
m_interface->stop();
|
||||||
usleep(100000);
|
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -151,7 +151,7 @@ namespace river_test_format {
|
|||||||
ememory::SharedPtr<testOutCallbackType> process = ememory::makeShared<testOutCallbackType>(manager, GetParam(), 2, audio::format_int16);
|
ememory::SharedPtr<testOutCallbackType> process = ememory::makeShared<testOutCallbackType>(manager, GetParam(), 2, audio::format_int16);
|
||||||
process->run();
|
process->run();
|
||||||
process.reset();
|
process.reset();
|
||||||
usleep(500000);
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
audio::river::unInit();
|
audio::river::unInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,7 +168,7 @@ namespace river_test_format {
|
|||||||
ememory::SharedPtr<testOutCallbackType> process = ememory::makeShared<testOutCallbackType>(manager, 48000, 2, GetParam());
|
ememory::SharedPtr<testOutCallbackType> process = ememory::makeShared<testOutCallbackType>(manager, 48000, 2, GetParam());
|
||||||
process->run();
|
process->run();
|
||||||
process.reset();
|
process.reset();
|
||||||
usleep(500000);
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
audio::river::unInit();
|
audio::river::unInit();
|
||||||
}
|
}
|
||||||
INSTANTIATE_TEST_CASE_P(InstantiationName,
|
INSTANTIATE_TEST_CASE_P(InstantiationName,
|
||||||
@@ -184,7 +184,7 @@ namespace river_test_format {
|
|||||||
ememory::SharedPtr<testOutCallbackType> process = ememory::makeShared<testOutCallbackType>(manager, 48000, GetParam(), audio::format_int16);
|
ememory::SharedPtr<testOutCallbackType> process = ememory::makeShared<testOutCallbackType>(manager, 48000, GetParam(), audio::format_int16);
|
||||||
process->run();
|
process->run();
|
||||||
process.reset();
|
process.reset();
|
||||||
usleep(500000);
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
audio::river::unInit();
|
audio::river::unInit();
|
||||||
}
|
}
|
||||||
INSTANTIATE_TEST_CASE_P(InstantiationName,
|
INSTANTIATE_TEST_CASE_P(InstantiationName,
|
||||||
@@ -226,7 +226,7 @@ namespace river_test_format {
|
|||||||
ememory::SharedPtr<testOutCallbackType> process = ememory::makeShared<testOutCallbackType>(manager, listFreq[fff], listChannel[ccc], listFormat[iii]);
|
ememory::SharedPtr<testOutCallbackType> process = ememory::makeShared<testOutCallbackType>(manager, listFreq[fff], listChannel[ccc], listFormat[iii]);
|
||||||
process->run();
|
process->run();
|
||||||
process.reset();
|
process.reset();
|
||||||
usleep(500000);
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <test-debug/debug.h>
|
#include <test-debug/debug.hpp>
|
||||||
|
|
||||||
namespace river_test_muxer {
|
namespace river_test_muxer {
|
||||||
class TestClass {
|
class TestClass {
|
||||||
@@ -103,7 +103,7 @@ namespace river_test_muxer {
|
|||||||
}
|
}
|
||||||
m_interfaceOut->start();
|
m_interfaceOut->start();
|
||||||
m_interfaceIn->start();
|
m_interfaceIn->start();
|
||||||
usleep(10000000);
|
std::this_thread::sleep_for(std::chrono::seconds(10));
|
||||||
m_interfaceIn->stop();
|
m_interfaceIn->stop();
|
||||||
m_interfaceOut->stop();
|
m_interfaceOut->stop();
|
||||||
}
|
}
|
||||||
@@ -168,7 +168,7 @@ namespace river_test_muxer {
|
|||||||
ememory::SharedPtr<TestClass> process = ememory::makeShared<TestClass>(manager);
|
ememory::SharedPtr<TestClass> process = ememory::makeShared<TestClass>(manager);
|
||||||
process->run();
|
process->run();
|
||||||
process.reset();
|
process.reset();
|
||||||
usleep(500000);
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
audio::river::unInit();
|
audio::river::unInit();
|
||||||
}
|
}
|
||||||
};
|
};
|
@@ -66,7 +66,7 @@ namespace river_test_playback_callback {
|
|||||||
}
|
}
|
||||||
m_interface->start();
|
m_interface->start();
|
||||||
// wait 2 second ...
|
// wait 2 second ...
|
||||||
usleep(2000000);
|
std::this_thread::sleep_for(std::chrono::seconds(2));
|
||||||
m_interface->stop();
|
m_interface->stop();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -97,7 +97,7 @@ namespace river_test_playback_callback {
|
|||||||
ASSERT_NE(process, nullptr);
|
ASSERT_NE(process, nullptr);
|
||||||
process->run();
|
process->run();
|
||||||
process.reset();
|
process.reset();
|
||||||
usleep(500000);
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
audio::river::unInit();
|
audio::river::unInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -110,7 +110,7 @@ namespace river_test_playback_callback {
|
|||||||
ememory::SharedPtr<testOutCallback> process = ememory::makeShared<testOutCallback>(manager, "speaker-pulse");
|
ememory::SharedPtr<testOutCallback> process = ememory::makeShared<testOutCallback>(manager, "speaker-pulse");
|
||||||
process->run();
|
process->run();
|
||||||
process.reset();
|
process.reset();
|
||||||
usleep(500000);
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
audio::river::unInit();
|
audio::river::unInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,7 +123,7 @@ namespace river_test_playback_callback {
|
|||||||
ememory::SharedPtr<testOutCallback> process = ememory::makeShared<testOutCallback>(manager, "speaker-jack");
|
ememory::SharedPtr<testOutCallback> process = ememory::makeShared<testOutCallback>(manager, "speaker-jack");
|
||||||
process->run();
|
process->run();
|
||||||
process.reset();
|
process.reset();
|
||||||
usleep(500000);
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
audio::river::unInit();
|
audio::river::unInit();
|
||||||
}
|
}
|
||||||
};
|
};
|
@@ -78,7 +78,7 @@ namespace river_test_playback_write {
|
|||||||
}
|
}
|
||||||
m_interface->write(&data[0], data.size()/m_channelMap.size());
|
m_interface->write(&data[0], data.size()/m_channelMap.size());
|
||||||
// TODO : Add a function to get number of time we need to wait enought time ...
|
// TODO : Add a function to get number of time we need to wait enought time ...
|
||||||
usleep(15000);
|
std::this_thread::sleep_for(std::chrono::milliseconds(15));
|
||||||
}
|
}
|
||||||
m_interface->stop();
|
m_interface->stop();
|
||||||
}
|
}
|
||||||
@@ -93,7 +93,7 @@ namespace river_test_playback_write {
|
|||||||
ememory::SharedPtr<testOutWrite> process = ememory::makeShared<testOutWrite>(manager);
|
ememory::SharedPtr<testOutWrite> process = ememory::makeShared<testOutWrite>(manager);
|
||||||
process->run();
|
process->run();
|
||||||
process.reset();
|
process.reset();
|
||||||
usleep(500000);
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
audio::river::unInit();
|
audio::river::unInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,7 +156,7 @@ namespace river_test_playback_write {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_interface->start();
|
m_interface->start();
|
||||||
usleep(1000000);
|
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||||
m_interface->stop();
|
m_interface->stop();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -170,7 +170,7 @@ namespace river_test_playback_write {
|
|||||||
ememory::SharedPtr<testOutWriteCallback> process = ememory::makeShared<testOutWriteCallback>(manager);
|
ememory::SharedPtr<testOutWriteCallback> process = ememory::makeShared<testOutWriteCallback>(manager);
|
||||||
process->run();
|
process->run();
|
||||||
process.reset();
|
process.reset();
|
||||||
usleep(500000);
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
audio::river::unInit();
|
audio::river::unInit();
|
||||||
}
|
}
|
||||||
|
|
@@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <test-debug/debug.h>
|
#include <test-debug/debug.hpp>
|
||||||
|
|
||||||
namespace river_test_record_callback {
|
namespace river_test_record_callback {
|
||||||
static const std::string configurationRiver =
|
static const std::string configurationRiver =
|
||||||
@@ -75,7 +75,7 @@ namespace river_test_record_callback {
|
|||||||
}
|
}
|
||||||
m_interface->start();
|
m_interface->start();
|
||||||
// wait 2 second ...
|
// wait 2 second ...
|
||||||
usleep(20000000);
|
std::this_thread::sleep_for(std::chrono::seconds(20));
|
||||||
m_interface->stop();
|
m_interface->stop();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -88,7 +88,7 @@ namespace river_test_record_callback {
|
|||||||
ememory::SharedPtr<testInCallback> process = ememory::makeShared<testInCallback>(manager);
|
ememory::SharedPtr<testInCallback> process = ememory::makeShared<testInCallback>(manager);
|
||||||
process->run();
|
process->run();
|
||||||
process.reset();
|
process.reset();
|
||||||
usleep(500000);
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
audio::river::unInit();
|
audio::river::unInit();
|
||||||
}
|
}
|
||||||
|
|
@@ -79,40 +79,40 @@ namespace river_test_volume {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_interface->start();
|
m_interface->start();
|
||||||
usleep(1000000);
|
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||||
m_interface->setParameter("volume", "FLOW", "-3dB");
|
m_interface->setParameter("volume", "FLOW", "-3dB");
|
||||||
TEST_INFO(" get volume : " << m_interface->getParameter("volume", "FLOW") );
|
TEST_INFO(" get volume : " << m_interface->getParameter("volume", "FLOW") );
|
||||||
usleep(500000);
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
m_interface->setParameter("volume", "FLOW", "-6dB");
|
m_interface->setParameter("volume", "FLOW", "-6dB");
|
||||||
TEST_INFO(" get volume : " << m_interface->getParameter("volume", "FLOW") );
|
TEST_INFO(" get volume : " << m_interface->getParameter("volume", "FLOW") );
|
||||||
usleep(500000);
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
m_interface->setParameter("volume", "FLOW", "-9dB");
|
m_interface->setParameter("volume", "FLOW", "-9dB");
|
||||||
TEST_INFO(" get volume : " << m_interface->getParameter("volume", "FLOW") );
|
TEST_INFO(" get volume : " << m_interface->getParameter("volume", "FLOW") );
|
||||||
usleep(500000);
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
m_interface->setParameter("volume", "FLOW", "-12dB");
|
m_interface->setParameter("volume", "FLOW", "-12dB");
|
||||||
TEST_INFO(" get volume : " << m_interface->getParameter("volume", "FLOW") );
|
TEST_INFO(" get volume : " << m_interface->getParameter("volume", "FLOW") );
|
||||||
usleep(500000);
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
m_interface->setParameter("volume", "FLOW", "-3dB");
|
m_interface->setParameter("volume", "FLOW", "-3dB");
|
||||||
TEST_INFO(" get volume : " << m_interface->getParameter("volume", "FLOW") );
|
TEST_INFO(" get volume : " << m_interface->getParameter("volume", "FLOW") );
|
||||||
usleep(500000);
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
m_interface->setParameter("volume", "FLOW", "3dB");
|
m_interface->setParameter("volume", "FLOW", "3dB");
|
||||||
TEST_INFO(" get volume : " << m_interface->getParameter("volume", "FLOW") );
|
TEST_INFO(" get volume : " << m_interface->getParameter("volume", "FLOW") );
|
||||||
usleep(500000);
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
m_interface->setParameter("volume", "FLOW", "6dB");
|
m_interface->setParameter("volume", "FLOW", "6dB");
|
||||||
TEST_INFO(" get volume : " << m_interface->getParameter("volume", "FLOW") );
|
TEST_INFO(" get volume : " << m_interface->getParameter("volume", "FLOW") );
|
||||||
usleep(500000);
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
m_interface->setParameter("volume", "FLOW", "9dB");
|
m_interface->setParameter("volume", "FLOW", "9dB");
|
||||||
TEST_INFO(" get volume : " << m_interface->getParameter("volume", "FLOW") );
|
TEST_INFO(" get volume : " << m_interface->getParameter("volume", "FLOW") );
|
||||||
usleep(500000);
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
m_interface->setParameter("volume", "FLOW", "0dB");
|
m_interface->setParameter("volume", "FLOW", "0dB");
|
||||||
TEST_INFO(" get volume : " << m_interface->getParameter("volume", "FLOW") );
|
TEST_INFO(" get volume : " << m_interface->getParameter("volume", "FLOW") );
|
||||||
usleep(500000);
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
m_manager->setVolume("MASTER", -3.0f);
|
m_manager->setVolume("MASTER", -3.0f);
|
||||||
TEST_INFO("get volume MASTER: " << m_manager->getVolume("MASTER") );
|
TEST_INFO("get volume MASTER: " << m_manager->getVolume("MASTER") );
|
||||||
usleep(500000);
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
m_manager->setVolume("MEDIA", -3.0f);
|
m_manager->setVolume("MEDIA", -3.0f);
|
||||||
TEST_INFO("get volume MEDIA: " << m_manager->getVolume("MEDIA") );
|
TEST_INFO("get volume MEDIA: " << m_manager->getVolume("MEDIA") );
|
||||||
usleep(1000000);
|
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||||
m_interface->stop();
|
m_interface->stop();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -124,7 +124,7 @@ namespace river_test_volume {
|
|||||||
ememory::SharedPtr<testCallbackVolume> process = ememory::makeShared<testCallbackVolume>(manager);
|
ememory::SharedPtr<testCallbackVolume> process = ememory::makeShared<testCallbackVolume>(manager);
|
||||||
process->run();
|
process->run();
|
||||||
process.reset();
|
process.reset();
|
||||||
usleep(500000);
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
audio::river::unInit();
|
audio::river::unInit();
|
||||||
}
|
}
|
||||||
|
|
@@ -1 +1 @@
|
|||||||
0.3.1
|
0.4.0
|
@@ -4,9 +4,9 @@
|
|||||||
* @license APACHE v2.0 (see license file)
|
* @license APACHE v2.0 (see license file)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <audio/river/widget/debug.h>
|
#include <audio/river/widget/debug.hpp>
|
||||||
#include <audio/river/widget/TemporalViewer.h>
|
#include <audio/river/widget/TemporalViewer.hpp>
|
||||||
#include <etk/tool.h>
|
#include <etk/tool.hpp>
|
||||||
|
|
||||||
static const int32_t nbSecond = 3;
|
static const int32_t nbSecond = 3;
|
||||||
|
|
||||||
|
@@ -5,11 +5,11 @@
|
|||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <ewol/widget/Widget.h>
|
#include <ewol/widget/Widget.hpp>
|
||||||
#include <ewol/compositing/Drawing.h>
|
#include <ewol/compositing/Drawing.hpp>
|
||||||
#include <audio/river/river.h>
|
#include <audio/river/river.hpp>
|
||||||
#include <audio/river/Manager.h>
|
#include <audio/river/Manager.hpp>
|
||||||
#include <audio/river/Interface.h>
|
#include <audio/river/Interface.hpp>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
|
||||||
namespace audio {
|
namespace audio {
|
@@ -4,7 +4,7 @@
|
|||||||
* @license APACHE v2.0 (see license file)
|
* @license APACHE v2.0 (see license file)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <audio/river/widget/debug.h>
|
#include <audio/river/widget/debug.hpp>
|
||||||
|
|
||||||
|
|
||||||
int32_t audio::river::widget::getLogId() {
|
int32_t audio::river::widget::getLogId() {
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <elog/log.h>
|
#include <elog/log.hpp>
|
||||||
|
|
||||||
namespace audio {
|
namespace audio {
|
||||||
namespace river {
|
namespace river {
|
@@ -1,7 +1,6 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
import lutin.module as module
|
|
||||||
import lutin.tools as tools
|
|
||||||
import lutin.debug as debug
|
import lutin.debug as debug
|
||||||
|
import lutin.tools as tools
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
@@ -26,17 +25,19 @@ def get_maintainer():
|
|||||||
def get_version():
|
def get_version():
|
||||||
return [0,0,0]
|
return [0,0,0]
|
||||||
|
|
||||||
def create(target, module_name):
|
def configure(target, my_module):
|
||||||
my_module = module.Module(__file__, module_name, get_type())
|
|
||||||
my_module.add_src_file([
|
my_module.add_src_file([
|
||||||
'audio/river/widget/TemporalViewer.cpp',
|
'audio/river/widget/TemporalViewer.cpp',
|
||||||
'audio/river/widget/debug.cpp'
|
'audio/river/widget/debug.cpp'
|
||||||
])
|
])
|
||||||
my_module.add_header_file([
|
my_module.add_header_file([
|
||||||
'audio/river/widget/TemporalViewer.h'
|
'audio/river/widget/TemporalViewer.hpp'
|
||||||
])
|
])
|
||||||
my_module.add_depend(['ewol', 'audio-river'])
|
my_module.add_depend([
|
||||||
my_module.add_path(tools.get_current_path(__file__))
|
'ewol',
|
||||||
return my_module
|
'audio-river'
|
||||||
|
])
|
||||||
|
my_module.add_path(".")
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user