playrecformatlab / playrec Goto Github PK
View Code? Open in Web Editor NEWA Matlab and Octave utility (MEX file) that provides simple yet versatile access to soundcards using PortAudio
Home Page: http://www.playrec.co.uk/
License: Other
A Matlab and Octave utility (MEX file) that provides simple yet versatile access to soundcards using PortAudio
Home Page: http://www.playrec.co.uk/
License: Other
Hi everyone,
I just wanted to announce that I have made an abstraction layer on top or playrec for doing real-time audio processing in Matlab/Octave. The code is available in our toolbox
http://ltfat.sourceforge.net/
It is really simple to use. The following example takes an input from a microphone and routes it trough the loop to the speakers allowing setting gain in a range of -20 to 20 dB.
block('playrec');
p = blockpanel({'GdB','Gain',-20,20,0,21});
while p.flag
gain = blockpanelget(p,'GdB');
f = blockread();
% You can do anything to f here
blockplay(f*10^(gain/20));
end
blockdone(p);
I tried to make it as versatile as possible. For anyone interested, here are some links:
http://ltfat.sourceforge.net/doc/blockproc_central.php
http://ltfat.sourceforge.net/doc/blockproc/block.php
I would appreciate any feedback.
Thanks
Zdenek
Hello,
I complied playrec for Octave v6.3.0 and Windows 10 with portaudio v19.7.0 and ASIO SDK v2.3.3. The compilation was successful (I got the playrec.mex file). I have the following devices available (result of the playrec('getDevices') command):
deviceID = 0, name = ASIO4ALL v2, hostAPI = ASIO
deviceID = 1, name = Realtek ASIO, hostAPI = ASIO
When I run the following command for initialization:
playrec('init',48000,1,-1)
I get the following error message:
error: playrec: Init failed to open PortAudio stream
{PortAudio Error [-9999]: Unanticipated host error}
When I ignore this error message and just run the initialization command again, I do not get the error again and I successfully initialize the device. The device after that works perfectly fine. I seriously do not understand why???
Can somebody please help me? How can I resolve this error?
Thank you very much.
Best regards
I followed the instructions on http://www.playrec.co.uk/compiling.html to install Playrec on my Ubuntu 17.04 Linux machine with GNU Octave 4.0.3. However, compiling Playrec failed with some unexpected reference to mac_osx.
The output from the Octave command line and the contents of the (relevant?) portaudio directory is shown below.
**** Octave output ****
>> compile_playrec
Please select the options required when compiling Playrec:
PortAudio installation directory [/home/mbrennwa/Desktop/playrec/lib/portaudio/]:
Use debug mode [Y]:
Use verbose mode [Y]:
Use case insensitive function names [N]:
Use Advanced Linux Sound Architecture (ALSA) [N]: y
Use AudioScience HPI [N]:
Use Jack Audio Connection Kit (JACK) [N]:
Use Open Sound System (OSS) [N]:
build_mex: Unable to find '/home/mbrennwa/Desktop/playrec/lib/portaudio/src/os/mac_osx'
Compiling Playrec failed, see the Command Window for more information.
**** portaudio files in .../src/os/ ****
ls -l /home/mbrennwa/Desktop/playrec/lib/portaudio/src/os/
total 8
drwxr-xr-x 2 mbrennwa mbrennwa 4096 Okt 30 02:23 unix
drwxr-xr-x 2 mbrennwa mbrennwa 4096 Okt 30 02:23 win
Hi everyone,
I am using:
According to https://github.com/PlayrecForMatlab/playrec/blob/master/m_files/build_mex.m#L27-28
the --std=c99 option is needed for portaudio. However it causes compile errors, if the ALSA API is selected via the GUI. The errors are due to the fact, that the source code of the portaudio's ALSA API uses "typeof". This is a an extension of the C-Standard, which is not accepted by the compiler, when specifying the ISO C99 Standard (--std=c99). Removing L28 does surprisingly solve the problem.
After the update to Debian Stretch playrec is not working out of the box so I recompiled the playrec mex file. Unfortunately, this was not working without some glitches.
These are the step that at least made the jack audio (JACK) backend work for me. I had no luck with ALSA. I didn't invest a lot of time, though, since I am happy with JACK.
Problem 1:
build_mex: Unable to find .../playrec/lib/portaudio/src/os/mac_osx
Solution 2 (from Installation/compilation fails on Linux with GNU Octave)
commenting out L53 ('src/os/mac_osx'
) of the file compile_playrec_fun.m
Problem 2
Portaudio is using C++ like Comments, but mex defaults to ANSI C.
Solution 2
uncomment L40 and modify it that is looks like below (remove the escape \
) :
build_args = {'CFLAGS="$CFLAGS -std=c99"', build_args{:}};
After this playrec with only the Jack Audio Connection Kit (JACK) Backend (API) activated, compiles with only a few deprecation warnings.
Problem 3
When using the updated playrec.mexa64 we see the following error:
playrec.mexa64: .../matlab/R2016b/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /usr/lib/x86_64-linux-gnu/libjack.so.0).
Solution 3 (from: 329796-issue-with-libstdc-so-6)
start Matlab with:
LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libstdc++.so.6" matlab
I am having a strange issue, where the CoreAudio option is greyed out when i run compile_playrec.m on a machine running OS X 10.11.4 and MATLAB 2016a.
If anyone has an idea for a solution I'd be happy to hear about it.
We were using a compiled 'playrec.mexmaci64' version of the Playrec with 2015/16 Matlab, and it worked well. Someone else had compiled it for us to include Mac's 'CoreAudio' as I couldn't get to include CoreAudio in the Playrec's compilation process.
I switched to Matlab 2017a, and unfortunatley the compiled Playrec is unresponsive. I have started a service request with Matlab to see if they can point us to what might be causing this. I will update what they say. But, if anyone has similar experience and have gotten Playrec to work for the 2017 Matlab and are willing to share details it would be great!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.